Hi,
Hi,
I am running into three exceptions when setting a wx.lib.masked.combobox to wx.CB_READONLY and right clicking and selecting "Undo".
1. Attribute error on self._prevSelection, adding this to its init resolves that:
self._prevSelection = (-1, -1)
2. wx._core.PyAssertionError: C++ assertion "!HasFlag(wxCB_READONLY)" failed at ..\
..\src\msw\combobox.cpp(423) in wxComboBox::GetEditHWND(): read-only combobox do
esn't have any edit control
3. maskededit.py, line 3205, in _FindField
raise IndexError('position %s out of range of control' % str(pos))
The attached patch fixes these for me.
Found one more issue with combobox readonly, getting this one when I try to tab to next control:
app_cb.py, line 1030, in <module>
app.MainLoop()
_core.py, line 8660, in MainLoop
wx.PyApp.MainLoop(self)
_core.py, line 7952, in MainLoop
return _core_.PyApp_MainLoop(*args, **kwargs)
combobox.py, line 588, in _OnKeyDownInComboBox
self._keyhandlers[key](event)
maskededit.py, line 3804, in _OnChangeField
field = self._FindField(sel_to)
maskededit.py, line 3205, in _FindField
raise IndexError('position %s out of range of control' % str(pos))
I am not sure how to fix this one, as I can't get at the __readonly attribute in maskededit.py, so should I already catch it in _OnKeyDownInCombobox?
Comment in there indicates that it should be handled but it obviously is not, at least not in 2.9.4.
Werner
···
On 20/11/2012 19:43, Werner wrote:
Werner