[GRASS-SVN] r58591 - grass/trunk/gui/wxpython/gmodeler
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jan 3 10:11:58 PST 2014
Author: martinl
Date: 2014-01-03 10:11:58 -0800 (Fri, 03 Jan 2014)
New Revision: 58591
Modified:
grass/trunk/gui/wxpython/gmodeler/dialogs.py
Log:
wxGUI/modeler: fix focus when moving items up/down
Modified: grass/trunk/gui/wxpython/gmodeler/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/dialogs.py 2014-01-03 03:39:48 UTC (rev 58590)
+++ grass/trunk/gui/wxpython/gmodeler/dialogs.py 2014-01-03 18:11:58 UTC (rev 58591)
@@ -953,11 +953,13 @@
model = self.frame.GetModel()
modelActions = model.GetItems(objType=ModelAction)
idxList = dict()
+ itemsToSelect = list()
for i in items:
if up:
idx = i-1
else:
idx = i+1
+ itemsToSelect.append(idx)
idxList[model.GetItemIndex(modelActions[i])] = model.GetItemIndex(modelActions[idx])
# reorganize model items
@@ -966,7 +968,7 @@
self.Populate(model.GetItems(objType=ModelAction))
# re-selected originaly selected item
- for item in idxList.itervalues():
+ for item in itemsToSelect:
self.SetItemState(item, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED | wx.LIST_STATE_FOCUSED)
class ItemCheckListCtrl(ItemListCtrl, listmix.CheckListCtrlMixin):
More information about the grass-commit
mailing list