From 5bc33a8f5c178c22cd9cd3418e5abd542c7e2913 Mon Sep 17 00:00:00 2001 From: lcapocchi Date: Fri, 6 Mar 2020 04:30:49 -0500 Subject: [PATCH 1/2] dynamic size for SimulationGUI --- SimulationGUI.py | 8 ++++---- devsimpy.py | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/SimulationGUI.py b/SimulationGUI.py index 5bf972cc..470468bd 100644 --- a/SimulationGUI.py +++ b/SimulationGUI.py @@ -836,10 +836,10 @@ def __init__(self, parent, id, title, master): wx.Frame.__init__(self, parent, id, title, style= wx.DEFAULT_FRAME_STYLE) ### adapt size of frame depending on the plate-form - if '__WXMSW__' in wx.PlatformInfo: - self.SetSize((320,280)) - else: - self.SetSize((280,160)) + #if '__WXMSW__' in wx.PlatformInfo: + # self.SetSize((320,280)) + #else: + # self.SetSize((280,160)) # disable the roll out of the frame self.SetMinSize(self.GetSize()) diff --git a/devsimpy.py b/devsimpy.py index 1a994ac8..132de240 100644 --- a/devsimpy.py +++ b/devsimpy.py @@ -558,6 +558,7 @@ def MakeToolBar(self): self.tb.AddTool(self.toggle_list[2], wx.Bitmap(os.path.join(ICON_PATH,'linear_connector.png')), shortHelpString=_('Linear'), longHelpString=_('Linear connector'), isToggle=True) ] else: + self.tools = [ self.tb.AddTool(wx.ID_NEW, "",wx.Bitmap(os.path.join(ICON_PATH,'new.png')), shortHelp=_('New diagram (Ctrl+N)')), self.tb.AddTool(wx.ID_OPEN, "",wx.Bitmap(os.path.join(ICON_PATH,'open.png')), shortHelp=_('Open File (Ctrl+O)')), self.tb.AddTool(wx.ID_PREVIEW_PRINT, "",wx.Bitmap(os.path.join(ICON_PATH,'print-preview.png')), shortHelp=_('Print Preview (Ctrl+P)')), @@ -582,7 +583,7 @@ def MakeToolBar(self): level = currentPage.GetCurrentLevel() level_label = wx.StaticText(self.tb, -1, _("Level ")) - self.spin = wx.SpinCtrl(self.tb, self.toggle_list[3], str(level), (55, 90), (50, -1), min=0, max=10) + self.spin = wx.SpinCtrl(self.tb, self.toggle_list[3], str(level), pos=(55, 90), size=(50, -1), min=0, max=20) self.tb.AddControl(level_label) self.tb.AddControl(self.spin) From e4eb79ac15a4c1d7f570a2f08a241516a9917242 Mon Sep 17 00:00:00 2001 From: lcapocchi Date: Fri, 6 Mar 2020 04:41:57 -0500 Subject: [PATCH 2/2] bug fix for PropertiesGridControl on Linux --- AttributeEditor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AttributeEditor.py b/AttributeEditor.py index 9c368f18..bd2c365f 100644 --- a/AttributeEditor.py +++ b/AttributeEditor.py @@ -64,7 +64,7 @@ def __init__(self, parent, ID, model, canvas): # Create a box sizer for self self._box = wx.BoxSizer(wx.VERTICAL) - self._box.Add(self._list, 1, wx.ALL|wx.EXPAND) + self._box.Add(self._list, 1, wx.EXPAND|wx.ALL) ###linecache module which inspect uses. It caches the file contents and does not reload it accordingly. linecache.clearcache() @@ -80,7 +80,7 @@ def __init__(self, parent, ID, model, canvas): self.SetSizer(self._box) -# self._box.SetSizeHints(self) + self._box.SetSizeHints(self) self.CenterOnParent() self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)