[GRASS-SVN] r45402 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Feb 14 10:14:33 EST 2011
Author: martinl
Date: 2011-02-14 07:14:33 -0800 (Mon, 14 Feb 2011)
New Revision: 45402
Modified:
grass/trunk/gui/wxpython/gui_modules/mapdisp_vdigit.py
grass/trunk/gui/wxpython/gui_modules/mapdisp_window.py
grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI: some minor vdigit fixes
Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp_vdigit.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp_vdigit.py 2011-02-14 11:41:06 UTC (rev 45401)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp_vdigit.py 2011-02-14 15:14:33 UTC (rev 45402)
@@ -116,7 +116,8 @@
self.digit.GetDisplay().DrawMap()
# translate tmp objects (pointer position)
- if self.toolbar.GetAction() == 'moveLine':
+ if self.toolbar.GetAction() == 'moveLine' and \
+ hasattr(self, "moveInfo"):
if self.moveInfo.has_key('beginDiff'):
# move line
for id in self.moveInfo['id']:
@@ -284,11 +285,11 @@
"""!Left mouse button pressed - vector digitizer move
feature/vertex, edit linear feature
"""
- self.moveInfo = {}
+ self.moveInfo = dict()
# geographic coordinates of initial position (left-down)
self.moveInfo['begin'] = None
# list of ids to modify
- self.moveInfo['id'] = []
+ self.moveInfo['id'] = list()
if self.toolbar.GetAction() in ["moveVertex", "editLine"]:
# set pen
@@ -416,7 +417,6 @@
if self.mouse["use"] != "pointer" or not self.toolbar:
return
- digitClass = self.parent.digit
if (self.toolbar.GetAction() == "addLine" and \
self.toolbar.GetAction('type') in ["line", "boundary", "area"]) or \
self.toolbar.GetAction() == "editLine":
@@ -507,11 +507,9 @@
hasattr(self, "moveInfo"):
self.OnLeftDownEditLine(event)
- elif self.toolbar.GetAction() in ("moveLine",
- "moveVertex",
- "editLine") and \
- not hasattr(self, "moveInfo"):
- self.OnLeftDownVDigitMoveLine(event)
+ elif self.toolbar.GetAction() in ("moveLine", "moveVertex", "editLine") and \
+ not hasattr(self, "moveInfo"):
+ self.OnLeftDownMoveLine(event)
elif self.toolbar.GetAction() in ("displayAttrs"
"displayCats"):
@@ -589,7 +587,7 @@
self.copyCatsIds = self.digit.GetDisplay().GetSelected()
elif self.toolbar.GetAction() == "queryLine":
- selected = digitClass.SelectLinesByQuery(bbox = (pos1, pos2))
+ selected = self.digit.SelectLinesByQuery(bbox = (pos1, pos2))
nselected = len(selected)
if nselected > 0:
self.digit.GetDisplay().SetSelected(selected)
@@ -612,8 +610,8 @@
nselected = 1
if nselected > 0:
- if self.toolbar.GetAction() in ("moveLine",
- "moveVertex"):
+ if self.toolbar.GetAction() in ("moveLine", "moveVertex") and \
+ hasattr(self, "moveInfo"):
# get pseudoDC id of objects which should be redrawn
if self.toolbar.GetAction() == "moveLine":
# -> move line
@@ -758,8 +756,8 @@
self.UpdateMap(render = False)
def OnLeftUp(self, event):
- if hasattr(self, "infoMove"):
- if len(digitClass.GetDisplay().GetSelected()) == 0:
+ if hasattr(self, "moveInfo"):
+ if len(self.digit.GetDisplay().GetSelected()) == 0:
self.moveInfo['begin'] = self.Pixel2Cell(self.mouse['begin']) # left down
# eliminate initial mouse moving efect
Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp_window.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp_window.py 2011-02-14 11:41:06 UTC (rev 45401)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp_window.py 2011-02-14 15:14:33 UTC (rev 45402)
@@ -12,9 +12,9 @@
License (>=v2). Read the file COPYING that comes with GRASS
for details.
+ at author Martin Landa <landa.martin gmail.com>
@author Michael Barton
@author Jachym Cepicky
- at author Martin Landa <landa.martin gmail.com>
"""
import os
@@ -474,7 +474,7 @@
# draw to the dc
self.pdc.DrawToDC(dc)
- if isinstace(self, VDigitWindow):
+ if hasattr(self, "digit"):
# decorate with GDDC (transparency)
try:
gcdc = wx.GCDC(dc)
Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py 2011-02-14 11:41:06 UTC (rev 45401)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py 2011-02-14 15:14:33 UTC (rev 45402)
@@ -33,7 +33,7 @@
@todo
- verify option value types
-Copyright(C) 2000-2010 by the GRASS Development Team
+Copyright(C) 2000-2011 by the GRASS Development Team
This program is free software under the GPL(>=v2) Read the file
COPYING coming with GRASS for details.
@@ -370,10 +370,11 @@
self.request = callable(*args, **kwds)
self.resultQ.put((requestId, self.request.run()))
-
- event = wxUpdateDialog(data = self.request.data)
- wx.PostEvent(self.parent, event)
-
+
+ if self.request:
+ event = wxUpdateDialog(data = self.request.data)
+ wx.PostEvent(self.parent, event)
+
class grassTask:
"""!This class holds the structures needed for both filling by the
parser and use by the interface constructor.
More information about the grass-commit
mailing list