[GRASS-SVN] r58644 - grass/trunk/gui/wxpython/gui_core
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jan 8 11:38:31 PST 2014
Author: martinl
Date: 2014-01-08 11:38:31 -0800 (Wed, 08 Jan 2014)
New Revision: 58644
Modified:
grass/trunk/gui/wxpython/gui_core/dialogs.py
grass/trunk/gui/wxpython/gui_core/forms.py
grass/trunk/gui/wxpython/gui_core/gselect.py
Log:
wxGUI: disable read-only MapsetSelect (related to r58618)
@todo: fix MapsetSelect to allow read-only mode
Modified: grass/trunk/gui/wxpython/gui_core/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/dialogs.py 2014-01-08 17:58:02 UTC (rev 58643)
+++ grass/trunk/gui/wxpython/gui_core/dialogs.py 2014-01-08 19:38:31 UTC (rev 58644)
@@ -1354,8 +1354,9 @@
bodySizer.AddGrowableCol(1)
bodySizer.AddGrowableRow(3)
+
# bindings
- self.mapset.Bind(wx.EVT_COMBOBOX, self.OnChangeParams)
+ self.mapset.Bind(wx.EVT_TEXT, self.OnChangeParams)
self.layers.Bind(wx.EVT_RIGHT_DOWN, self.OnMenu)
self.filter.Bind(wx.EVT_TEXT, self.OnFilter)
self.toggle.Bind(wx.EVT_CHECKBOX, self.OnToggle)
Modified: grass/trunk/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/forms.py 2014-01-08 17:58:02 UTC (rev 58643)
+++ grass/trunk/gui/wxpython/gui_core/forms.py 2014-01-08 19:38:31 UTC (rev 58644)
@@ -1362,8 +1362,9 @@
param = p,
multiple = p.get('multiple', False))
- # A gselect.ColumnSelect is a combobox with two children: a textctl and a popupwindow;
- # we target the textctl here
+ # A gselect.ColumnSelect is a combobox
+ # with two children: a textctl and a
+ # popupwindow; we target the textctl here
textWin = win.GetTextCtrl()
p['wxId'] = [ textWin.GetId(), ]
@@ -1385,10 +1386,12 @@
win = gselect.MapsetSelect(parent = which_panel,
value = value, new = new,
multiple = p.get('multiple', False))
- win.Bind(wx.EVT_COMBOBOX, self.OnUpdateSelection)
- win.Bind(wx.EVT_COMBOBOX, self.OnSetValue)
- win.Bind(wx.EVT_TEXT, self.OnSetValue)
+ textWin = win.GetTextCtrl()
+ p['wxId'] = [ textWin.GetId(), ]
+ textWin.Bind(wx.EVT_TEXT, self.OnSetValue)
+ win.Bind(wx.EVT_TEXT, self.OnUpdateSelection)
+
elif prompt == 'dbase':
win = gselect.DbaseSelect(parent = which_panel,
changeCallback = self.OnSetValue)
Modified: grass/trunk/gui/wxpython/gui_core/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/gselect.py 2014-01-08 17:58:02 UTC (rev 58643)
+++ grass/trunk/gui/wxpython/gui_core/gselect.py 2014-01-08 19:38:31 UTC (rev 58644)
@@ -159,6 +159,9 @@
class ListCtrlComboPopup(wx.combo.ComboPopup):
"""!Create a list ComboBox using TreeCtrl with hidden root.
+
+ @todo: use event.EventObject instead of hardcoding (see forms.py)
+ https://groups.google.com/forum/#!topic/wxpython-users/pRz6bi0k0XY
"""
# overridden ComboPopup methods
def Init(self):
@@ -1072,8 +1075,9 @@
gisdbase = None, location = None, setItems = True,
searchPath = False, new = False, skipCurrent = False, multiple = False, **kwargs):
style = 0
- if not new and not multiple:
- style = wx.CB_READONLY
+ ### disabled, read-only widget has no TextCtrl children (TODO: rewrite)
+ ### if not new and not multiple:
+ ### style = wx.CB_READONLY
wx.combo.ComboCtrl.__init__(self, parent, id, size = size,
style = style, **kwargs)
More information about the grass-commit
mailing list