[GRASS-SVN] r52696 - in grass/branches/develbranch_6/gui/wxpython: gcp gui_core mapdisp

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Aug 17 05:52:34 PDT 2012


Author: mmetz
Date: 2012-08-17 05:52:33 -0700 (Fri, 17 Aug 2012)
New Revision: 52696

Modified:
   grass/branches/develbranch_6/gui/wxpython/gcp/manager.py
   grass/branches/develbranch_6/gui/wxpython/gcp/mapdisplay.py
   grass/branches/develbranch_6/gui/wxpython/gcp/toolbars.py
   grass/branches/develbranch_6/gui/wxpython/gui_core/toolbars.py
   grass/branches/develbranch_6/gui/wxpython/mapdisp/mapwindow.py
   grass/branches/develbranch_6/gui/wxpython/mapdisp/statusbar.py
Log:
wx GCP Manager: backport fixes from trunk

Modified: grass/branches/develbranch_6/gui/wxpython/gcp/manager.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gcp/manager.py	2012-08-17 12:50:58 UTC (rev 52695)
+++ grass/branches/develbranch_6/gui/wxpython/gcp/manager.py	2012-08-17 12:52:33 UTC (rev 52696)
@@ -1971,6 +1971,8 @@
         self.ResizeColumns()
         self.render = True
 
+        self.EnsureVisible(self.selected)
+
     def OnCheckItem(self, index, flag):
         """!Item is checked/unchecked"""
 
@@ -2007,6 +2009,8 @@
 
         self.ResizeColumns()
 
+        self.EnsureVisible(self.selected)
+
         return self.selected
 
     def DeleteGCPItem(self):

Modified: grass/branches/develbranch_6/gui/wxpython/gcp/mapdisplay.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gcp/mapdisplay.py	2012-08-17 12:50:58 UTC (rev 52695)
+++ grass/branches/develbranch_6/gui/wxpython/gcp/mapdisplay.py	2012-08-17 12:52:33 UTC (rev 52696)
@@ -317,9 +317,8 @@
         Zoom in the map.
         Set mouse cursor, zoombox attributes, and zoom direction
         """
-        if self.GetToolbar('map'):
-            self.toolbars['map'].OnTool(event)
-            self.toolbars['map'].action['desc'] = ''
+        self.toolbars['gcpdisp'].OnTool(event)
+        self.toolbars['gcpdisp'].action['desc'] = ''
         
         self.MapWindow.mouse['use'] = "zoom"
         self.MapWindow.mouse['box'] = "box"
@@ -347,9 +346,8 @@
         Zoom out the map.
         Set mouse cursor, zoombox attributes, and zoom direction
         """
-        if self.GetToolbar('map'):
-            self.toolbars['map'].OnTool(event)
-            self.toolbars['map'].action['desc'] = ''
+        self.toolbars['gcpdisp'].OnTool(event)
+        self.toolbars['gcpdisp'].action['desc'] = ''
         
         self.MapWindow.mouse['use'] = "zoom"
         self.MapWindow.mouse['box'] = "box"
@@ -376,9 +374,8 @@
         """
         Panning, set mouse to drag
         """
-        if self.GetToolbar('map'):
-            self.toolbars['map'].OnTool(event)
-            self.toolbars['map'].action['desc'] = ''
+        self.toolbars['gcpdisp'].OnTool(event)
+        self.toolbars['gcpdisp'].action['desc'] = ''
         
         self.MapWindow.mouse['use'] = "pan"
         self.MapWindow.mouse['box'] = "pan"

Modified: grass/branches/develbranch_6/gui/wxpython/gcp/toolbars.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gcp/toolbars.py	2012-08-17 12:50:58 UTC (rev 52695)
+++ grass/branches/develbranch_6/gui/wxpython/gcp/toolbars.py	2012-08-17 12:52:33 UTC (rev 52696)
@@ -39,12 +39,8 @@
 
     def _toolbarData(self):
         icons = {
-            'gcpSave'    : MetaIcon(img = 'gcp-save',
-                                    label = _('Save GCPs to POINTS file')),
-            'gcpReload'  : MetaIcon(img = 'reload',
-                                    label = _('Reload GCPs from POINTS file')),
             'gcpAdd'     : MetaIcon(img = 'gcp-add',
-                                    label = _('Add new GCP')),
+                                    label = _('Add new GCP to the list')),
             'gcpDelete'  : MetaIcon(img = 'gcp-delete',
                                     label = _('Delete selected GCP')),
             'gcpClear'   : MetaIcon(img = 'gcp-remove',
@@ -53,14 +49,13 @@
                                     label = _('Recalculate RMS error')),
             'georectify' : MetaIcon(img = 'georectify',
                                     label = _('Georectify')),
