[GRASS-SVN] r31639 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 5 15:23:59 EDT 2008


Author: martinl
Date: 2008-06-05 15:23:59 -0400 (Thu, 05 Jun 2008)
New Revision: 31639

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py
Log:
wxGUI: statusbar mode for displays added to preferences

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py	2008-06-05 18:36:25 UTC (rev 31638)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py	2008-06-05 19:23:59 UTC (rev 31639)
@@ -83,6 +83,14 @@
 MAP_WINDOW_SIZE = (680, 520)
 HIST_WINDOW_SIZE = (500, 350)
 
+MAP_DISPLAY_STATUSBAR_MODE = [_("Coordinates"),
+                              _("Extent"),
+                              _("Comp. region"),
+                              _("Show comp. extent"),
+                              _("Display mode"),
+                              _("Display geometry"),
+                              _("Map scale")]
+
 """File name extension binaries/scripts"""
 if subprocess.mswindows:
     EXT_BIN = '.exe'

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py	2008-06-05 18:36:25 UTC (rev 31638)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py	2008-06-05 19:23:59 UTC (rev 31639)
@@ -2318,14 +2318,8 @@
         self.statusbar = self.CreateStatusBar(number=3, style=0)
         self.statusbar.SetStatusWidths([-5, -2, -1])
         self.toggleStatus = wx.Choice(self.statusbar, wx.ID_ANY,
-                                      choices = [_("Coordinates"),
-                                                 _("Extent"),
-                                                 _("Comp. region"),
-                                                 _("Show comp. extent"),
-                                                 _("Display mode"),
-                                                 _("Display geometry"),
-                                                 _("Map scale")])
-	self.toggleStatus.SetSelection(0)
+                                      choices = globalvar.MAP_DISPLAY_STATUSBAR_MODE)
+	self.toggleStatus.SetSelection(UserSettings.Get(group='display', key='statusbarMode', subkey='selection'))
         self.statusbar.Bind(wx.EVT_CHOICE, self.OnToggleStatus, self.toggleStatus)
         # auto-rendering checkbox
         self.autoRender = wx.CheckBox(parent=self.statusbar, id=wx.ID_ANY,

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py	2008-06-05 18:36:25 UTC (rev 31638)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py	2008-06-05 19:23:59 UTC (rev 31639)
@@ -35,6 +35,7 @@
 import gcmd
 import grassenv
 import utils
+import globalvar
 from debug import Debug as Debug
 
 class Settings:
@@ -73,6 +74,7 @@
                 'driver': { 'type': 'default' },
                 'compResolution' : { 'enabled' : False },
                 'autoRendering': { 'enabled' : False },
+                'statusbarMode': { 'selection' : 0 },
                 },
             #
             # advanced
@@ -232,6 +234,7 @@
                                                                 'verbose',
                                                                 'quiet']
         self.internalSettings['display']['driver']['choices'] = ['default']
+        self.internalSettings['display']['statusbarMode']['choices'] = globalvar.MAP_DISPLAY_STATUSBAR_MODE
         
     def GetMapsetPath(self):
         """Store mapset search path"""
@@ -653,9 +656,29 @@
 
 
         #
-        # display mode (use computation resolution?)
+        # Statusbar mode
         #
         row += 1
+        gridSizer.Add(item=wx.StaticText(parent=panel, id=wx.ID_ANY,
+                                         label=_("Statusbar mode:")),
+                      flag=wx.ALIGN_LEFT |
+                      wx.ALIGN_CENTER_VERTICAL,
+                      pos=(row, 0))
+        listOfModes = self.settings.Get(group='display', key='statusbarMode', subkey='choices', internal=True)
+        statusbarMode = wx.Choice(parent=panel, id=wx.ID_ANY, size=(150, -1),
+                                  choices=listOfModes,
+                                  name="GetSelection")
+        statusbarMode.SetSelection(self.settings.Get(group='display', key='statusbarMode', subkey='selection'))
+        self.winId['display:statusbarMode:selection'] = statusbarMode.GetId()
+
+        gridSizer.Add(item=statusbarMode,
+                      flag=wx.ALIGN_RIGHT,
+                      pos=(row, 1))
+
+        #
+        # Use computation resolution
+        #
+        row += 1
         compResolution = wx.CheckBox(parent=panel, id=wx.ID_ANY,
                                     label=_("Constrain display resolution to computational settings"),
                                     name="IsChecked")
@@ -1078,6 +1101,7 @@
                 value = win.GetStringSelection()
             else:
                 value = win.GetValue()
+
             self.settings.Set(group, key, subkey, value)
 
         #



More information about the grass-commit mailing list