[GRASS-SVN] r49108 - in grass/trunk/gui/wxpython: . gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 5 09:37:09 EDT 2011


Author: martinl
Date: 2011-11-05 06:37:08 -0700 (Sat, 05 Nov 2011)
New Revision: 49108

Modified:
   grass/trunk/gui/wxpython/gui_modules/goutput.py
   grass/trunk/gui/wxpython/gui_modules/menuform.py
   grass/trunk/gui/wxpython/wxgui.py
Log:
wxGUI: fix r49104


Modified: grass/trunk/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/goutput.py	2011-11-05 11:41:16 UTC (rev 49107)
+++ grass/trunk/gui/wxpython/gui_modules/goutput.py	2011-11-05 13:37:08 UTC (rev 49108)
@@ -279,12 +279,13 @@
     def _layout(self):
         """!Do layout"""
         outputSizer = wx.BoxSizer(wx.VERTICAL)
-        promptSizer = wx.BoxSizer(wx.VERTICAL)
         btnSizer = wx.BoxSizer(wx.HORIZONTAL)
         outBtnSizer = wx.StaticBoxSizer(self.outputBox, wx.HORIZONTAL)
         cmdBtnSizer = wx.StaticBoxSizer(self.cmdBox, wx.HORIZONTAL)
-
-        promptSizer.Add(item = self.cmdPrompt, proportion = 1,
+        
+        if self.cmdPrompt.IsShown():
+            promptSizer = wx.BoxSizer(wx.VERTICAL)
+            promptSizer.Add(item = self.cmdPrompt, proportion = 1,
                         flag = wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border = 3)
         
         if self.search and self.search.IsShown():
@@ -298,7 +299,7 @@
                         flag = wx.ALIGN_LEFT | wx.LEFT | wx.RIGHT, border = 5)
         outBtnSizer.Add(item = self.btnOutputSave, proportion = 1,
                         flag = wx.ALIGN_RIGHT | wx.RIGHT, border = 5)
-
+        
         cmdBtnSizer.Add(item = self.btnCmdClear, proportion = 1,
                         flag = wx.ALIGN_CENTER | wx.LEFT | wx.RIGHT, border = 5)
         cmdBtnSizer.Add(item = self.btnCmdAbort, proportion = 1,
@@ -313,20 +314,20 @@
         
         outputSizer.Fit(self)
         outputSizer.SetSizeHints(self)
+        self.panelOutput.SetSizer(outputSizer)
         
-        promptSizer.Fit(self)
-        promptSizer.SetSizeHints(self)
+        if self.cmdPrompt.IsShown():
+            promptSizer.Fit(self)
+            promptSizer.SetSizeHints(self)
+            self.panelPrompt.SetSizer(promptSizer)
         
-        self.panelOutput.SetSizer(outputSizer)
-        self.panelPrompt.SetSizer(promptSizer)
-        
         # split window
-        if self.parent.GetName() == 'LayerManager':
+        if self.cmdPrompt.IsShown():
             self.SplitHorizontally(self.panelOutput, self.panelPrompt, -50)
-            self.SetMinimumPaneSize(self.btnCmdClear.GetSize()[1] + 50)
         else:
             self.SplitHorizontally(self.panelOutput, self.panelPrompt, -45)
-            self.SetMinimumPaneSize(self.btnCmdClear.GetSize()[1] + 25)
+            self.Unsplit()
+        self.SetMinimumPaneSize(self.btnCmdClear.GetSize()[1] + 25)
         
         self.SetSashGravity(1.0)
         

Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2011-11-05 11:41:16 UTC (rev 49107)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2011-11-05 13:37:08 UTC (rev 49108)
@@ -839,8 +839,6 @@
         ### add 'command output' tab regardless standalone dialog
         if self.parent.GetName() ==  "MainFrame" and self.parent.get_dcmd is None:
             self.goutput = goutput.GMConsole(parent = self, margin = False)
-            self.goutput.Unsplit()
-            self.outputBox = self.goutput.outputBox
             self.outpage = self.notebook.AddPage(page = self.goutput, text = _("Command output"), name = 'output')
         else:
             self.goutput = None

Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py	2011-11-05 11:41:16 UTC (rev 49107)
+++ grass/trunk/gui/wxpython/wxgui.py	2011-11-05 13:37:08 UTC (rev 49108)
@@ -217,8 +217,12 @@
         # redirect stderr to log area    
         self.goutput.Redirect()
         
-        # fix goutput's pane size (required for Mac OSX)
-        self.goutput.SetSashPosition(int(self.GetSize()[1] * .80))
+        # fix goutput's pane size (required for Mac OSX)`
+        if sys.platform == 'darwin':
+            coef = .80
+        else:
+            coef = .54
+        self.goutput.SetSashPosition(int(self.GetSize()[1] * coef))
         
         self.workspaceChanged = False
         



More information about the grass-commit mailing list