[GRASS-SVN] r30428 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Mar 3 01:18:24 EST 2008
Author: martinl
Date: 2008-03-03 01:18:24 -0500 (Mon, 03 Mar 2008)
New Revision: 30428
Modified:
grass/trunk/gui/wxpython/gui_modules/mapdisp.py
grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI: (menuform) window layout cosmetics (minsize)
Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py 2008-03-02 19:23:27 UTC (rev 30427)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py 2008-03-03 06:18:24 UTC (rev 30428)
@@ -2654,15 +2654,15 @@
wWin = rect.width - 6
# -> position
if win == self.showRegion:
- x, y = rect.x + rect.width - wWin, rect.y - 2
+ x, y = rect.x + rect.width - wWin, rect.y - 1
else:
- x, y = rect.x + 3, rect.y - 2
+ x, y = rect.x + 3, rect.y - 1
w, h = wWin, rect.height + 2
else: # choice || auto-rendering
- x, y = rect.x, rect.y - 2
+ x, y = rect.x, rect.y - 1
w, h = rect.width, rect.height + 2
if idx == 2:
- x += 10
+ x += 5
win.SetPosition((x, y))
win.SetSize((w, h))
Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py 2008-03-02 19:23:27 UTC (rev 30427)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py 2008-03-03 06:18:24 UTC (rev 30428)
@@ -613,7 +613,7 @@
if self.notebookpanel.hasMain:
# We have to wait for the notebookpanel to be filled in order
# to know if there actually is a Main tab
- status_text += _(" (those of Main in bold typeface are required)")
+ status_text += _(" (those in bold typeface are required)")
try:
self.task.getCmd()
self.updateValuesHook()
@@ -674,25 +674,26 @@
self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
- constrained_size = self.notebookpanel.GetSize()
+ #constrained_size = self.notebookpanel.GetSize()
# 80 takes the tabbar into account
- self.notebookpanel.SetSize( (constrained_size[0] + 25, constrained_size[1] + 80) )
- self.notebookpanel.Layout()
+ #self.notebookpanel.SetSize( (constrained_size[0] + 25, constrained_size[1]) )
+ #self.notebookpanel.Layout()
# for too long descriptions
self.description = StaticWrapText (parent=self.panel, label=self.task.description)
topsizer.Add (item=self.description, proportion=1, border=5,
flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)
- # set frame size
- self.SetSize(self.notebookpanel.GetSize())
- self.SetMinSize(self.notebookpanel.GetSize())
-
+ # do layout
guisizer.SetSizeHints(self.panel)
- self.panel.SetAutoLayout(True)
+ # called automatically by SetSizer()
+ self.panel.SetAutoLayout(True)
self.panel.SetSizer(guisizer)
guisizer.Fit(self.panel)
+ # set frame size
+ self.SetMinSize(self.GetBestSize())
+
self.Layout()
def updateValuesHook(self):
@@ -1105,23 +1106,24 @@
#
maxsizes = (0,0)
for section in sections:
- tabsizer[section].SetSizeHints( tab[section] )
- tab[section].SetAutoLayout(True)
+ # tabsizer[section].SetSizeHints( tab[section] )
+ #tab[section].SetAutoLayout(True)
tab[section].SetSizer( tabsizer[section] )
tabsizer[section].Fit( tab[section] )
tab[section].Layout()
- minsecsizes = tabsizer[section].GetMinSize()
+ minsecsizes = tabsizer[section].GetSize()
maxsizes = map( lambda x: max( maxsizes[x], minsecsizes[x] ), (0,1) )
# TODO: be less arbitrary with these 600
- constrained_size = (min(600, maxsizes[0]), min(600, maxsizes[1]) + 25 )
+ constrained_size = (min(600, maxsizes[0]), min(600, maxsizes[1]))
for section in sections:
tab[section].SetMinSize( constrained_size )
+ tab[section].SetSize( constrained_size )
if manual_tab.Ok:
manual_tab.SetMinSize( constrained_size )
self.SetSizer( panelsizer )
panelsizer.Fit(self)
- self.hasMain = tab.has_key( _('Main') ) # publish, to enclosing Frame for instance
+ self.hasMain = tab.has_key( _('Required') ) # publish, to enclosing Frame for instance
def OnVerbosity(self, event):
"""Verbosity level changed"""
More information about the grass-commit
mailing list