|
@@ -239,7 +239,10 @@ class BufferedWindow(wx.Window):
|
|
|
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 @@ class HistFrame(wx.Frame):
|
|
|
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 @@ class HistFrame(wx.Frame):
|
|
|
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 @@ class HistFrame(wx.Frame):
|
|
|
"""
|
|
|
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
|