[GRASS-SVN] r44180 - in grass/branches/develbranch_6/gui/wxpython: . gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 6 06:42:45 EDT 2010


Author: martinl
Date: 2010-11-06 03:42:45 -0700 (Sat, 06 Nov 2010)
New Revision: 44180

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py
   grass/branches/develbranch_6/gui/wxpython/wxgui.py
Log:
wxGUI: set default position of windows (when .grasswx6 file is not available)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py	2010-11-06 10:37:10 UTC (rev 44179)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py	2010-11-06 10:42:45 UTC (rev 44180)
@@ -114,8 +114,9 @@
 DIALOG_LAYER_SIZE = (100, -1)
 DIALOG_COLOR_SIZE = (30, 30)
 
-MAP_WINDOW_SIZE = (770, 570)
+MAP_WINDOW_SIZE = (700, 500)
 HIST_WINDOW_SIZE = (500, 350)
+GM_WINDOW_SIZE = (575, 500)
 
 MAP_DISPLAY_STATUSBAR_MODE = [_("Coordinates"),
                               _("Extent"),

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py	2010-11-06 10:37:10 UTC (rev 44179)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py	2010-11-06 10:42:45 UTC (rev 44180)
@@ -78,8 +78,13 @@
             'general': {
                 # use default window layout (layer manager, displays, ...)
                 'defWindowPos' : {
-                    'enabled' : False,
-                    'dim' : ''
+                    'enabled' : True,
+                    'dim' : '%d,0,%d,%d,0,0,%d,%d' % \
+                        (globalvar.MAP_WINDOW_SIZE[0],
+                         globalvar.GM_WINDOW_SIZE[0],
+                         globalvar.GM_WINDOW_SIZE[1],
+                         globalvar.MAP_WINDOW_SIZE[0],
+                         globalvar.MAP_WINDOW_SIZE[1])
                     },
                 # expand/collapse element list
                 'elementListExpand' : {

Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py	2010-11-06 10:37:10 UTC (rev 44179)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py	2010-11-06 10:42:45 UTC (rev 44180)
@@ -96,7 +96,7 @@
     """
     def __init__(self, parent, id = wx.ID_ANY, title = _("GRASS GIS Layer Manager"),
                  workspace = None,
-                 size = (600, 450), style = wx.DEFAULT_FRAME_STYLE, **kwargs):
+                 size = globalvar.GM_WINDOW_SIZE, style = wx.DEFAULT_FRAME_STYLE, **kwargs):
         self.parent    = parent
         self.baseTitle = title
         self.iconsize  = (16, 16)
@@ -1539,6 +1539,18 @@
                          milliseconds=2000, parent=None, id=wx.ID_ANY)
         wx.Yield()
         
+        w, h = wx.GetDisplaySize()
+        if globalvar.MAP_WINDOW_SIZE[0] + globalvar.GM_WINDOW_SIZE[0] > w:
+            gmX = w - globalvar.GM_WINDOW_SIZE[0]
+            dim = '%d,0,%d,%d,0,0,%d,%d' % \
+                (gmX,
+                 globalvar.GM_WINDOW_SIZE[0],
+                 globalvar.GM_WINDOW_SIZE[1],
+                 globalvar.MAP_WINDOW_SIZE[0],
+                 globalvar.MAP_WINDOW_SIZE[1])
+            UserSettings.Set(group = 'general', key = 'defWindowPos',
+                             subkey = 'dim', value = dim)
+        
         # create and show main frame
         mainframe = GMFrame(parent=None, id=wx.ID_ANY,
                             workspace = self.workspaceFile)



More information about the grass-commit mailing list