[GRASS-SVN] r34969 - in
grass/branches/releasebranch_6_4/gui/wxpython: . gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Dec 21 07:17:00 EST 2008
Author: martinl
Date: 2008-12-21 07:17:00 -0500 (Sun, 21 Dec 2008)
New Revision: 34969
Modified:
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm.py
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py
grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py
Log:
wxGUI: quering disables vector transparency (trac #304)
(merge from devbr6, r34967)
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm.py 2008-12-21 12:07:03 UTC (rev 34968)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm.py 2008-12-21 12:17:00 UTC (rev 34969)
@@ -422,15 +422,15 @@
"""
def __init__(self, parent, id, title, vectmap,
size = wx.DefaultSize, style = wx.DEFAULT_FRAME_STYLE,
- pointdata=None, log=None):
+ item=None, log=None):
self.vectmap = vectmap
- self.pointdata = pointdata
self.parent = parent # GMFrame
+ self.treeItem = item # item in layer tree
self.cmdLog = log # self.parent.goutput
wx.Frame.__init__(self, parent, id, title, style=style)
-
+
# icon
self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass_sql.ico'), wx.BITMAP_TYPE_ICO))
@@ -441,15 +441,7 @@
self.mapdisplay = self.parent.curr_page.maptree.mapdisplay
except:
self.map = self.mapdisplay = None
-
- if pointdata:
- self.icon = pointdata[0]
- self.pointsize = pointdata[1]
- else:
- self.icon = None
- self.pointsize = None
-
-
+
# status bar log class
self.log = Log(self) # -> statusbar
@@ -1101,7 +1093,14 @@
update=True)
else:
# add map layer with higlighted vector features
- self.AddQueryMapLayer()
+ self.AddQueryMapLayer() # -> self.qlayer
+
+ # set opacity based on queried layer
+ if self.parent and self.parent.GetName() == "LayerManager" and \
+ self.treeItem:
+ maptree = self.parent.curr_page.maptree
+ opacity = maptree.GetPyData(self.treeItem)[0]['maplayer'].GetOpacity(float=True)
+ self.qlayer.SetOpacity(opacity)
if zoom:
keyColumn = self.mapDBInfo.layers[self.layer]['key']
where = ''
@@ -1932,7 +1931,9 @@
self.qlayer.SetCmd(self.mapdisplay.AddTmpVectorMapLayer(self.vectmap, cats, addLayer=False))
else:
self.qlayer = self.mapdisplay.AddTmpVectorMapLayer(self.vectmap, cats)
-
+
+ return self.qlayer
+
def UpdateDialog(self, layer):
"""Updates dialog layout for given layer"""
#
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py 2008-12-21 12:07:03 UTC (rev 34968)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/mapdisp.py 2008-12-21 12:17:00 UTC (rev 34969)
@@ -3519,8 +3519,12 @@
useId=False,
addLayer=False))
else:
- self.AddTmpVectorMapLayer(mapName, cats, useId=False)
+ qlayer = self.AddTmpVectorMapLayer(mapName, cats, useId=False)
+ # set opacity based on queried layer
+ opacity = self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer'].GetOpacity(float=True)
+ qlayer.SetOpacity(opacity)
+
self.MapWindow.UpdateMap(render=False, renderVector=False)
if not self.dialogs['attributes'].IsShown():
self.dialogs['attributes'].Show()
Modified: grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py 2008-12-21 12:07:03 UTC (rev 34968)
+++ grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py 2008-12-21 12:17:00 UTC (rev 34969)
@@ -1115,28 +1115,26 @@
dcmd = self.curr_page.maptree.GetPyData(layer)[0]['cmd']
if not dcmd:
return
-
- size = icon = None
+
mapname = utils.GetLayerNameFromCmd(dcmd)
-
+
for option in dcmd:
if option.find('size') > -1:
size = option.split('=')[1]
elif option.find('icon') > -1:
icon = option.split('=')[1]
-
- pointdata = (icon, size)
-
+
busy = wx.BusyInfo(message=_("Please wait, loading attribute data..."),
parent=self)
wx.Yield()
-
+
self.dbmanager = dbm.AttributeManager(parent=self, id=wx.ID_ANY,
title="%s - <%s>" % (_("GRASS GIS Attribute Table Manager"),
mapname),
size=wx.Size(500,300), vectmap=mapname,
- pointdata=pointdata, log=self.goutput)
+ item=layer, log=self.goutput)
+
busy.Destroy()
self.dbmanager.Show()
More information about the grass-commit
mailing list