[GRASS-SVN] r42374 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat May 29 07:42:59 EDT 2010
Author: martinl
Date: 2010-05-29 07:42:59 -0400 (Sat, 29 May 2010)
New Revision: 42374
Modified:
grass/trunk/gui/wxpython/gui_modules/layertree.py
grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI: centre dialogs on screen
Modified: grass/trunk/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/layertree.py 2010-05-29 11:25:00 UTC (rev 42373)
+++ grass/trunk/gui/wxpython/gui_modules/layertree.py 2010-05-29 11:42:59 UTC (rev 42374)
@@ -454,7 +454,8 @@
name = self.GetPyData(self.layer_selected)[0]['maplayer'].name
menuform.GUI().ParseCommand(['r.colors',
'map=%s' % name],
- parentframe=self)
+ parentframe = self,
+ centreOnParent = False)
def OnHistogram(self, event):
"""
@@ -479,6 +480,7 @@
id=wx.ID_ANY,
pos=wx.DefaultPosition, size=globalvar.HIST_WINDOW_SIZE,
style=wx.DEFAULT_FRAME_STYLE)
+ self.histogramFrame.CentreOnScreen()
# show new display
self.histogramFrame.Show()
@@ -842,7 +844,7 @@
module = menuform.GUI()
module.ParseCommand(self.GetPyData(layer)[0]['cmd'],
completed=(self.GetOptData,layer,params),
- parentframe=self, show=show)
+ parentframe=self, show=show, centreOnParent = False)
self.GetPyData(layer)[0]['cmd'] = module.GetCmd()
elif ltype == 'raster':
@@ -851,26 +853,26 @@
if UserSettings.Get(group='cmd', key='rasterOpaque', subkey='enabled'):
cmd.append('-n')
menuform.GUI().ParseCommand(cmd, completed=(self.GetOptData,layer,params),
- parentframe=self)
+ parentframe=self, centreOnParent = False)
elif ltype == '3d-raster':
cmd = ['d.rast3d']
menuform.GUI().ParseCommand(cmd, completed=(self.GetOptData,layer,params),
- parentframe=self)
+ parentframe=self, centreOnParent = False)
elif ltype == 'rgb':
menuform.GUI().ParseCommand(['d.rgb'], completed=(self.GetOptData,layer,params),
- parentframe=self)
+ parentframe=self, centreOnParent = False)
elif ltype == 'his':
menuform.GUI().ParseCommand(['d.his'], completed=(self.GetOptData,layer,params),
- parentframe=self)
+ parentframe=self, centreOnParent = False)
elif ltype == 'shaded':
menuform.GUI().ParseCommand(['d.shadedmap'], completed=(self.GetOptData,layer,params),
- parentframe=self)
+ parentframe=self, centreOnParent = False)
elif ltype == 'rastarrow':
menuform.GUI().ParseCommand(['d.rast.arrow'], completed=(self.GetOptData,layer,params),
- parentframe=self)
+ parentframe=self, centreOnParent = False)
elif ltype == 'rastnum':
menuform.GUI().ParseCommand(['d.rast.num'], completed=(self.GetOptData,layer,params),
- parentframe=self)
+ parentframe=self, centreOnParent = False)
elif ltype == 'vector':
types = ''
for type in UserSettings.Get(group='cmd', key='showType').keys():
@@ -880,29 +882,29 @@
menuform.GUI().ParseCommand(['d.vect', 'type=%s' % types],
completed=(self.GetOptData,layer,params),
- parentframe=self)
+ parentframe=self, centreOnParent = False)
elif ltype == 'thememap':
# -s flag requested, otherwise only first thematic category is displayed
# should be fixed by C-based d.thematic.* modules
menuform.GUI().ParseCommand(['d.thematic.area'],
completed=(self.GetOptData,layer,params),
- parentframe=self)
+ parentframe=self, centreOnParent = False)
elif ltype == 'themechart':
menuform.GUI().ParseCommand(['d.vect.chart'],
completed=(self.GetOptData,layer,params),
- parentframe=self)
+ parentframe=self, centreOnParent = False)
elif ltype == 'grid':
menuform.GUI().ParseCommand(['d.grid'], completed=(self.GetOptData,layer,params),
- parentframe=self)
+ parentframe=self, centreOnParent = False)
elif ltype == 'geodesic':
menuform.GUI().ParseCommand(['d.geodesic'], completed=(self.GetOptData,layer,params),
- parentframe=self)
+ parentframe=self, centreOnParent = False)
elif ltype == 'rhumb':
menuform.GUI().ParseCommand(['d.rhumbline'], completed=(self.GetOptData,layer,params),
- parentframe=self)
+ parentframe=self, centreOnParent = False)
elif ltype == 'labels':
menuform.GUI().ParseCommand(['d.labels'], completed=(self.GetOptData,layer,params),
- parentframe=self)
+ parentframe=self, centreOnParent = False)
elif ltype == 'cmdlayer':
pass
elif ltype == 'group':
Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py 2010-05-29 11:25:00 UTC (rev 42373)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py 2010-05-29 11:42:59 UTC (rev 42374)
@@ -1958,7 +1958,7 @@
return processTask(tree).GetTask()
def ParseCommand(self, cmd, gmpath = None, completed = None, parentframe = None,
- show = True, modal = False):
+ show = True, modal = False, centreOnParent = True):
"""!Parse command
Note: cmd is given as list
@@ -2045,8 +2045,10 @@
if show is not None:
self.mf.notebookpanel.OnUpdateSelection(None)
if show is True:
- if self.parent:
+ if self.parent and centreOnParent:
self.mf.CentreOnParent()
+ else:
+ self.mf.CenterOnScreen()
self.mf.Show(show)
self.mf.MakeModal(modal)
else:
More information about the grass-commit
mailing list