[GRASS-SVN] r34157 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Nov 4 17:44:52 EST 2008


Author: martinl
Date: 2008-11-04 17:44:52 -0500 (Tue, 04 Nov 2008)
New Revision: 34157

Modified:
   grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
Log:
wxGUI: "Set color table" added to layer contextual menu
(merge from devbr6, r34156)


Modified: grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2008-11-04 22:40:45 UTC (rev 34156)
+++ grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2008-11-04 22:44:52 UTC (rev 34157)
@@ -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