[GRASS-SVN] r35316 -
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jan 10 10:12:45 EST 2009
Author: martinl
Date: 2009-01-10 10:12:45 -0500 (Sat, 10 Jan 2009)
New Revision: 35316
Modified:
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_mapdisp.py
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_tools.py
Log:
wxGUI/nviz: error pressing "All" button (trac #300)
(merge from trunk, r35314)
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py 2009-01-10 15:04:31 UTC (rev 35315)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py 2009-01-10 15:12:45 UTC (rev 35316)
@@ -139,6 +139,20 @@
style=wx.NO_FULL_REPAINT_ON_RESIZE,
Map=None, tree=None, gismgr=None):
self.parent = parent # MapFrame
+
+ #
+ # mouse attributes like currently pressed buttons, position on
+ # the screen, begin and end of dragging, and type of drawing
+ #
+ self.mouse = {
+ 'l' : False,
+ 'r' : False,
+ 'm' : False,
+ 'begin': [0, 0], # screen coordinates
+ 'end' : [0, 0],
+ 'use' : "pointer",
+ 'box' : "point"
+ }
def EraseMap(self):
"""
@@ -270,21 +284,7 @@
#
self.zoomhistory = [] # list of past zoom extents
self.currzoom = 0 # current set of extents in zoom history being used
-
- #
- # mouse attributes like currently pressed buttons, position on
- # the screen, begin and end of dragging, and type of drawing
- #
- self.mouse = {
- 'l' : False,
- 'r' : False,
- 'm' : False,
- 'begin': [0, 0], # screen coordinates
- 'end' : [0, 0],
- 'use' : "pointer",
- 'box' : "point"
- }
-
+
self.zoomtype = 1 # 1 zoom in, 0 no zoom, -1 zoom out
self.hitradius = 10 # distance for selecting map decorations
self.dialogOffset = 5 # offset for dialog (e.g. DisplayAttributesDialog)
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_mapdisp.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_mapdisp.py 2009-01-10 15:04:31 UTC (rev 35315)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_mapdisp.py 2009-01-10 15:12:45 UTC (rev 35316)
@@ -1221,6 +1221,18 @@
return layerName
+ def GetLayerData(self, type, name):
+ """Return layer item data
+
+ @return {} if no layer item found
+ """
+ for item in self.layers:
+ mapLayer = self.tree.GetPyData(item)[0]['maplayer'].GetName()
+ if mapLayer == name:
+ return self.tree.GetPyData(item)[0]['nviz']
+
+ return {}
+
def GetLayerId(self, type, name):
"""Get layer object id or -1"""
if len(name) < 1:
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_tools.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_tools.py 2009-01-10 15:04:31 UTC (rev 35315)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz_tools.py 2009-01-10 15:12:45 UTC (rev 35316)
@@ -418,9 +418,8 @@
flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM,
border=5)
- all = wx.Button(panel, id=wx.ID_ANY, label=_("All"))
- all.SetToolTipString(_("Use for all loaded surfaces"))
- # self.win['reset'] = reset.GetId()
+ all = wx.Button(panel, id=wx.ID_ANY, label=_("Set to all"))
+ all.SetToolTipString(_("Use draw settings for all loaded surfaces"))
all.Bind(wx.EVT_BUTTON, self.OnSurfaceModeAll)
gridSizer.Add(item=all, flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND,
pos=(2, 4))
@@ -1720,10 +1719,30 @@
def OnSurfaceModeAll(self, event):
"""Set draw mode (including wire color) for all loaded surfaces"""
- self.SetSurfaceMode(all=True)
- self.SetSurfaceResolution(all=True)
- ### color = self.FindWindowById(self.win['surface']['draw']['wire-color']).GetColour()
-
+ value, desc = self.SetSurfaceMode()
+ coarse = self.FindWindowById(self.win['surface']['draw']['res-coarse']).GetValue()
+ fine = self.FindWindowById(self.win['surface']['draw']['res-fine']).GetValue()
+ color = self.FindWindowById(self.win['surface']['draw']['wire-color']).GetColour()
+ cvalue = self._getColorString(color)
+
+ for name in self.mapWindow.GetLayerNames(type='raster'):
+ data = self.mapWindow.GetLayerData(type='raster', name=name)
+ if not data:
+ continue # shouldy no happen
+
+ data['surface']['draw']['mode'] = { 'value' : value,
+ 'desc' : desc,
+ 'update' : None, }
+ data['surface']['draw']['resolution'] = { 'coarse' : coarse,
+ 'fine' : fine,
+ 'update' : None, }
+ data['surface']['draw']['wire-color'] = { 'value' : cvalue,
+ 'update' : None }
+
+ # update properties
+ event = wxUpdateProperties(data=data)
+ wx.PostEvent(self.mapWindow, event)
+
if apply and self.parent.autoRender.IsChecked():
self.mapWindow.Refresh(False)
More information about the grass-commit
mailing list