Browse Source

wxGUI: separed vector-related tools to the new toolbar

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@46922 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 years ago
parent
commit
ee6ffc2294
2 changed files with 34 additions and 13 deletions
  1. 26 9
      gui/wxpython/gui_modules/toolbars.py
  2. 8 4
      gui/wxpython/wxgui.py

+ 26 - 9
gui/wxpython/gui_modules/toolbars.py

@@ -17,6 +17,7 @@ Classes:
  - LMDataToolbar
  - LMToolsToolbar
  - LMMiscToolbar
+ - LMVectorToolbar
  - PsMapToolbar
 
 (C) 2007-2011 by the GRASS Development Team
@@ -1519,14 +1520,6 @@ class LMDataToolbar(AbstractToolbar):
                                       self.parent.OnAddOverlay),
                                      ('delcmd',  icons["delCmd"],
                                       self.parent.OnDeleteLayer),
-                                     (None, ),
-                                     ('importMap', icons["import"],
-                                      self.parent.OnImportMenu),
-                                     (None, ),
-                                     ('vdigit', icons["vdigit"],
-                                      self.parent.OnVDigit),
-                                     ('attribute', icons["attrTable"],
-                                      self.parent.OnShowAttributeTable),
                                      ))
 
 class LMToolsToolbar(AbstractToolbar):
@@ -1544,7 +1537,10 @@ class LMToolsToolbar(AbstractToolbar):
         """!Toolbar data
         """
         icons = Icons['layerManager']
-        return self._getToolbarData((('mapCalc', icons["mapcalc"],
+        return self._getToolbarData((('importMap', icons["import"],
+                                      self.parent.OnImportMenu),
+                                     (None, ),
+                                     ('mapCalc', icons["mapcalc"],
                                       self.parent.OnMapCalculator),
                                      ('georect', Icons["georectify"]["georectify"],
                                       self.parent.OnGCPManager),
@@ -1574,6 +1570,27 @@ class LMMiscToolbar(AbstractToolbar):
                                      ('help', Icons["misc"]["help"],
                                       self.parent.OnHelp),
                                      ))
+
+class LMVectorToolbar(AbstractToolbar):
+    """!Layer Manager `vector` toolbar
+    """
+    def __init__(self, parent):
+        AbstractToolbar.__init__(self, parent)
+        
+        self.InitToolbar(self._toolbarData())
+        
+        # realize the toolbar
+        self.Realize()
+
+    def _toolbarData(self):
+        """!Toolbar data
+        """
+        icons = Icons['layerManager']
+        return self._getToolbarData((('vdigit', icons["vdigit"],
+                                      self.parent.OnVDigit),
+                                     ('attribute', icons["attrTable"],
+                                      self.parent.OnShowAttributeTable),
+                                     ))
     
 class PsMapToolbar(AbstractToolbar):
     def __init__(self, parent):

+ 8 - 4
gui/wxpython/wxgui.py

@@ -84,7 +84,7 @@ from gui_modules import nviz_tools
 from gui_modules import psmap
 from gui_modules.debug    import Debug
 from gui_modules.ghelp    import MenuTreeWindow, AboutWindow, InstallExtensionWindow
-from gui_modules.toolbars import LMWorkspaceToolbar, LMDataToolbar, LMToolsToolbar, LMMiscToolbar
+from gui_modules.toolbars import LMWorkspaceToolbar, LMDataToolbar, LMToolsToolbar, LMMiscToolbar, LMVectorToolbar
 from gui_modules.gpyshell import PyShellWindow
 from icons.icon           import Icons
 
@@ -133,7 +133,8 @@ class GMFrame(wx.Frame):
         self.toolbars  = { 'workspace' : LMWorkspaceToolbar(parent = self),
                            'data'      : LMDataToolbar(parent = self),
                            'tools'     : LMToolsToolbar(parent = self),
-                           'misc'      : LMMiscToolbar(parent = self) }
+                           'misc'      : LMMiscToolbar(parent = self),
+                           'vector'    : LMVectorToolbar(parent = self) }
         self._toolbarsData = { 'workspace' : ("toolbarWorkspace",     # name
                                               _("Workspace Toolbar"), # caption
                                               1),                     # row
@@ -146,13 +147,16 @@ class GMFrame(wx.Frame):
                                'tools'     : ("toolbarTools",
                                               _("Tools Toolbar"),
                                               2),
+                               'vector'    : ("toolbarVector",
+                                              _("Vector Toolbar"),
+                                              2),
                                }
         if sys.platform == 'win32':
             self._toolbarsList = ('workspace', 'data',
-                                  'tools', 'misc')
+                                  'vector', 'tools', 'misc')
         else:
             self._toolbarsList = ('data', 'workspace',
-                                  'misc', 'tools')
+                                  'misc', 'tools', 'vector')
         for toolbar in self._toolbarsList:
             name, caption, row = self._toolbarsData[toolbar]
             self._auimgr.AddPane(self.toolbars[toolbar],