[GRASS-SVN] r52992 - grass/trunk/gui/wxpython/location_wizard

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Aug 30 03:20:37 PDT 2012


Author: annakrat
Date: 2012-08-30 03:20:37 -0700 (Thu, 30 Aug 2012)
New Revision: 52992

Modified:
   grass/trunk/gui/wxpython/location_wizard/dialogs.py
Log:
wxGUI: attempt to fix default region dialog on Windows (still don't understand how collapsible pane should be treated)

Modified: grass/trunk/gui/wxpython/location_wizard/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/location_wizard/dialogs.py	2012-08-30 08:22:43 UTC (rev 52991)
+++ grass/trunk/gui/wxpython/location_wizard/dialogs.py	2012-08-30 10:20:37 UTC (rev 52992)
@@ -23,6 +23,9 @@
 import wx
 import wx.lib.scrolledpanel as scrolled
 
+if __name__ == '__main__':
+    sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+
 from core                 import globalvar
 from core.gcmd            import RunCommand
 from location_wizard.base import BaseClass
@@ -32,9 +35,9 @@
 class RegionDef(BaseClass, wx.Dialog):
     """!Page for setting default region extents and resolution
     """
-    def __init__(self, parent, id = wx.ID_ANY,
+    def __init__(self, parent, id = wx.ID_ANY, size = (650, 800),
                  title = _("Set default region extent and resolution"), location = None):
-        wx.Dialog.__init__(self, parent, id, title, size = (650,300))
+        wx.Dialog.__init__(self, parent, id, title)
         panel = wx.Panel(self, id = wx.ID_ANY)
         
         self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
@@ -205,6 +208,7 @@
         self.__DoLayout(panel)
         self.SetMinSize(self.GetBestSize())
         self.minWindowSize = self.GetMinSize()
+        wx.CallAfter(self.settings3D.Collapse, True)
     
     def MakeSettings3DPaneContent(self, pane):
         """!Create 3D region settings pane"""
@@ -611,3 +615,19 @@
         self.transnum = self.translist.GetSelection()
         self.transnum = self.transnum - 1
         return self.transnum
+
+def testRegionDef():
+    import sys
+    import gettext
+    import wx.lib.inspection
+    import grass.script as grass
+    gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode = True)
+
+    app = wx.PySimpleApp()
+
+    dlg = RegionDef(None, location = grass.gisenv()["LOCATION_NAME"])
+    dlg.Show()
+    wx.lib.inspection.InspectionTool().Show()
+    app.MainLoop()
+if __name__ == '__main__':
+    testRegionDef()



More information about the grass-commit mailing list