[GRASS-SVN] r46923 - in grass/branches/develbranch_6/gui/wxpython: . gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jul 1 13:47:16 EDT 2011


Author: martinl
Date: 2011-07-01 10:47:16 -0700 (Fri, 01 Jul 2011)
New Revision: 46923

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py
   grass/branches/develbranch_6/gui/wxpython/wxgui.py
Log:
wxGUI: separed vector-related tools to the new toolbar
       (merge r46922 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py	2011-07-01 17:43:46 UTC (rev 46922)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py	2011-07-01 17:47:16 UTC (rev 46923)
@@ -17,6 +17,7 @@
  - LMDataToolbar
  - LMToolsToolbar
  - LMMiscToolbar
+ - LMVectorToolbar
  - PsMapToolbar
 
 (C) 2007-2011 by the GRASS Development Team
@@ -1518,14 +1519,6 @@
                                       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):
@@ -1543,7 +1536,10 @@
         """!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),
@@ -1573,6 +1569,27 @@
                                      ('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):

Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py	2011-07-01 17:43:46 UTC (rev 46922)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py	2011-07-01 17:47:16 UTC (rev 46923)
@@ -83,7 +83,7 @@
 from gui_modules import nviz_tools
 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
 
@@ -131,7 +131,8 @@
         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
@@ -145,13 +146,16 @@
                                '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],



More information about the grass-commit mailing list