[GRASS-SVN] r54875 - grass/trunk/doc/gui/wxpython/example

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Feb 3 10:01:20 PST 2013


Author: lucadelu
Date: 2013-02-03 10:01:20 -0800 (Sun, 03 Feb 2013)
New Revision: 54875

Modified:
   grass/trunk/doc/gui/wxpython/example/dialogs.py
Log:
update wxpython example

Modified: grass/trunk/doc/gui/wxpython/example/dialogs.py
===================================================================
--- grass/trunk/doc/gui/wxpython/example/dialogs.py	2013-02-03 16:06:21 UTC (rev 54874)
+++ grass/trunk/doc/gui/wxpython/example/dialogs.py	2013-02-03 18:01:20 UTC (rev 54875)
@@ -17,10 +17,10 @@
 import wx
 
 from core               import globalvar
-from gui_core.dialogs   import ElementDialog, GroupDialog
+from gui_core.dialogs   import SimpleDialog, GroupDialog
 from gui_core           import gselect
 
-class ExampleMapDialog(ElementDialog):
+class ExampleMapDialog(SimpleDialog):
     """!Dialog for adding raster map.
     
     Dialog can be easily changed to enable to choose vector, imagery groups or other elements.
@@ -32,27 +32,27 @@
         @param title dialog window title
         @param id id
         """
-        ElementDialog.__init__(self, parent, title, label = _("Name of raster map:"))
+        SimpleDialog.__init__(self, parent, title)
         
         # here is the place to determine element type
         self.element = gselect.Select(parent = self.panel, type = 'raster',
                                       size = globalvar.DIALOG_GSELECT_SIZE)
         
-        self.PostInit()
-        
-        self.__Layout()
-        
+        self._layout()
+
         self.SetMinSize(self.GetSize())
 
-    def __Layout(self):
+    def _layout(self):
         """!Do layout"""
-        self.dataSizer.Add(item = self.element, proportion = 0,
-                           flag = wx.EXPAND | wx.ALL, border = 5)
-                            
+        self.dataSizer.Add(item = wx.StaticText(parent = self.panel, id = wx.ID_ANY,
+                                                label = _("Name of raster map:")),
+                           proportion = 0, flag = wx.ALL, border = 1)
+        self.dataSizer.Add(self.element, proportion = 0,
+                           flag = wx.EXPAND | wx.ALL, border = 1)
         self.panel.SetSizer(self.sizer)
         self.sizer.Fit(self)
         
     def GetRasterMap(self):
         """!Returns selected raster map"""
-        return self.GetElement()
+        return self.element.GetValue()
 



More information about the grass-commit mailing list