[GRASS-SVN] r40000 -
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Dec 14 12:06:55 EST 2009
Author: cmbarton
Date: 2009-12-14 12:06:55 -0500 (Mon, 14 Dec 2009)
New Revision: 40000
Modified:
grass/branches/releasebranch_6_4/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/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py 2009-12-14 16:56:21 UTC (rev 39999)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py 2009-12-14 17:06:55 UTC (rev 40000)
@@ -755,9 +755,25 @@
'grass_form.png'),
type=wx.BITMAP_TYPE_PNG))
topsizer.Add (item=self.logo, proportion=0, border=3,
- flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL)
+ flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)
+
+ #
+ # 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,
mainFrame=self)
@@ -870,26 +886,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] +
@@ -902,9 +905,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