소스 검색

wxGUI: update wxGUI docs

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44951 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 년 전
부모
커밋
df268855e0

+ 1 - 1
gui/wxpython/docs/Makefile

@@ -3,7 +3,7 @@ MODULE_TOPDIR = ../../..
 include $(MODULE_TOPDIR)/include/Make/Other.make
 
 FILES = wxGUI \
-	wxGUI.Vector_Digitizing_Tool \
+	wxGUI.Vector_Digitizer \
 	wxGUI.Attribute_Table_Manager \
 	wxGUI.Nviz \
 	wxGUI.GCP_Manager \

+ 14 - 0
gui/wxpython/docs/wxGUI.Attribute_Table_Manager.html

@@ -17,6 +17,20 @@
 <h2>SEE ALSO</h2>
 
 <em>
+  <a href="wxGUI.html">wxGUI</a>
+</em>
+
+<p>
+Other wxGUI components:<br>
+<em
+  <a href="wxGUI.Vector_Digitizer.html">Vector Digitizer</a><br>
+  <a href="wxGUI.Nviz.html">3D Viewer</a><br>
+  <a href="wxGUI.Modeler.html">Graphical Modeler</a><br>
+  <a href="wxGUI.GCP_Manager.html">Manage Ground Control Points</a><br>
+</em>
+
+<p>
+<em>
   <a href="db.columns.html">db.columns</a>,
   <a href="db.connect.html">db.connect</a>,
   <a href="db.describe.html">db.describe</a>,

+ 16 - 3
gui/wxpython/docs/wxGUI.GCP_Manager.html

@@ -292,15 +292,28 @@ error is displayed.
 <h2>SEE ALSO</h2>
 
 <em>
-  <a href="wxGUI.html">wxGUI</a><br>
-  <a href="i.rectify.html">i.rectify</a><br>
+  <a href="wxGUI.html">wxGUI</a>
+</em>
+
+<p>
+Other wxGUI components:<br>
+<em
+  <a href="wxGUI.Vector_Digitizer.html">Vector Digitizer</a><br>
+  <a href="wxGUI.Attribute_Table_Manager.html">Attribute Table Manager</a><br>
+  <a href="wxGUI.Nviz.html">3D Viewer</a><br>
+  <a href="wxGUI.Modeler.html">Graphical Modeler</a><br>  
+</em>
+
+<p>
+<em>
+  <a href="i.rectify.html">i.rectify</a>,
   <a href="g.transform.html">g.transform</a>
 </em>
 
 <h2>AUTHORS</h2>
 
 Markus Metz<br><br>
-<em>Based on the Georectifier by</em><br>
+<em>Based on the Georectifier (GRASS 6.4.0) by</em><br>
 Michael Barton<br>
 Martin Landa<br>
 

+ 10 - 2
gui/wxpython/docs/wxGUI.Modeler.html

@@ -30,8 +30,16 @@ The modeler currently allows to:
 <h2>SEE ALSO</h2>
 
 <em>
-  <a href="wxGUI.html">wxGUI</a>,
-  <a href="wxGUI.Icons.html">Icon themes</a>
+  <a href="wxGUI.html">wxGUI</a>
+</em>
+
+<p>
+Other wxGUI components:<br>
+<em
+  <a href="wxGUI.Vector_Digitizer.html">Vector Digitizer</a><br>
+  <a href="wxGUI.Attribute_Table_Manager.html">Attribute Table Manager</a><br>
+  <a href="wxGUI.Nviz.html">3D Viewer</a><br>
+  <a href="wxGUI.GCP_Manager.html">Manage Ground Control Points</a><br>
 </em>
 
 <p>

+ 14 - 0
gui/wxpython/docs/wxGUI.Nviz.html

@@ -294,6 +294,20 @@ distributed as &quot;Experimental Prototype&quot;.</b>
 
 <h2>SEE ALSO</h2>
 
+<em>
+  <a href="wxGUI.html">wxGUI</a>
+</em>
+
+<p>
+Other wxGUI components:<br>
+<em
+  <a href="wxGUI.Vector_Digitizer.html">Vector Digitizer</a><br>
+  <a href="wxGUI.Attribute_Table_Manager.html">Attribute Table Manager</a><br>
+  <a href="wxGUI.Modeler.html">Graphical Modeler</a><br>
+  <a href="wxGUI.GCP_Manager.html">Manage Ground Control Points</a><br>
+</em>
+
+<p>
 See also <a href="http://grass.osgeo.org/wiki/WxNVIZ">wiki</a> page.
 <br><br>
 

