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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Nov 4 17:40:46 EST 2008


Author: martinl
Date: 2008-11-04 17:40:45 -0500 (Tue, 04 Nov 2008)
New Revision: 34156

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py
Log:
wxGUI: "Set color table" added to layer contextual menu


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py	2008-11-04 08:36:12 UTC (rev 34155)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py	2008-11-04 22:40:45 UTC (rev 34156)
@@ -245,6 +245,7 @@
             self.popupID12 = wx.NewId()
             self.popupID13 = wx.NewId()
             self.popupID14 = wx.NewId()
+            self.popupID15 = wx.NewId()
 
         self.popupMenu = wx.Menu()
         # general item
@@ -335,6 +336,8 @@
             self.popupMenu.Append(self.popupID13, text=_("Set computational region from selected map (ignore NULLs)"))
             self.Bind(wx.EVT_MENU, self.OnSetCompRegFromRaster, id=self.popupID13)
             self.popupMenu.AppendSeparator()
+            self.popupMenu.Append(self.popupID15, _("Set color table"))
+            self.Bind (wx.EVT_MENU, self.OnColorTable, id=self.popupID15)
             self.popupMenu.Append(self.popupID4, _("Histogram"))
             self.Bind (wx.EVT_MENU, self.OnHistogram, id=self.popupID4)
             self.popupMenu.Append(self.popupID5, _("Profile"))
@@ -419,6 +422,13 @@
             # show new display
             self.profileFrame.Show()
         
+    def OnColorTable(self, event):
+        """Set color table for raster map"""
+        name = self.GetPyData(self.layer_selected)[0]['maplayer'].name
+        menuform.GUI().ParseCommand(['r.colors',
+                                     'map=%s' % name],
+                                    parentframe=self)
+        
     def OnHistogram(self, event):
         """
         Plot histogram for given raster map layer



More information about the grass-commit mailing list