[GRASS-SVN] r32521 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 4 12:44:37 EDT 2008


Author: martinl
Date: 2008-08-04 12:44:37 -0400 (Mon, 04 Aug 2008)
New Revision: 32521

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py
Log:
wxGUI: centre dialog on screen/parent before it is shown (to avoid flickering), update r32514 (merge from trunk r32519)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2008-08-04 16:42:15 UTC (rev 32520)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2008-08-04 16:44:37 UTC (rev 32521)
@@ -1399,6 +1399,7 @@
 
     def OnInit(self):
         self.mf = mainFrame(parent=None, ID=wx.ID_ANY, task_description=self.grass_task)
+        self.mf.CentreOnScreen()
         self.mf.Show(True)
         self.SetTopWindow(self.mf)
         # print >> sys.stderr, time.time() - start
@@ -1413,7 +1414,7 @@
         self.parent = parent
         self.grass_task = None
 
-    def ParseCommand(self, cmd, gmpath=None, completed=None, parentframe=-1, show=True, modal=False):
+    def ParseCommand(self, cmd, gmpath=None, completed=None, parentframe=None, show=True, modal=False):
         """
         Parse command
 
@@ -1435,10 +1436,7 @@
             if completed[2]:
                 dcmd_params.update(completed[2])
 
-        if parentframe != -1:
-            self.parent = parentframe
-        else:
-            self.parent = None
+        self.parent = parentframe
 
         # parse the interface decription
         self.grass_task = grassTask()
@@ -1491,6 +1489,8 @@
                      propwin=self.mf)
         
         if show:
+            if self.parent:
+                self.mf.CentreOnParent()
             self.mf.Show(show)
             self.mf.MakeModal(modal)
         else:

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py	2008-08-04 16:42:15 UTC (rev 32520)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py	2008-08-04 16:44:37 UTC (rev 32521)
@@ -751,8 +751,6 @@
         elif ltype == 'group':
             pass
         
-        self.GetPyData(layer)[0]['propwin'].CentreOnParent()
-
     def OnActivateLayer(self, event):
         """Click on the layer item.
         Launch property dialog, or expand/collapse group of items, etc."""



More information about the grass-commit mailing list