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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri May 28 11:50:50 EDT 2010


Author: martinl
Date: 2010-05-28 11:50:42 -0400 (Fri, 28 May 2010)
New Revision: 42363

Modified:
   grass/trunk/gui/wxpython/gui_modules/gdialogs.py
   grass/trunk/gui/wxpython/gui_modules/wxnviz.py
Log:
wxGUI: image size templates added (exporting image)


Modified: grass/trunk/gui/wxpython/gui_modules/gdialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gdialogs.py	2010-05-28 15:33:28 UTC (rev 42362)
+++ grass/trunk/gui/wxpython/gui_modules/gdialogs.py	2010-05-28 15:50:42 UTC (rev 42363)
@@ -1503,20 +1503,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())
         
@@ -1535,7 +1546,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,
@@ -1558,3 +1573,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/trunk/gui/wxpython/gui_modules/wxnviz.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxnviz.py	2010-05-28 15:33:28 UTC (rev 42362)
+++ grass/trunk/gui/wxpython/gui_modules/wxnviz.py	2010-05-28 15:50:42 UTC (rev 42363)
@@ -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