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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 5 02:24:22 EDT 2011


Author: cmbarton
Date: 2011-11-04 23:24:22 -0700 (Fri, 04 Nov 2011)
New Revision: 49104

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 splitter window problem in command output page of module dialogs.

Modified: grass/trunk/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/goutput.py	2011-11-04 23:09:10 UTC (rev 49103)
+++ grass/trunk/gui/wxpython/gui_modules/goutput.py	2011-11-05 06:24:22 UTC (rev 49104)
@@ -249,22 +249,22 @@
         # thread
         self.cmdThread = CmdThread(self, self.requestQ, self.resultQ)
         
-        self.outputBox = wx.StaticBox(parent = self.panelPrompt, id = wx.ID_ANY,
+        self.outputBox = wx.StaticBox(parent = self.panelOutput, id = wx.ID_ANY,
                                       label = " %s " % _("Output window"))
-        self.cmdBox = wx.StaticBox(parent = self.panelPrompt, id = wx.ID_ANY,
+        self.cmdBox = wx.StaticBox(parent = self.panelOutput, id = wx.ID_ANY,
                                    label = " %s " % _("Command prompt"))
         
         # buttons
-        self.btnOutputClear = wx.Button(parent = self.panelPrompt, id = wx.ID_CLEAR)
+        self.btnOutputClear = wx.Button(parent = self.panelOutput, id = wx.ID_CLEAR)
         self.btnOutputClear.SetToolTipString(_("Clear output window content"))
-        self.btnCmdClear = wx.Button(parent = self.panelPrompt, id = wx.ID_CLEAR)
+        self.btnCmdClear = wx.Button(parent = self.panelOutput, id = wx.ID_CLEAR)
         self.btnCmdClear.SetToolTipString(_("Clear command prompt content"))
         if self.parent.GetName() != 'LayerManager':
             self.btnCmdClear.Hide()
-        self.btnOutputSave  = wx.Button(parent = self.panelPrompt, id = wx.ID_SAVE)
+        self.btnOutputSave  = wx.Button(parent = self.panelOutput, id = wx.ID_SAVE)
         self.btnOutputSave.SetToolTipString(_("Save output window content to the file"))
         # abort
-        self.btnCmdAbort = wx.Button(parent = self.panelPrompt, id = wx.ID_STOP)
+        self.btnCmdAbort = wx.Button(parent = self.panelOutput, id = wx.ID_STOP)
         self.btnCmdAbort.SetToolTipString(_("Abort running command"))
         self.btnCmdAbort.Enable(False)
         
@@ -283,6 +283,9 @@
         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,
+                        flag = wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border = 3)
         
         if self.search and self.search.IsShown():
             outputSizer.Add(item = self.searchPane, proportion = 0,
@@ -291,14 +294,11 @@
                         flag = wx.EXPAND | wx.ALL, border = 3)
         outputSizer.Add(item = self.progressbar, proportion = 0,
                         flag = wx.EXPAND | wx.LEFT | wx.RIGHT, border = 3)
-        
-        promptSizer.Add(item = self.cmdPrompt, proportion = 1,
-                        flag = wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border = 3)
-        
         outBtnSizer.Add(item = self.btnOutputClear, proportion = 1,
                         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,
@@ -308,7 +308,7 @@
                      flag = wx.ALL | wx.ALIGN_CENTER, border = 5)
         btnSizer.Add(item = cmdBtnSizer, proportion = 1,
                      flag = wx.ALIGN_CENTER | wx.TOP | wx.BOTTOM | wx.RIGHT, border = 5)
-        promptSizer.Add(item = btnSizer, proportion = 0,
+        outputSizer.Add(item = btnSizer, proportion = 0,
                         flag = wx.EXPAND)
         
         outputSizer.Fit(self)
@@ -323,7 +323,7 @@
         # split window
         if self.parent.GetName() == 'LayerManager':
             self.SplitHorizontally(self.panelOutput, self.panelPrompt, -50)
-            self.SetMinimumPaneSize(self.btnCmdClear.GetSize()[1] + 85)
+            self.SetMinimumPaneSize(self.btnCmdClear.GetSize()[1] + 50)
         else:
             self.SplitHorizontally(self.panelOutput, self.panelPrompt, -45)
             self.SetMinimumPaneSize(self.btnCmdClear.GetSize()[1] + 25)

Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2011-11-04 23:09:10 UTC (rev 49103)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2011-11-05 06:24:22 UTC (rev 49104)
@@ -483,11 +483,12 @@
         self.btn_cancel.SetToolTipString(_("Close this window without executing the command (Ctrl+Q)"))
         btnsizer.Add(item = self.btn_cancel, proportion = 0, flag = wx.ALL | wx.ALIGN_CENTER, border = 10)
         self.btn_cancel.Bind(wx.EVT_BUTTON, self.OnCancel)
+
         if self.get_dcmd is not None: # A callback has been set up
             btn_apply = wx.Button(parent = self.panel, id = wx.ID_APPLY)
             btn_ok = wx.Button(parent = self.panel, id = wx.ID_OK)
             btn_ok.SetDefault()
-            
+
             btnsizer.Add(item = btn_apply, proportion = 0,
                          flag = wx.ALL | wx.ALIGN_CENTER,
                          border = 10)
@@ -838,6 +839,8 @@
         ### 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-04 23:09:10 UTC (rev 49103)
+++ grass/trunk/gui/wxpython/wxgui.py	2011-11-05 06:24:22 UTC (rev 49104)
@@ -218,7 +218,7 @@
         self.goutput.Redirect()
         
         # fix goutput's pane size (required for Mac OSX)
-        self.goutput.SetSashPosition(int(self.GetSize()[1] * .54))
+        self.goutput.SetSashPosition(int(self.GetSize()[1] * .80))
         
         self.workspaceChanged = False
         



More information about the grass-commit mailing list