+ 15 - 1
gui/wxpython/docs/wxGUI.Vector_Digitizing_Tool.html

@@ -1,6 +1,6 @@
 <h2>DESCRIPTION</h2>
 
-<b>Vector digitizing tool</b> is
+<b>Vector digitizer</b> is
 a <em><a href="wxGUI.html">wxGUI</a></em> component intended for
 interactive editing vector maps
 (see <em><a href="v.edit.html">v.edit</a></em> for non-interactive
@@ -223,6 +223,20 @@ distributed as &quot;Experimental Prototype&quot;.</b>
 <h2>SEE ALSO</h2>
 
 <em>
+  <a href="wxGUI.html">wxGUI</a>
+</em>
+
+<p>
+Other wxGUI components:<br>
+<em>
+  <a href="wxGUI.Attribute_Table_Manager.html">Attribute Table Manager</a><br>
+  <a href="wxGUI.Nviz.html">3D Viewer</a><br>
+  <a href="wxGUI.Modeler.html">Graphical Modeler</a><br>
+  <a href="wxGUI.GCP_Manager.html">Manage Ground Control Points</a><br>
+</em>
+
+<p>
+<em>
 <a href="v.edit.html">v.edit</a>,
 <a href="v.category.html">v.category</a>
 </em>

+ 99 - 46
gui/wxpython/docs/wxGUI.html

@@ -107,58 +107,94 @@ d.vect, or d.grid, for example).
 <dl>
 
 <dt><img src="icons/grass2/monitor-create.png">&nbsp;
-<em>Open new Map Display Window</em></dt>
-<dd>Opens a new map display and creates empty layer tree tab in Layer Manager.</dd>
+<em>Start new display / create new workspace</em></dt>
+<dd>Opens a new map display and creates empty layer tree tab in Layer Manager or creates new workspace for the current layer tree.</dd>
 
-<dt><img src="icons/grass2/create.png">&nbsp;
-<em>Create new workspace file</em></dt>
-<dd>Removes all layers in the layer tree and creates a new, empty tree
-where new layers can be added.</dd>
+<dl>
+  <dt><img src="icons/grass2/monitor-create.png">&nbsp;
+    <em>Start new map display</em></dt>
+  <dd>Opens a new map display and creates empty layer tree tab in Layer Manager.</dd>
+  <dt><img src="icons/grass2/create.png">&nbsp;
+    <em>Create new workspace</em></dt>
+  <dd>Removes all layers from the layer tree and creates a new, empty tree
+    where new layers can be added.</dd>
+</dl>
 
 <dt><img src="icons/grass2/layer-open.png">&nbsp;
-<em>Load map layers (raster, vector) into workspace</em></dt>
-<dd>Loads selected raster or vector maps into current layer tree.</dd>
+  <em>Load / import map layers into workspace</em></dt>
+<dd>Loads or imports selected raster or vector maps into current layer tree.</dd>
+
+<dl>
+  <dt><img src="icons/grass2/layer-open.png">&nbsp;
+    <em>Load map layers into workspace</em></dt>
+  <dd>Loads selected raster or vector maps into current layer tree.</dd>
+
+  <dt><img src="icons/grass2/layer-import.png">&nbsp;
+    <em>Import raster data</em></dt>
+  <dd>Import selected raster data into GRASS and load them into current layer tree.</dd>
+
+  <dt><img src="icons/grass2/layer-import.png">&nbsp;
+    <em>Import vector data</em></dt>
+  <dd>Import selected vector data into GRASS and load them into current layer tree.</dd>
+
+  <dt><img src="icons/grass2/layer-import.png">&nbsp;
+    <em>Link external raster data</em></dt>
+  <dd>Link selected external raster data as GRASS raster maps and load them into current layer tree.</dd>
+
+  <dt><img src="icons/grass2/layer-import.png">&nbsp;
+    <em>Link external vector data</em></dt>
+  <dd>Link selected external vector data as GRASS vector maps and load them into current layer tree.</dd>
+</dl>
 
 <dt><img src="icons/grass2/open.png">&nbsp;
-<em>Open an existing workspace file</em></dt>
+  <em>Open existing workspace file</em></dt>
 <dd>Opens an previously saved workspace file, containing a set of display
 layers and their option settings.</dd>
 
 <dt><img src="icons/grass2/save.png">&nbsp;
