[GRASS-SVN] r32897 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Aug 19 13:18:44 EDT 2008
Author: martinl
Date: 2008-08-19 13:18:44 -0400 (Tue, 19 Aug 2008)
New Revision: 32897
Modified:
grass/trunk/gui/wxpython/gui_modules/mapdisp.py
grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
Log:
cmbarton: Fine tuning layer management and auto-render for better panning and resizing.
(merge from devbr6, r32894, r32895, r32896)
Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py 2008-08-19 15:17:20 UTC (rev 32896)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py 2008-08-19 17:18:44 UTC (rev 32897)
@@ -642,8 +642,13 @@
# render background image if needed
#
- if self.tree.rerender == True:
+ # update layer dictionary if there has been a change in layers
+ if self.tree.reorder == True:
self.tree.ReorderLayers()
+
+ # reset flag for auto-rendering
+ self.tree.rerender = False
+
if render:
# update display size
self.Map.ChangeMapSize(self.GetClientSize())
Modified: grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py 2008-08-19 15:17:20 UTC (rev 32896)
+++ grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py 2008-08-19 17:18:44 UTC (rev 32897)
@@ -91,7 +91,8 @@
self.notebook = kargs['notebook'] # GIS Manager notebook for layer tree
self.treepg = parent # notebook page holding layer tree
self.auimgr = kargs['auimgr'] # aui manager
- self.rerender = False # layer change requires a reordering and rerendering (if auto render)
+ self.rerender = False # layer change requires a rerendering if auto render
+ self.reorder = False # layer change requires a reordering
# init associated map display
self.mapdisplay = mapdisp.MapFrame(self,
@@ -199,7 +200,6 @@
if self.rerender:
if self.mapdisplay.autoRender.GetValue():
self.mapdisplay.MapWindow.UpdateMap(render=True)
- self.rerender = False
event.Skip()
@@ -495,6 +495,7 @@
# redraw map if auto-rendering is enabled
self.rerender = True
+ self.reorder = True
#if self.mapdisplay.autoRender.GetValue():
# print "*** Opacity OnRender *****"
# self.mapdisplay.OnRender(None)
@@ -861,6 +862,7 @@
# redraw map if auto-rendering is enabled
self.rerender = True
+ self.reorder = True
#if self.mapdisplay.autoRender.GetValue():
# print "*** Delete OnRender *****"
# self.mapdisplay.OnRender(None)
@@ -938,6 +940,7 @@
# redraw map if auto-rendering is enabled
self.rerender = True
+ self.reorder = True
#if self.mapdisplay.autoRender.GetValue():
# print "*** Checked OnRender *****"
# self.mapdisplay.OnRender(None)
@@ -1073,6 +1076,7 @@
# redraw map if auto-rendering is enabled
self.rerender = True
+ self.reorder = True
#if self.mapdisplay.autoRender.GetValue():
# print "*** Drop OnRender *****"
# self.mapdisplay.OnRender(None)
@@ -1253,6 +1257,7 @@
# reorder map layers
treelayers.reverse()
self.Map.ReorderLayers(treelayers)
+ self.reorder = False
def ChangeLayer(self, item):
"""Change layer"""
@@ -1288,6 +1293,7 @@
# redraw map if auto-rendering is enabled
self.rerender = True
+ self.reorder = True
#if self.mapdisplay.autoRender.GetValue():
# print "*** Change OnRender *****"
# self.mapdisplay.OnRender(None)
More information about the grass-commit
mailing list