diff -r c02818d7e29f -r 7e61baa047f0 IDEFrame.py --- a/IDEFrame.py Mon Aug 14 22:30:41 2017 +0300 +++ b/IDEFrame.py Mon Aug 14 23:27:15 2017 +0300 @@ -193,19 +193,24 @@ import base64 + def EncodeFileSystemPath(path, use_base64=True): path = path.encode(sys.getfilesystemencoding()) if use_base64: return base64.encodestring(path) return path + def DecodeFileSystemPath(path, is_base64=True): if is_base64: path = base64.decodestring(path) return unicode(path, sys.getfilesystemencoding()) -# Compatibility function for wx versions < 2.6 + def AppendMenu(parent, help, id, kind, text): + """ + Compatibility function for wx versions < 2.6 + """ if wx.VERSION >= (2, 6, 0): parent.Append(help=help, id=id, kind=kind, text=text) else: @@ -215,6 +220,7 @@ POUINSTANCEVARIABLESPANEL, LIBRARYTREE, SCALING, PAGETITLES ] = range(10) + def GetShortcutKeyCallbackFunction(viewer_function): def ShortcutKeyFunction(self, event): control = self.FindFocus() @@ -226,6 +232,7 @@ control.ProcessEvent(event) return ShortcutKeyFunction + def GetDeleteElementFunction(remove_function, parent_type=None, check_function=None): def DeleteElementFunction(self, selected): name = self.ProjectTree.GetItemText(selected) @@ -245,6 +252,7 @@ TAB_BORDER = 7 NOTEBOOK_BORDER = 2 + def SimplifyTabLayout(tabs, rect): for tab in tabs: if tab["pos"][0] == rect.x: @@ -278,6 +286,7 @@ return True return False + def ComputeTabsLayout(tabs, rect): if len(tabs) == 0: return tabs @@ -323,6 +332,7 @@ UNEDITABLE_NAMES_DICT = dict([(_(name), name) for name in UNEDITABLE_NAMES]) + class IDEFrame(wx.Frame): # Compatibility function for wx versions < 2.6 @@ -2549,6 +2559,7 @@ UPPER_DIV = lambda x, y: (x / y) + {True : 0, False : 1}[(x % y) == 0] + class GraphicPrintout(wx.Printout): def __init__(self, viewer, page_size, margins, preview = False): wx.Printout.__init__(self)