-<em>Save workspace file</em></dt>
+  <em>Save current workspace to file</em></dt>
 <dd>Saves current set of layers and their options to a workspace
   file.</dd>
 
 <dt><img src="icons/grass2/layer-raster-add.png">&nbsp;
-<em>Add raster map layer</em></dt>
-<dd>Adds raster map to layer tree, see <em><a href="d.rast.html">d.rast</a></em>. 
+  <em>Add raster map layer</em></dt>
+<dd>Adds raster map to layer tree, see <em><a href="d.rast.html">d.rast</a></em>.
 </dd>
 
-<dt><img src="icons/grass2/layer-shaded-relief-add.png">&nbsp;
-<em>Add various raster-based map layers</em></dt>
+<dt><img src="icons/grass2/layer-raster-more.png">&nbsp;
+<em>Add various raster map layers (RGB, HIS, shaded relief...)</em></dt>
 <dd>Opens a dropdown menu that allows user to select to:<br> 
 
   <dl>
-    <dt><img src="icons/grass2/layer-shaded-relief-add.png">&nbsp;
-	<em>Add shaded relief raster map layer </em></dt>
-      <dd>Adds shaded relief raster map layer,
-	see <em><a href="d.shadedmap.html">d.shadedmap</a></em>
+    <dt><img src="icons/grass2/layer-raster3d-add.png">&nbsp;
+      <em>Add 3D raster map layer</em></dt>
+    <dd>Adds 3D raster map to layer tree.</dd>
+    </dd>
+    
     <dt><img src="icons/grass2/layer-rgb-add.png">&nbsp;
 	<em>Add RGB raster layer</em></dt>
       <dd>Combines and displays three raster maps defined as red, green, 
     and blue channels to create an RGB color map, 
     see <em><a href="d.rgb.html">d.rgb</a></em>.</dd>
+
     <dt><img src="icons/grass2/layer-his-add.png">&nbsp;
 	<em>Add HIS raster layer</em></dt>
       <dd>Combines and displays two or three raster maps defined as hue,
 	intensity, and (optionally) saturation channels to create a color map,
 	see <em><a href="d.his.html">d.his</a></em>.</dd>
-    <dt><img src="icons/grass2/layer-cell-cats-add.png">&nbsp;
+
+    <dt><img src="icons/grass2/layer-shaded-relief-add.png">&nbsp;
+	<em>Add shaded relief raster map layer </em></dt>
+      <dd>Adds shaded relief raster map layer,
+	see <em><a href="d.shadedmap.html">d.shadedmap</a></em>.</dd>
+
+    <dt><img src="icons/grass2/layer-aspect-arrow-add.png">&nbsp;
 	<em>Add raster arrows layer</em></dt>
       <dd>Adds map of raster cells with directional arrows drawn. Arrow
 	direction and length are determined by separate aspect/directional map
 	and (optional) slope/intensity map,
 	see <em><a href="d.rast.arrow.html">d.rast.arrow</a></em>.</dd>
+
     <dt><img src="icons/grass2/layer-cell-cats-add.png">&nbsp;
 	<em>Add raster numbers layer</em></dt>
       <dd>Adds map of raster cells with numbers representing the cell values, 
@@ -170,13 +206,13 @@ layers and their option settings.</dd>
 <dd>Adds a vector map layer, see <em><a href="d.vect.html">d.vect</a></em>. 
 </dd>
 
-<dt><img src="icons/grass2/layer-vector-thematic-add.png">&nbsp;
-<em>Add various vector-based map layers </em></dt>
+<dt><img src="icons/grass2/layer-vector-more.png">&nbsp;
+<em>Add various vector map layers (thematic, chart...)</em></dt>
 <dd>Opens a dropdown menu that allows user to select to:<br>
 
   <dl>
     <dt><img src="icons/grass2/layer-vector-thematic-add.png">&nbsp;
-	<em>Add thematic map layer
+	<em>Add thematic area (choropleth) map layer
 	  (for all vector types)</em></dt>
       <dd>Adds layer for thematic display values from a numeric attribute
 	column associated with a vector map. Options include: thematic display
@@ -189,7 +225,7 @@ layers and their option settings.</dd>
 	see <em><a href="d.vect.thematic.html">d.vect.thematic</a></em>.</dd>
       
     <dt><img src="icons/grass2/layer-vector-chart-add.png">&nbsp;
-	<em>Add thematic charts layer (for vector points)</em></dt>
+	<em>Add thematic chart layer (for vector points)</em></dt>
       <dd>Adds layer in which pie or bar charts can be automatically created
 	at vector point locations. Charts display values from selected columns
 	in the associated attribute table. Options include: chart type, layer
