[GRASS-SVN] r42364 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri May 28 12:04:26 EDT 2010
Author: martinl
Date: 2010-05-28 12:04:24 -0400 (Fri, 28 May 2010)
New Revision: 42364
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/wxnviz.py
Log:
wxGUI: image size templates added (exporting image)
(merge r42363 from trunk)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py 2010-05-28 15:50:42 UTC (rev 42363)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py 2010-05-28 16:04:24 UTC (rev 42364)
@@ -1502,20 +1502,31 @@
label = ' % s' % _("Image size"))
size = self.parent.GetWindow().GetClientSize()
- self.width = wx.SpinCtrl(parent = self, id = wx.ID_ANY,
+ self.width = wx.SpinCtrl(parent = self.panel, id = wx.ID_ANY,
style = wx.SP_ARROW_KEYS)
self.width.SetRange(20, 1e6)
self.width.SetValue(size.width)
wx.CallAfter(self.width.SetFocus)
- self.height = wx.SpinCtrl(parent = self, id = wx.ID_ANY,
+ self.height = wx.SpinCtrl(parent = self.panel, id = wx.ID_ANY,
style = wx.SP_ARROW_KEYS)
self.height.SetRange(20, 1e6)
self.height.SetValue(size.height)
+ self.template = wx.Choice(parent = self.panel, id = wx.ID_ANY,
+ size = (125, -1),
+ choices = [ "",
+ "640x480",
+ "800x600",
+ "1024x768",
+ "1280x960",
+ "1600x1200",
+ "1920x1440" ])
self.btnOK = wx.Button(parent = self.panel, id = wx.ID_OK)
self.btnOK.SetDefault()
self.btnCancel = wx.Button(parent = self.panel, id = wx.ID_CANCEL)
+ self.template.Bind(wx.EVT_CHOICE, self.OnTemplate)
+
self._layout()
self.SetSize(self.GetBestSize())
@@ -1534,7 +1545,11 @@
label = _("Height:")),
flag = wx.ALIGN_CENTER_VERTICAL)
fbox.Add(item = self.height)
-
+ fbox.Add(item = wx.StaticText(parent = self.panel, id = wx.ID_ANY,
+ label = _("Template:")),
+ flag = wx.ALIGN_CENTER_VERTICAL)
+ fbox.Add(item = self.template)
+
box.Add(item = fbox, proportion = 1,
flag = wx.EXPAND | wx.ALL, border = 5)
sizer.Add(item = box, proportion = 1,
@@ -1557,3 +1572,13 @@
"""!Get width/height values"""
return self.width.GetValue(), self.height.GetValue()
+ def OnTemplate(self, event):
+ """!Template selected"""
+ sel = event.GetString()
+ if not sel:
+ width, height = self.parent.GetWindow().GetClientSize()
+ else:
+ width, height = map(int, sel.split('x'))
+ self.width.SetValue(width)
+ self.height.SetValue(height)
+
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/wxnviz.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/wxnviz.py 2010-05-28 15:50:42 UTC (rev 42363)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/wxnviz.py 2010-05-28 16:04:24 UTC (rev 42364)
@@ -51,7 +51,7 @@
def __del__(self):
"""!Destroy Nviz class instance"""
# G_unset_error_routine()
- G_unset_percent_routine()
+ # G_unset_percent_routine()
del self.data
del self.data_obj
self.log = None
More information about the grass-commit
mailing list