[GRASS-SVN] r39998 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Dec 14 11:53:10 EST 2009
Author: cmbarton
Date: 2009-12-14 11:53:09 -0500 (Mon, 14 Dec 2009)
New Revision: 39998
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
Log:
Fix sizing so that module dialogs open nicely on all platforms. Limit initial dialog size to a reasonable value for small screens.
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py 2009-12-14 11:49:27 UTC (rev 39997)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py 2009-12-14 16:53:09 UTC (rev 39998)
@@ -645,7 +645,23 @@
type=wx.BITMAP_TYPE_PNG))
topsizer.Add (item=self.logo, proportion=0, border=3,
flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL)
+
+ #
+ # put module description
+ #
+ if self.task.label != '':
+ module_desc = self.task.label + ' ' + self.task.description
+ else:
+ module_desc = self.task.description
+ self.description = StaticWrapText (parent=self.panel,
+ label=module_desc)
+ topsizer.Add (item=self.description, proportion=1, border=5,
+ flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)
+
guisizer.Add (item=topsizer, proportion=0, flag=wx.EXPAND)
+
+ self.panel.SetSizerAndFit(guisizer)
+ self.Layout()
# notebooks
self.notebookpanel = cmdPanel (parent=self.panel, task=self.task, standalone=self.standalone,
@@ -763,26 +779,13 @@
#self.notebookpanel.Layout()
#
- # put module description
- #
- if self.task.label != '':
- module_desc = self.task.label + os.linesep + self.task.description
- else:
- module_desc = self.task.description
- self.description = StaticWrapText (parent=self.panel,
- label=module_desc)
- topsizer.Add (item=self.description, proportion=1, border=5,
- flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)
-
- #
# do layout
#
guisizer.SetSizeHints(self.panel)
# called automatically by SetSizer()
self.panel.SetAutoLayout(True)
-# self.panel.SetSizer(guisizer)
- guisizer.Fit(self.panel)
-
+ self.panel.SetSizerAndFit(guisizer)
+
sizeFrame = self.GetBestSize()
self.SetMinSize(sizeFrame)
self.SetSize((sizeFrame[0], sizeFrame[1] +
@@ -795,9 +798,14 @@
self.resultQ = Queue.Queue()
self.updateThread = UpdateQThread(self.notebookpanel, self.requestQ, self.resultQ)
- self.SetSizer(guisizer)
self.Layout()
+ #keep initial window size limited for small screens
+ width,height = self.GetSizeTuple()
+ if width > 640: width = 640
+ if height > 480: height = 480
+ self.SetSize((width,height))
+
def updateValuesHook(self):
"""!Update status bar data"""
self.SetStatusText(' '.join(self.notebookpanel.createCmd(ignoreErrors = True)) )
More information about the grass-commit
mailing list