[GRASS-SVN] r47786 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Aug 21 06:27:17 EDT 2011


Author: martinl
Date: 2011-08-21 03:27:17 -0700 (Sun, 21 Aug 2011)
New Revision: 47786

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py
Log:
wxGUI/layertree: set color table also for vector maps
		 (merge r47785 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py	2011-08-21 10:23:28 UTC (rev 47785)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py	2011-08-21 10:27:17 UTC (rev 47786)
@@ -315,6 +315,10 @@
                       id = self.popupID['export'])
             
             self.popupMenu.AppendSeparator()
+
+            self.popupMenu.Append(self.popupID['color'], _("Set color table"))
+            self.Bind (wx.EVT_MENU, self.OnVectorColorTable, id = self.popupID['color'])
+
             self.popupMenu.Append(self.popupID['attr'], text = _("Show attribute data"))
             self.Bind(wx.EVT_MENU, self.lmgr.OnShowAttributeTable, id = self.popupID['attr'])
 
@@ -385,7 +389,7 @@
             
             self.popupMenu.AppendSeparator()
             self.popupMenu.Append(self.popupID['color'], _("Set color table"))
-            self.Bind (wx.EVT_MENU, self.OnColorTable, id = self.popupID['color'])
+            self.Bind (wx.EVT_MENU, self.OnRasterColorTable, id = self.popupID['color'])
             self.popupMenu.Append(self.popupID['hist'], _("Histogram"))
             self.Bind (wx.EVT_MENU, self.OnHistogram, id = self.popupID['hist'])
             self.popupMenu.Append(self.popupID['univar'], _("Univariate raster statistics"))
@@ -499,11 +503,17 @@
             # show new display
             self.profileFrame.Show()
         
-    def OnColorTable(self, event):
+    def OnRasterColorTable(self, event):
         """!Set color table for raster map"""
         name = self.GetPyData(self.layer_selected)[0]['maplayer'].GetName()
         menuform.GUI(parent = self).ParseCommand(['r.colors',
                                                   'map=%s' % name])
+
+    def OnVectorColorTable(self, event):
+        """!Set color table for vector map"""
+        name = self.GetPyData(self.layer_selected)[0]['maplayer'].GetName()
+        menuform.GUI(parent = self, centreOnParent = False).ParseCommand(['v.colors',
+                                                                          'map=%s' % name])
         
     def OnHistogram(self, event):
         """



More information about the grass-commit mailing list