[GRASS-SVN] r42704 - in grass/trunk/gui/wxpython: gui_modules icons
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jul 5 16:52:29 EDT 2010
Author: martinl
Date: 2010-07-05 20:52:29 +0000 (Mon, 05 Jul 2010)
New Revision: 42704
Modified:
grass/trunk/gui/wxpython/gui_modules/gmodeler.py
grass/trunk/gui/wxpython/gui_modules/toolbars.py
grass/trunk/gui/wxpython/icons/grass2_icons.py
grass/trunk/gui/wxpython/icons/grass_icons.py
grass/trunk/gui/wxpython/icons/icon.py
grass/trunk/gui/wxpython/icons/silk_icons.py
Log:
wxGUI/modeler: refresh canvas func
Modified: grass/trunk/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gmodeler.py 2010-07-05 08:30:16 UTC (rev 42703)
+++ grass/trunk/gui/wxpython/gui_modules/gmodeler.py 2010-07-05 20:52:29 UTC (rev 42704)
@@ -100,6 +100,20 @@
"""!Return list of actions"""
return self.actions
+ def GetAction(self, aId):
+ """!Get action of given id
+
+ @param aId action id
+
+ @return ModelAction instance
+ @return None if no action found
+ """
+ for action in self.actions:
+ if action.GetId() == aId:
+ return action
+
+ return None
+
def GetLoops(self):
"""!Return list of loops"""
return self.loops
@@ -531,6 +545,10 @@
"""
self.GetCanvas().RemoveSelected()
+ def OnCanvasRefresh(self, event):
+ """!Refresh canvas"""
+ self.GetCanvas().Refresh()
+
def OnCloseWindow(self, event):
"""!Close window"""
if self.modelChanged and \
@@ -3682,14 +3700,15 @@
"""!Finish editing of item"""
itemIndex = event.GetIndex()
columnIndex = event.GetColumn()
- nameOld = self.GetItem(itemIndex, 0).GetText()
-
- if columnIndex == 0: # TODO
- event.Veto()
self.itemDataMap[itemIndex][columnIndex] = event.GetText()
- self.parent.UpdateModelVariables()
+ aId = int(self.GetItem(itemIndex, 0).GetText())
+ action = self.parent.parent.GetModel().GetAction(aId)
+ if not action:
+ event.Veto()
+ if columnIndex == 0:
+ action.SetId(aId)
def main():
app = wx.PySimpleApp()
Modified: grass/trunk/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/toolbars.py 2010-07-05 08:30:16 UTC (rev 42703)
+++ grass/trunk/gui/wxpython/gui_modules/toolbars.py 2010-07-05 20:52:29 UTC (rev 42704)
@@ -1406,6 +1406,7 @@
# self.properties = wx.NewId()
self.variables = wx.NewId()
self.quit = wx.NewId()
+ self.redraw = wx.NewId()
# tool, label, bitmap, kind, shortHelp, longHelp, handler
return (
@@ -1435,6 +1436,9 @@
wx.ITEM_NORMAL, Icons['modelRelation'].GetLabel(), Icons['modelRelation'].GetDesc(),
self.parent.OnDefineRelation),
('', '', '', '', '', '', ''),
+ (self.redraw, 'redraw', Icons['modelRedraw'].GetBitmap(),
+ wx.ITEM_NORMAL, Icons['modelRedraw'].GetLabel(), Icons['modelRedraw'].GetDesc(),
+ self.parent.OnCanvasRefresh),
(self.run, 'run', Icons['modelRun'].GetBitmap(),
wx.ITEM_NORMAL, Icons['modelRun'].GetLabel(), Icons['modelRun'].GetDesc(),
self.parent.OnRunModel),
Modified: grass/trunk/gui/wxpython/icons/grass2_icons.py
===================================================================
--- grass/trunk/gui/wxpython/icons/grass2_icons.py 2010-07-05 08:30:16 UTC (rev 42703)
+++ grass/trunk/gui/wxpython/icons/grass2_icons.py 2010-07-05 20:52:29 UTC (rev 42704)
@@ -94,7 +94,6 @@
'grGcpClear' : 'gcp-remove.png',
'grGeorect' : 'georectify.png',
'grGcpRms' : 'gcp-rms.png',
- 'grGcpRefresh' : 'redraw.png',
"grGcpSave" : 'gcp-save.png',
"grGcpAdd" : 'gcp-add.png',
"grGcpDelete" : 'gcp-delete.png',
@@ -110,4 +109,5 @@
"modelProperties" : 'options.png',
# various
"settings" : 'settings.png',
+ 'redraw' : 'redraw.png',
}
Modified: grass/trunk/gui/wxpython/icons/grass_icons.py
===================================================================
--- grass/trunk/gui/wxpython/icons/grass_icons.py 2010-07-05 08:30:16 UTC (rev 42703)
+++ grass/trunk/gui/wxpython/icons/grass_icons.py 2010-07-05 20:52:29 UTC (rev 42704)
@@ -96,7 +96,6 @@
'grGcpSet' : 'gui-gcpset.gif',
'grGeorect' : 'gui-georect.gif',
'grGcpRms' : 'gui-rms.gif',
- 'grGcpRefresh' : 'gui-display.gif',
"grGcpSave" : 'file-save.gif',
"grGcpAdd" : wx.ART_NEW, # FIXME
"grGcpDelete" : wx.ART_DELETE, # FIXME
@@ -112,4 +111,5 @@
"modelProperties" : wx.ART_ERROR,
# various
"settings" : 'edit-color.gif',
+ "redraw" : 'gui-display.gif',
}
Modified: grass/trunk/gui/wxpython/icons/icon.py
===================================================================
--- grass/trunk/gui/wxpython/icons/icon.py 2010-07-05 08:30:16 UTC (rev 42703)
+++ grass/trunk/gui/wxpython/icons/icon.py 2010-07-05 20:52:29 UTC (rev 42704)
@@ -21,8 +21,7 @@
import os
import sys
-gmPath = os.path.join(os.getenv("GISBASE"), "etc", "wxpython", "gui_modules")
-sys.path.append(gmPath)
+sys.path.append(os.path.join(os.getenv("GISBASE"), "etc", "wxpython", "gui_modules"))
import globalvar
if not os.getenv("GRASS_WXBUNDLED"):
@@ -320,8 +319,6 @@
label=_("Georectify")),
'grGcpRms' : MetaIcon (img=Icons["grGcpRms"],
label=_("Recalculate RMS error")),
- 'grGcpRefresh' : MetaIcon (img=Icons["grGcpRefresh"],
- label=_("Redraw GCP markers in map displays")),
'grGcpSave' : MetaIcon (img=Icons["grGcpSave"],
label=_("Save GCPs to POINTS file")),
'grGcpAdd' : MetaIcon (img=Icons["grGcpAdd"],
@@ -371,6 +368,8 @@
label=_("Show model properties")),
"modelVariables" : MetaIcon (img=Icons["modelProperties"],
label=_("Manage model variables")),
+ "modelRedraw" : MetaIcon (img=Icons["redraw"],
+ label=_("Redraw model canvas")),
}
# testing ...
Modified: grass/trunk/gui/wxpython/icons/silk_icons.py
===================================================================
--- grass/trunk/gui/wxpython/icons/silk_icons.py 2010-07-05 08:30:16 UTC (rev 42703)
+++ grass/trunk/gui/wxpython/icons/silk_icons.py 2010-07-05 20:52:29 UTC (rev 42704)
@@ -98,7 +98,6 @@
'grGcpClear' : 'cross.png',
'grGeorect' : 'application_lightning.png',
'grGcpRms' : 'error.png',
- 'grGcpRefresh' : 'arrow_refresh.png',
"grGcpSave" : 'picture_save.png',
"grGcpAdd" : 'bullet_add.png',
"grGcpDelete" : 'bullet_delete.png',
@@ -114,4 +113,5 @@
"modelProperties" : wx.ART_ERROR,
# various
"settings" : 'color_swatch.png',
+ "redraw" : 'arrow_refresh.png',
}
More information about the grass-commit
mailing list