+            'gcpSave'    : MetaIcon(img = 'gcp-save',
+                                    label = _('Save GCPs to POINTS file')),
+            'gcpReload'  : MetaIcon(img = 'reload',
+                                    label = _('Reload GCPs from POINTS file')),
             }
         
-        return self._getToolbarData((('gcpSave', icons["gcpSave"],
-                                      self.parent.SaveGCPs),
-                                     ('gcpReload', icons["gcpReload"],
-                                      self.parent.ReloadGCPs),
-                                     (None, ),
-                                     ('gcpAdd', icons["gcpAdd"],
+        return self._getToolbarData((('gcpAdd', icons["gcpAdd"],
                                       self.parent.AddGCP),
                                      ('gcpDelete', icons["gcpDelete"],
                                       self.parent.DeleteGCP),
@@ -70,7 +65,12 @@
                                      ('rms', icons["gcpRms"],
                                       self.parent.OnRMS),
                                      ('georect', icons["georectify"],
-                                      self.parent.OnGeorect))
+                                      self.parent.OnGeorect),
+                                     (None, ),
+                                     ('gcpSave', icons["gcpSave"],
+                                      self.parent.SaveGCPs),
+                                     ('gcpReload', icons["gcpReload"],
+                                      self.parent.ReloadGCPs))
                                     )
     
 class GCPDisplayToolbar(BaseToolbar):
@@ -111,8 +111,8 @@
         """!Toolbar data"""
         icons = {
             'gcpSet'    : MetaIcon(img = 'gcp-create',
-                                   label = _('Set GCP'),
-                                   desc = _('Define GCP (Ground Control Points)')),
+                                   label = _('Update GCP coordinates'),
+                                   desc = _('Update GCP coordinates)')),
             'quit'      : BaseIcons['quit'].SetLabel(_('Quit georectification tool')),
             'settings'  : BaseIcons['settings'].SetLabel( _('Georectifier settings')),
             'help'      : BaseIcons['help'].SetLabel(_('Georectifier manual')),
@@ -126,13 +126,17 @@
                                       self.parent.OnErase),
                                      (None, ),
                                      ("gcpset", icons["gcpSet"],
-                                      self.parent.OnPointer),
+                                      self.parent.OnPointer,
+                                      wx.ITEM_CHECK),
                                      ("pan", BaseIcons["pan"],
-                                      self.parent.OnPan),
+                                      self.parent.OnPan,
+                                      wx.ITEM_CHECK),
                                      ("zoomin", BaseIcons["zoomIn"],
-                                      self.parent.OnZoomIn),
+                                      self.parent.OnZoomIn,
+                                      wx.ITEM_CHECK),
                                      ("zoomout", BaseIcons["zoomOut"],
-                                      self.parent.OnZoomOut),
+                                      self.parent.OnZoomOut,
+                                      wx.ITEM_CHECK),
                                      ("zoommenu", BaseIcons["zoomMenu"],
                                       self.parent.OnZoomMenuGCP),
                                      (None, ),

Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/toolbars.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/toolbars.py	2012-08-17 12:50:58 UTC (rev 52695)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/toolbars.py	2012-08-17 12:52:33 UTC (rev 52696)
@@ -145,8 +145,6 @@
     def OnTool(self, event):
         """!Tool selected
         """
-        if self.parent.GetName() == "GCPFrame":
-            return
         
         if hasattr(self.parent, 'toolbars'):
             if self.parent.GetToolbar('vdigit'):

Modified: grass/branches/develbranch_6/gui/wxpython/mapdisp/mapwindow.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/mapdisp/mapwindow.py	2012-08-17 12:50:58 UTC (rev 52695)
+++ grass/branches/develbranch_6/gui/wxpython/mapdisp/mapwindow.py	2012-08-17 12:52:33 UTC (rev 52696)
@@ -441,7 +441,7 @@
         
         self.Map.ChangeMapSize((width, height))
         ibuffer = wx.EmptyBitmap(max(1, width), max(1, height))
-        self.Map.Render(force = True, windres = True)
+        self.Map.Render(force = True, windres = False)
         img = self.GetImage()
         self.pdc.RemoveAll()
         self.Draw(self.pdc, img, drawid = 99)

Modified: grass/branches/develbranch_6/gui/wxpython/mapdisp/statusbar.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/mapdisp/statusbar.py	2012-08-17 12:50:58 UTC (rev 52695)
+++ grass/branches/develbranch_6/gui/wxpython/mapdisp/statusbar.py	2012-08-17 12:52:33 UTC (rev 52696)
@@ -1007,6 +1007,8 @@
                           wx.LIST_STATE_SELECTED)
         listCtrl.render = True
         
+        listCtrl.EnsureVisible(listCtrl.selected)
+
         srcWin = self.mapFrame.GetSrcWindow()
         tgtWin = self.mapFrame.GetTgtWindow()
         



More information about the grass-commit mailing list