[GRASS-SVN] r52699 - in grass/branches/releasebranch_6_4/gui/wxpython: gcp gui_core mapdisp
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Aug 17 06:15:56 PDT 2012
Author: mmetz
Date: 2012-08-17 06:15:55 -0700 (Fri, 17 Aug 2012)
New Revision: 52699
Modified:
grass/branches/releasebranch_6_4/gui/wxpython/gcp/manager.py
grass/branches/releasebranch_6_4/gui/wxpython/gcp/mapdisplay.py
grass/branches/releasebranch_6_4/gui/wxpython/gcp/toolbars.py
grass/branches/releasebranch_6_4/gui/wxpython/gui_core/toolbars.py
grass/branches/releasebranch_6_4/gui/wxpython/mapdisp/statusbar.py
Log:
wx GCP Manager: backport fixes
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gcp/manager.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gcp/manager.py 2012-08-17 13:14:13 UTC (rev 52698)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gcp/manager.py 2012-08-17 13:15:55 UTC (rev 52699)
@@ -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/releasebranch_6_4/gui/wxpython/gcp/mapdisplay.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gcp/mapdisplay.py 2012-08-17 13:14:13 UTC (rev 52698)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gcp/mapdisplay.py 2012-08-17 13:15:55 UTC (rev 52699)
@@ -304,6 +304,9 @@
def OnPointer(self, event):
"""!Pointer button clicked
"""
+ self.toolbars['gcpdisp'].OnTool(event)
+ self.toolbars['gcpdisp'].action['desc'] = ''
+
# change the cursor
self.SrcMapWindow.SetCursor(self.cursors["cross"])
self.SrcMapWindow.mouse['use'] = "pointer"
@@ -317,9 +320,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 +349,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 +377,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/releasebranch_6_4/gui/wxpython/gcp/toolbars.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gcp/toolbars.py 2012-08-17 13:14:13 UTC (rev 52698)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gcp/toolbars.py 2012-08-17 13:15:55 UTC (rev 52699)
@@ -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/releasebranch_6_4/gui/wxpython/gui_core/toolbars.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_core/toolbars.py 2012-08-17 13:14:13 UTC (rev 52698)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_core/toolbars.py 2012-08-17 13:15:55 UTC (rev 52699)
@@ -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/releasebranch_6_4/gui/wxpython/mapdisp/statusbar.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/mapdisp/statusbar.py 2012-08-17 13:14:13 UTC (rev 52698)
+++ grass/branches/releasebranch_6_4/gui/wxpython/mapdisp/statusbar.py 2012-08-17 13:15:55 UTC (rev 52699)
@@ -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