[GRASS-SVN] r57384 - in grass/trunk/gui/wxpython: gcp mapdisp

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 3 13:29:18 PDT 2013


Author: wenzeslaus
Date: 2013-08-03 13:29:18 -0700 (Sat, 03 Aug 2013)
New Revision: 57384

Modified:
   grass/trunk/gui/wxpython/gcp/mapdisplay.py
   grass/trunk/gui/wxpython/mapdisp/statusbar.py
Log:
wxGUI/gcp: implementing r57383 for gcp and fixing default statusbar mode which was ignored

Modified: grass/trunk/gui/wxpython/gcp/mapdisplay.py
===================================================================
--- grass/trunk/gui/wxpython/gcp/mapdisplay.py	2013-08-03 19:43:48 UTC (rev 57383)
+++ grass/trunk/gui/wxpython/gcp/mapdisplay.py	2013-08-03 20:29:18 UTC (rev 57384)
@@ -109,8 +109,6 @@
         self.statusbarManager.AddStatusbarItem(sb.SbRender(self, statusbar = statusbar, position = 3))
         
         self.statusbarManager.SetMode(8) # goto GCP
-        self.statusbarManager.Update()
-        
 
         #
         # Init map display (buffered DC & set default cursor)
@@ -215,7 +213,11 @@
 
         self.decorationDialog = None # decoration/overlays
 
+        # doing nice things in statusbar when other things are ready
+        self.statusbarManager.Update()
+
     def _setUpMapWindow(self, mapWindow):
+        # TODO: almost the smae implementation as for MapFrameBase (only names differ)
         # enable or disable zoom history tool
         mapWindow.zoomHistoryAvailable.connect(
             lambda:
@@ -223,6 +225,7 @@
         mapWindow.zoomHistoryUnavailable.connect(
             lambda:
             self.GetMapToolbar().Enable('zoomback', enable=False))
+        mapWindow.mouseMoving.connect(self.CoordinatesChanged)
 
     def AddToolbar(self, name):
         """!Add defined toolbar to the window

Modified: grass/trunk/gui/wxpython/mapdisp/statusbar.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/statusbar.py	2013-08-03 19:43:48 UTC (rev 57383)
+++ grass/trunk/gui/wxpython/mapdisp/statusbar.py	2013-08-03 20:29:18 UTC (rev 57384)
@@ -81,6 +81,7 @@
         self.statusbarItems = dict()
         
         self._postInitialized = False
+        self._modeIndexSet = False
         
         self.progressbar = SbProgress(self.mapFrame, self.statusbar, self)
         self.progressbar.progressShown.connect(self._progressShown)
@@ -200,10 +201,11 @@
                          subkey = 'choices',
                          value = self.choice.GetItems(),
                          internal = True)
-        
-        self.choice.SetSelection(UserSettings.Get(group = 'display',
-                                                  key = 'statusbarMode',
-                                                  subkey = 'selection')) 
+
+        if not self._modeIndexSet:
+            self.choice.SetSelection(UserSettings.Get(group = 'display',
+                                                      key = 'statusbarMode',
+                                                      subkey = 'selection'))
         self.Reposition()
         
         self._postInitialized = True
@@ -293,6 +295,7 @@
         
         Mode is usually driven by user through choice.
         """
+        self._modeIndexSet = True
         self.choice.SetSelection(modeIndex)
     
     def GetMode(self):



More information about the grass-commit mailing list