Browse Source

wxGUI: fix RasterColorTable - OnApply()
(merge https://trac.osgeo.org/grass/changeset/48596 from trunk)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@48597 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 13 years ago
parent
commit
c862d4cbfc
1 changed files with 16 additions and 9 deletions
  1. 16 9
      gui/wxpython/gui_modules/colorrules.py

+ 16 - 9
gui/wxpython/gui_modules/colorrules.py

@@ -519,22 +519,18 @@ class ColorTable(wx.Frame):
           
     def OnApply(self, event):
         """!Apply selected color table
-
+        
         @return True on success otherwise False
         """
         ret = self.CreateColorTable()
         if not ret:
             gcmd.GMessage(parent = self, message = _("No valid color rules given."))
-
-        if self.colorTable:
-            self.UseAttrColumn(False)
-        else:
-            self.UseAttrColumn(True)            
+        
         if ret:
             display = self.parent.GetLayerTree().GetMapDisplay()
             if display and display.IsAutoRendered():
                 display.GetWindow().UpdateMap(render = True)
-           
+        
         return ret
 
     def OnOK(self, event):
@@ -1616,6 +1612,18 @@ class VectorColorTable(ColorTable):
         self.DeleteTemporaryColumn()
         self.Map.Clean()
         self.Destroy()
+
+    def OnApply(self, event):
+        """!Apply selected color table
+        
+        @return True on success otherwise False
+        """
+        if self.colorTable:
+            self.UseAttrColumn(False)
+        else:
+            self.UseAttrColumn(True)
+        
+        return ColorTable.OnApply()
         
 class ThematicVectorTable(VectorColorTable):
     def __init__(self, parent, vectorType, **kwargs):
@@ -1637,7 +1645,6 @@ class ThematicVectorTable(VectorColorTable):
 
         @return True on success otherwise False
         """
-        
         ret = self.CreateColorTable()
         if not ret:
             gcmd.GMessage(parent = self, message = _("No valid color rules given."))
@@ -1824,4 +1831,4 @@ class BufferedWindow(wx.Window):
     def EraseMap(self):
         """!Erase preview"""
         self.Draw(self.pdc, pdctype = 'clear')
-    
+