@@ -198,28 +234,11 @@ layers and their option settings.</dd>
 	see <em><a href="d.vect.chart.html">d.vect.chart</a></em>.</dd>
   </dl>
 
-<dt><img src="icons/grass2/layer-command-add.png">&nbsp;
-<em>Add command layer</em></dt>
-<dd>Adds a layer in which a GRASS GIS command or command list can be entered.
-For a command list use the semi-colon (";") symbol as a separator.
-For example:
-
-<div class="code"><pre>
-d.rast soils;d.rast -o roads;d.vect streams col=blue
-</pre></div>
-
-Note that when an option of the command contains spaces, you need to
-"escape" them with the backslash ('\') character, for example:
-<div class="code"><pre>
-d.text text=Population\ density
-</pre></div>
-</dd>
-
 <dt><img src="icons/grass2/layer-group-add.png">&nbsp;
-<em>Add layer group</em></dt>
-<dd>Adds an empty layer group. Layers can then be added to the group.</dd>
+<em>Add group</em></dt>
+<dd>Adds an empty group. Layers can then be added to the group.</dd>
 
-<dt><img src="icons/grass2/layer-grid-add.png">&nbsp;
+<dt><img src="icons/grass2/layer-more.png">&nbsp;
    <em>Add grid or vector labels overlay</em></dt>
 <dd>Opens a dropdown menu that allows user to select to:<br>
 
@@ -245,15 +264,44 @@ d.text text=Population\ density
       <em>Add rhumbline layer</em>
       <dd>Add layer to display rhumblines (for latitude/longitude locations only),
         see <em><a href="d.rhumbline.html">d.rhumbline</a></em>.</dd>
+
+  <dt><img src="icons/grass2/layer-command-add.png">&nbsp;
+    <em>Add command layer</em></dt>
+  <dd>Adds a layer in which a GRASS GIS command or command list can be entered.
+    For a command list use the semi-colon (";") symbol as a separator.
+    For example:
+    
+<div class="code"><pre>
+d.rast soils;d.rast -o roads;d.vect streams col=blue
+</pre></div>
+
+Note that when an option of the command contains spaces, you need to
+"escape" them with the backslash ('\') character, for example:
+<div class="code"><pre>
+d.text text=Population\ density
+</pre></div>
+  </dd>
   </dl>
 
 <dt><img src="icons/grass2/layer-remove.png">&nbsp;
    <em>Delete selected layer</em></dt>
 <dd>Removes selected map layer or map layer group from layer tree.</dd>
 
+<dt><img src="icons/grass2/edit.png">&nbsp;
+  <em>Edit vector maps</em></dt>
+<dd>Opens <em><a href="wxGUI.Vector_Digitizer.html">vector digitizer</a></em> to allow editing selected vector map.</dd>
+
 <dt><img src="icons/grass2/table.png">&nbsp;
-  <em>Show <a href="wxGUI.Attribute_Table_Manager.html">Attribute Table Manager</a> for selected vector map</em></dt>
-<dd>Displays attribute data of selected vector map.</dd>
+  <em>Show attribute table</em></dt>
+<dd>Opens <em><a href="wxGUI.Attribute_Table_Manager.html">attribute table manager</a></em> for selected vector map.</dd>
+
+<dt><img src="icons/grass2/modeler-main.png">&nbsp;
+  <em>Start Graphical Modeler</em></dt>
+<dd>Opens <em><a href="wxGUI.Modeler.html">graphical modeler</a></em> to create models and run them.</dd>
+
+<dt><img src="icons/grass2/settings.png">&nbsp;
+  <em>Show GUI settings</em></dt>
+<dd>Opens dialog to change GUI preferences.</dd>
 
 </dl>
 
@@ -511,12 +559,17 @@ or EPS file.</dd>
 
 <h2>SEE ALSO</h2>
 
+wxGUI components:<br>
 <em>
-  <a href="wxGUI.Vector_Digitizing_Tool.html">Vector Digitizer</a><br>
+  <a href="wxGUI.Vector_Digitizer.html">Vector Digitizer</a><br>
   <a href="wxGUI.Attribute_Table_Manager.html">Attribute Table Manager</a><br>
   <a href="wxGUI.Nviz.html">3D Viewer</a><br>
   <a href="wxGUI.Modeler.html">Graphical Modeler</a><br>
   <a href="wxGUI.GCP_Manager.html">Manage Ground Control Points</a><br>
+</em>
+
+<p>
+<em>
   <a href="wxGUI.Icons.html">Icon themes</a>
 </em>
 

BIN
gui/wxpython/docs/wxGUI_layer_manager.jpg


BIN
gui/wxpython/docs/wxGUI_map_display.jpg


+ 4 - 4
gui/wxpython/gui_modules/toolbars.py

@@ -1773,12 +1773,12 @@ class LayerManagerToolbar(AbstractToolbar):
         # tool, label, bitmap, kind, shortHelp, longHelp, handler
         return (
             (self.newdisplay, 'newdisplay', Icons["newdisplay"].GetBitmap(),
-             wx.ITEM_NORMAL, Icons["newdisplay"].GetLabel(), Icons["newdisplay"].GetDesc(),
-             self.parent.OnNewDisplay),
+             wx.ITEM_NORMAL, _("Start new display / create new workspace"), '',
+             self.parent.OnNewMenu),
             ('', '', '', '', '', '', ''),
             (self.workspaceLoad, 'workspaceLoad', Icons["workspaceLoad"].GetBitmap(),
-             wx.ITEM_NORMAL, Icons["workspaceLoad"].GetLabel(), Icons["workspaceLoad"].GetDesc(),
-             self.parent.OnWorkspace),
+             wx.ITEM_NORMAL, _("Load (and import) map layers into workspace"), '',
+             self.parent.OnLoadMenu),
             (self.workspaceOpen, 'workspaceOpen', Icons["workspaceOpen"].GetBitmap(),
              wx.ITEM_NORMAL, Icons["workspaceOpen"].GetLabel(), Icons["workspaceOpen"].GetDesc(),
              self.parent.OnWorkspaceOpen),

+ 2 - 2
gui/wxpython/icons/icon.py

@@ -177,9 +177,9 @@ Icons = {
                              label=_("Print display")),
     # layer manager
     "newdisplay" : MetaIcon (img=Icons["newdisplay"],
-                             label=_("Start new display")),
+                             label=_("Start new map display")),
     "workspaceNew" : MetaIcon (img=Icons["fileNew"],
-                               label=_("Create new workspace file (Ctrl+N)")),
+                               label=_("Create new workspace (Ctrl+N)")),
     "workspaceLoad" : MetaIcon (img=Icons["fileLoad"],
                                 label=_("Load map layers into workspace (Ctrl+L)")),
     "workspaceOpen" : MetaIcon (img=Icons["fileOpen"],

+ 39 - 76
gui/wxpython/wxgui.py

@@ -554,19 +554,13 @@ class GMFrame(wx.Frame):
         win.CentreOnScreen()
         win.Show(True)  
         
-    def OnWorkspace(self, event):
-        """!Workspace menu (new, load, import)"""
+    def _popupMenu(self, data):
+        """!Create popup menu
+        """
         point = wx.GetMousePosition()
         menu = wx.Menu()
-
-        for key, handler in (('workspaceNew',  self.OnWorkspaceNew),
-                             ('workspaceLoad', self.OnWorkspaceLoad),
-                             (None, None),
-                             ('rastImport',    self.OnImportGdalLayers),
-                             ('rastLink',      self.OnLinkGdalLayers),
-                             (None, None),
-                             ('vectImport',    self.OnImportOgrLayers),
-                             ('vectLink',      self.OnLinkOgrLayers)):
+        
+        for key, handler in data:
             if key is None:
                 menu.AppendSeparator()
                 continue
@@ -579,6 +573,23 @@ class GMFrame(wx.Frame):
         self.PopupMenu(menu)
         menu.Destroy()
 
+    def OnNewMenu(self, event):
+        """!New display/workspace menu
+        """
+        self._popupMenu((('newdisplay', self.OnNewDisplay),
+                         ('workspaceNew',  self.OnWorkspaceNew)))
+
+    def OnLoadMenu(self, event):
+        """!Load maps menu (new, load, import, link)
+        """
+        self._popupMenu((('workspaceLoad', self.OnWorkspaceLoad),
+                         (None, None),
+                         ('rastImport',    self.OnImportGdalLayers),
+                         ('rastLink',      self.OnLinkGdalLayers),
+                         (None, None),
+                         ('vectImport',    self.OnImportOgrLayers),
+                         ('vectLink',      self.OnLinkOgrLayers)))
+        
     def OnWorkspaceNew(self, event = None):
         """!Create new workspace file
 
@@ -1181,31 +1192,15 @@ class GMFrame(wx.Frame):
         if not self.curr_page:
             self.NewDisplay(show = True)
         
-        point = wx.GetMousePosition()
-        rastmenu = wx.Menu()
-        
-        for key, handler in (('addrast3d', self.OnAddRaster3D),
-                             (None, None),
-                             ('addrgb',    self.OnAddRasterRGB),
-                             ('addhis',    self.OnAddRasterHIS),
-                             (None, None),
-                             ('addshaded', self.OnAddRasterShaded),
-                             (None, None),
-                             ('addrarrow', self.OnAddRasterArrow),
-                             ('addrnum',   self.OnAddRasterNum)):
-            if key is None:
-                rastmenu.AppendSeparator()
-                continue
-            
-            item = wx.MenuItem(rastmenu, wx.ID_ANY, Icons[key].GetLabel())
-            item.SetBitmap(Icons[key].GetBitmap(self.iconsize))
-            rastmenu.AppendItem(item)
-            self.Bind(wx.EVT_MENU, handler, item)
-            
-        # Popup the menu. If an item is selected then its handler
-        # will be called before PopupMenu returns.
-        self.PopupMenu(rastmenu)
-        rastmenu.Destroy()
+        self._popupMenu((('addrast3d', self.OnAddRaster3D),
+                         (None, None),
+                         ('addrgb',    self.OnAddRasterRGB),
+                         ('addhis',    self.OnAddRasterHIS),
+                         (None, None),
+                         ('addshaded', self.OnAddRasterShaded),
+                         (None, None),
+                         ('addrarrow', self.OnAddRasterArrow),
+                         ('addrnum',   self.OnAddRasterNum)))
         
         # show map display
         self.curr_page.maptree.mapdisplay.Show()
@@ -1225,25 +1220,9 @@ class GMFrame(wx.Frame):
         if not self.curr_page:
             self.NewDisplay(show = True)
 
-        point = wx.GetMousePosition()
-        vectmenu = wx.Menu()
+        self._popupMenu((('addthematic', self.OnAddVectorTheme),
+                         ('addchart',    self.OnAddVectorChart)))
         
-        for key, handler in (('addthematic', self.OnAddVectorTheme),
-                             ('addchart',    self.OnAddVectorChart)):
-            if key is None:
-                rastmenu.AppendSeparator()
-                continue
-            
-            item = wx.MenuItem(vectmenu, wx.ID_ANY, Icons[key].GetLabel())
-            item.SetBitmap(Icons[key].GetBitmap(self.iconsize))
-            vectmenu.AppendItem(item)
-            self.Bind(wx.EVT_MENU, handler, item)
-        
-        # Popup the menu.  If an item is selected then its handler
-        # will be called before PopupMenu returns.
-        self.PopupMenu(vectmenu)
-        vectmenu.Destroy()
-
         # show map display
         self.curr_page.maptree.mapdisplay.Show()
 
@@ -1263,29 +1242,13 @@ class GMFrame(wx.Frame):
         if not self.curr_page:
             self.NewDisplay(show = True)
 
-        point = wx.GetMousePosition()
-        ovlmenu = wx.Menu()
-
-        for key, handler in (('addgrid',     self.OnAddGrid),
-                             ('addlabels',   self.OnAddLabels),
-                             ('addgeodesic', self.OnAddGeodesic),
-                             ('addrhumb',    self.OnAddRhumb),
-                             (None, None),
-                             ('addcmd',      self.OnAddCommand)):
-            if key is None:
-                ovlmenu.AppendSeparator()
-                continue
-            
-            item = wx.MenuItem(ovlmenu, wx.ID_ANY, Icons[key].GetLabel())
-            item.SetBitmap(Icons[key].GetBitmap(self.iconsize))
-            ovlmenu.AppendItem(item)
-            self.Bind(wx.EVT_MENU, handler, item)
+        self._popupMenu((('addgrid',     self.OnAddGrid),
+                         ('addlabels',   self.OnAddLabels),
+                         ('addgeodesic', self.OnAddGeodesic),
+                         ('addrhumb',    self.OnAddRhumb),
+                         (None, None),
+                         ('addcmd',      self.OnAddCommand)))
         
-        # Popup the menu.  If an item is selected then its handler
-        # will be called before PopupMenu returns.
-        self.PopupMenu(ovlmenu)
-        ovlmenu.Destroy()
-
         # show map display
         self.curr_page.maptree.mapdisplay.Show()