[GRASS-SVN] r58424 - in grass/trunk/gui/wxpython: gui_core iclass vdigit
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Dec 9 03:53:17 PST 2013
Author: martinl
Date: 2013-12-09 03:53:17 -0800 (Mon, 09 Dec 2013)
New Revision: 58424
Modified:
grass/trunk/gui/wxpython/gui_core/toolbars.py
grass/trunk/gui/wxpython/iclass/frame.py
grass/trunk/gui/wxpython/vdigit/toolbars.py
Log:
wxGUI/vdigit: toolbar cosmetics
Modified: grass/trunk/gui/wxpython/gui_core/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/toolbars.py 2013-12-09 10:48:12 UTC (rev 58423)
+++ grass/trunk/gui/wxpython/gui_core/toolbars.py 2013-12-09 11:53:17 UTC (rev 58424)
@@ -250,7 +250,7 @@
self.PopupMenu(menu)
menu.Destroy()
- def CreateSelectionButton(self):
+ def CreateSelectionButton(self, tooltip = _("Select graphics tool")):
"""!Add button to toolbar for selection of graphics drawing mode.
Button must be custom (not toolbar tool) to set smaller width.
@@ -262,7 +262,7 @@
bitmap = wx.ArtProvider.GetBitmap(id = wx.ART_MISSING_IMAGE, client = wx.ART_TOOLBAR)
button = wx.BitmapButton(parent = self, id = wx.ID_ANY, size = ((-1, self.GetSize()[1])),
bitmap = bitmap, style = wx.NO_BORDER)
- button.SetToolTipString(_("Select graphics tool"))
+ button.SetToolTipString(tooltip)
return button
Modified: grass/trunk/gui/wxpython/iclass/frame.py
===================================================================
--- grass/trunk/gui/wxpython/iclass/frame.py 2013-12-09 10:48:12 UTC (rev 58423)
+++ grass/trunk/gui/wxpython/iclass/frame.py 2013-12-09 11:53:17 UTC (rev 58424)
@@ -323,7 +323,7 @@
digitClass=IClassVDigit, giface=self._giface,
tools = ['addArea', 'moveVertex', 'addVertex',
'removeVertex', 'editLine', 'moveLine',
- 'deleteLine', 'deleteArea',
+ 'deleteArea',
'undo', 'redo'])
self._mgr.AddPane(self.toolbars[name],
wx.aui.AuiPaneInfo().
Modified: grass/trunk/gui/wxpython/vdigit/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/toolbars.py 2013-12-09 10:48:12 UTC (rev 58423)
+++ grass/trunk/gui/wxpython/vdigit/toolbars.py 2013-12-09 11:53:17 UTC (rev 58424)
@@ -81,9 +81,14 @@
# custom button for digitization of area/boundary/centroid
# TODO: could this be somehow generalized?
- self.areaButton = self.CreateSelectionButton()
- self.areaButtonId = self.InsertControl(5, self.areaButton)
- self.areaButton.Bind(wx.EVT_BUTTON, self.OnAddAreaMenu)
+ nAreaTools = 0
+ if self.tools and 'addBoundary' in self.tools: nAreaTools += 1
+ if self.tools and 'addCentroid' in self.tools: nAreaTools += 1
+ if self.tools and 'addArea' in self.tools: nAreaTools += 1
+ if nAreaTools != 1:
+ self.areaButton = self.CreateSelectionButton(_("Select area/boundary/centroid tool"))
+ self.areaButtonId = self.InsertControl(5, self.areaButton)
+ self.areaButton.Bind(wx.EVT_BUTTON, self.OnAddAreaMenu)
# realize toolbar
self.Realize()
@@ -119,16 +124,16 @@
label = _('Digitize new centroid'),
desc = _('Left: new point')),
'addArea' : MetaIcon(img = 'polygon-create',
- label = _('Digitize new area'),
+ label = _('Digitize new area (boundary without category)'),
desc = _('Left: new point')),
'addVertex' : MetaIcon(img = 'vertex-create',
- label = _('Add new vertex'),
+ label = _('Add new vertex to line or boundary'),
desc = _('Left: Select; Ctrl+Left: Unselect; Right: Confirm')),
'deleteLine' : MetaIcon(img = 'line-delete',
- label = _('Delete feature(s)'),
+ label = _('Delete selected point(s), line(s), boundary(ies) or centroid(s)'),
desc = _('Left: Select; Ctrl+Left: Unselect; Right: Confirm')),
'deleteArea' : MetaIcon(img = 'polygon-delete',
- label = _('Delete area(s)'),
+ label = _('Delete selected area(s)'),
desc = _('Left: Select; Ctrl+Left: Unselect; Right: Confirm')),
'displayAttr' : MetaIcon(img = 'attributes-display',
label = _('Display/update attributes'),
@@ -137,16 +142,16 @@
label = _('Display/update categories'),
desc = _('Left: Select')),
'editLine' : MetaIcon(img = 'line-edit',
- label = _('Edit line/boundary'),
+ label = _('Edit selected line/boundary'),
desc = _('Left: new point; Ctrl+Left: undo last point; Right: close line')),
'moveLine' : MetaIcon(img = 'line-move',
- label = _('Move feature(s)'),
+ label = _('Move selected point(s), line(s), boundary(ies) or centroid(s)'),
desc = _('Left: Select; Ctrl+Left: Unselect; Right: Confirm')),
'moveVertex' : MetaIcon(img = 'vertex-move',
- label = _('Move vertex'),
+ label = _('Move selected vertex'),
desc = _('Left: Select; Ctrl+Left: Unselect; Right: Confirm')),
'removeVertex' : MetaIcon(img = 'vertex-delete',
- label = _('Remove vertex'),
+ label = _('Remove selected vertex'),
desc = _('Left: Select; Ctrl+Left: Unselect; Right: Confirm')),
'settings' : BaseIcons['settings'].SetLabel(_('Digitization settings')),
'quit' : BaseIcons['quit'].SetLabel(label = _('Quit digitizer'),
@@ -179,6 +184,14 @@
data.append(("addArea", self.icons["addArea"],
self.OnAddAreaTool,
wx.ITEM_CHECK))
+ if not self.tools or 'deleteLine' in self.tools:
+ data.append(("deleteLine", self.icons["deleteLine"],
+ self.OnDeleteLine,
+ wx.ITEM_CHECK))
+ if not self.tools or 'deleteArea' in self.tools:
+ data.append(("deleteArea", self.icons["deleteArea"],
+ self.OnDeleteArea,
+ wx.ITEM_CHECK))
if not self.tools or 'moveVertex' in self.tools:
data.append(("moveVertex", self.icons["moveVertex"],
self.OnMoveVertex,
@@ -199,14 +212,6 @@
data.append(("moveLine", self.icons["moveLine"],
self.OnMoveLine,
wx.ITEM_CHECK))
- if not self.tools or 'deleteLine' in self.tools:
- data.append(("deleteLine", self.icons["deleteLine"],
- self.OnDeleteLine,
- wx.ITEM_CHECK))
- if not self.tools or 'deleteArea' in self.tools:
- data.append(("deleteArea", self.icons["deleteArea"],
- self.OnDeleteArea,
- wx.ITEM_CHECK))
if not self.tools or 'displayCats' in self.tools:
data.append(("displayCats", self.icons["displayCats"],
self.OnDisplayCats,
More information about the grass-commit
mailing list