소스 검색

wxGUI: image size templates added (exporting image)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@42363 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 년 전
부모
커밋
53a539b924
2개의 변경된 파일29개의 추가작업 그리고 4개의 파일을 삭제
  1. 28 3
      gui/wxpython/gui_modules/gdialogs.py
  2. 1 1
      gui/wxpython/gui_modules/wxnviz.py

+ 28 - 3
gui/wxpython/gui_modules/gdialogs.py

@@ -1503,20 +1503,31 @@ class ImageSizeDialog(wx.Dialog):
                                 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 @@ class ImageSizeDialog(wx.Dialog):
                                       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 @@ class ImageSizeDialog(wx.Dialog):
         """!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)
+        

+ 1 - 1
gui/wxpython/gui_modules/wxnviz.py

@@ -51,7 +51,7 @@ class Nviz(object):
     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