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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Oct 8 01:51:30 EDT 2008


Author: martinl
Date: 2008-10-08 01:51:30 -0400 (Wed, 08 Oct 2008)
New Revision: 33747

Modified:
   grass/trunk/gui/wxpython/gui_modules/histogram.py
Log:
histogramming: re-render tool added
(merge from devbr6, r33746)


Modified: grass/trunk/gui/wxpython/gui_modules/histogram.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/histogram.py	2008-10-08 05:49:52 UTC (rev 33746)
+++ grass/trunk/gui/wxpython/gui_modules/histogram.py	2008-10-08 05:51:30 UTC (rev 33747)
@@ -239,7 +239,10 @@
                 oldencoding = os.environ["GRASS_ENCODING"]
             if self.parent.encoding != None and self.parent.encoding != "ISO-8859-1":
                 os.environ[GRASS_ENCODING] = self.parent.encoding
-
+            
+            # using active comp region
+            self.Map.GetRegion(update=True)
+            
             self.Map.width, self.Map.height = self.GetClientSize()
             self.mapfile = self.Map.Render(force=self.render)
             self.img = self.GetImage()
@@ -359,13 +362,35 @@
     def toolbarData(self):
 
         return   (
-                 ('histogram', Icons["histogram"].GetBitmap(), Icons["histogram"].GetLabel(), self.OnOptions),
-                 ('erase', Icons["erase"].GetBitmap(), Icons["erase"].GetLabel(), self.OnErase),
-                 ('font', Icons["font"].GetBitmap(), Icons["font"].GetLabel(), self.SetHistFont),
+                 ('histogram',
+                  Icons["histogram"].GetBitmap(),
+                  Icons["histogram"].GetLabel(),
+                  self.OnOptions),
+                 ('rendermap',
+                  Icons["rendermap"].GetBitmap(),
+                  Icons["rendermap"].GetLabel(),
+                  self.OnRender),
+                 ('erase',
+                  Icons["erase"].GetBitmap(),
+                  Icons["erase"].GetLabel(),
+                  self.OnErase),
+                 ('font',
+                  Icons["font"].GetBitmap(),
+                  Icons["font"].GetLabel(),
+                  self.SetHistFont),
                  ('', '', '', ''),
-                 ('save',  Icons["savefile"].GetBitmap(),  Icons["savefile"].GetLabel(),  self.SaveToFile),
-                 ('print',  Icons["printmap"].GetBitmap(),  Icons["printmap"].GetLabel(),  self.PrintMenu),
-                 ('quit',  wx.ArtProvider.GetBitmap(wx.ART_QUIT, wx.ART_TOOLBAR, (16,16)),  Icons["quit"].GetLabel(), self.OnQuit),                  )
+                 ('save', 
+                  Icons["savefile"].GetBitmap(),
+                  Icons["savefile"].GetLabel(),
+                  self.SaveToFile),
+                 ('print',
+                  Icons["printmap"].GetBitmap(),
+                  Icons["printmap"].GetLabel(),
+                  self.PrintMenu),
+                 ('quit', 
+                  Icons["quit"].GetBitmap(),
+                  Icons["quit"].GetLabel(),
+                  self.OnQuit))
 
     def InitDisplay(self):
         """
@@ -384,7 +409,7 @@
         menuform.GUI().ParseCommand(cmd,
                                     completed=(self.GetOptData, None, self.params),
                                     parentframe=self)
-
+        
     def GetOptData(self, dcmd, layer, params, propwin):
         """
         Callback method for histogram command generated by
@@ -439,6 +464,12 @@
         """
         self.HistWindow.Draw(self.HistWindow.pdc, pdctype='clear')
 
+    def OnRender(self, event):
+        """
+        Re-render histogram
+        """
+        self.HistWindow.UpdateHist()
+
     def SaveToFile(self, event):
         """
         Save to file



More information about the grass-commit mailing list