Ver código fonte

wxGUI/gcp: implementing https://trac.osgeo.org/grass/changeset/57383 for gcp and fixing default statusbar mode which was ignored

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@57384 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 11 anos atrás
pai
commit
4941f7864a
2 arquivos alterados com 12 adições e 6 exclusões
  1. 5 2
      gui/wxpython/gcp/mapdisplay.py
  2. 7 4
      gui/wxpython/mapdisp/statusbar.py

+ 5 - 2
gui/wxpython/gcp/mapdisplay.py

@@ -109,8 +109,6 @@ class MapFrame(SingleMapFrame):
         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 @@ class MapFrame(SingleMapFrame):
 
         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 @@ class MapFrame(SingleMapFrame):
         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

+ 7 - 4
gui/wxpython/mapdisp/statusbar.py

@@ -81,6 +81,7 @@ class SbManager:
         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 @@ class SbManager:
                          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 @@ class SbManager:
         
         Mode is usually driven by user through choice.
         """
+        self._modeIndexSet = True
         self.choice.SetSelection(modeIndex)
     
     def GetMode(self):