[GRASS-SVN] r46724 - in
grass/branches/releasebranch_6_4/gui/wxpython: . gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jun 16 08:38:12 EDT 2011
Author: martinl
Date: 2011-06-16 05:38:11 -0700 (Thu, 16 Jun 2011)
New Revision: 46724
Modified:
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py
grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py
Log:
wxGUI: fix toolbars position on MS Windows
(merge r46722 from trunk)
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py 2011-06-16 12:33:01 UTC (rev 46723)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py 2011-06-16 12:38:11 UTC (rev 46724)
@@ -345,7 +345,7 @@
LeftDockable(False).RightDockable(False).
BottomDockable(False).TopDockable(True).
CloseButton(False).Layer(2).
- BestSize((self.toolbars['vdigit'].GetSize())))
+ BestSize((self.toolbars['vdigit'].GetBestSize())))
# change mouse to draw digitized line
self.MapWindow.mouse['box'] = "point"
self.MapWindow.zoomtype = 0
@@ -410,12 +410,13 @@
CloseButton(False).DestroyOnClose(True).
Layer(0))
self._mgr.AddPane(self.toolbars['nviz'],
- wx.aui.AuiPaneInfo().
+ wx.aui.AuiPaneInfo().
Name("nviztoolbar").Caption(_("3D View Toolbar")).
ToolbarPane().Top().Row(1).
LeftDockable(False).RightDockable(False).
BottomDockable(False).TopDockable(True).
- CloseButton(False).Layer(2))
+ CloseButton(False).Layer(2).
+ BestSize((self.toolbars['nviz'].GetBestSize())))
self.SetStatusText("", 0)
@@ -440,8 +441,8 @@
LeftDockable(False).RightDockable(False).
BottomDockable(False).TopDockable(True).
CloseButton(False).Layer(2).
- BestSize((self.toolbars['map'].GetSize())))
-
+ BestSize((self.toolbars['map'].GetBestSize())))
+
# vector digitizer
elif name == "vdigit":
self._addToolbarVDigit()
@@ -455,7 +456,8 @@
ToolbarPane().Top().
LeftDockable(False).RightDockable(False).
BottomDockable(False).TopDockable(True).
- CloseButton(False).Layer(2))
+ CloseButton(False).Layer(2).
+ BestSize((self.toolbars['georect'].GetBestSize())))
# nviz
elif name == "nviz":
self._addToolbarNviz()
Modified: grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py 2011-06-16 12:33:01 UTC (rev 46723)
+++ grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py 2011-06-16 12:38:11 UTC (rev 46724)
@@ -133,38 +133,35 @@
'tools' : LMToolsToolbar(parent = self),
'misc' : LMMiscToolbar(parent = self) }
- self._auimgr.AddPane(self.toolbars['data'],
- wx.aui.AuiPaneInfo().
- Name("toolbarData").Caption(_("Data Toolbar")).
- ToolbarPane().Top().
- LeftDockable(False).RightDockable(False).
- BottomDockable(False).TopDockable(True).
- CloseButton(False).Layer(3).
- BestSize((self.toolbars['data'].GetSize())))
- self._auimgr.AddPane(self.toolbars['workspace'],
- wx.aui.AuiPaneInfo().
- Name("toolbarWorkspace").Caption(_("Workspace Toolbar")).
- ToolbarPane().Top().
- LeftDockable(False).RightDockable(False).
- BottomDockable(False).TopDockable(True).
- CloseButton(False).Layer(3).
- BestSize((self.toolbars['workspace'].GetSize())))
- self._auimgr.AddPane(self.toolbars['misc'],
- wx.aui.AuiPaneInfo().
- Name("toolbarMisc").Caption(_("Misc Toolbar")).
- ToolbarPane().Top().
- LeftDockable(False).RightDockable(False).
- BottomDockable(False).TopDockable(True).
- CloseButton(False).Layer(2).
- BestSize((self.toolbars['misc'].GetSize())))
- self._auimgr.AddPane(self.toolbars['tools'],
- wx.aui.AuiPaneInfo().
- Name("toolbarTools").Caption(_("Tools Toolbar")).
- ToolbarPane().Top().
- LeftDockable(False).RightDockable(False).
- BottomDockable(False).TopDockable(True).
- CloseButton(False).Layer(2).
- BestSize((self.toolbars['tools'].GetSize())))
+ self._toolbarsData = { 'workspace' : ("toolbarWorkspace", # name
+ _("Workspace Toolbar"), # caption
+ 1), # row
+ 'data' : ("toolbarData",
+ _("Data Toolbar"),
+ 1),
+ 'misc' : ("toolbarMisc",
+ _("Misc Toolbar"),
+ 2),
+ 'tools' : ("toolbarTools",
+ _("Tools Toolbar"),
+ 2),
+ }
+ if sys.platform == 'win32':
+ self._toolbarsList = ('workspace', 'data',
+ 'tools', 'misc')
+ else:
+ self._toolbarsList = ('data', 'workspace',
+ 'misc', 'tools')
+ for toolbar in self._toolbarsList:
+ name, caption, row = self._toolbarsData[toolbar]
+ self._auimgr.AddPane(self.toolbars[toolbar],
+ wx.aui.AuiPaneInfo().
+ Name(name).Caption(caption).
+ ToolbarPane().Top().Row(row).
+ LeftDockable(False).RightDockable(False).
+ BottomDockable(False).TopDockable(True).
+ CloseButton(False).Layer(2).
+ BestSize((self.toolbars[toolbar].GetBestSize())))
# bindings
self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
More information about the grass-commit
mailing list