Hi Nathan,
One bug I'm still working on is that the scrollbars don't show the correct size when wordWrap is being used... but I will let the other thread I started serve for debugging that.
Here I just want some folks to give this a try... it should essentially be like the Google Chrome URL bar... where the textbox acts as a search box for the history and shows results in a drop-down. With Chrome the browser history is used for searching, but with this widget you add items to the list just like any list... and can drop-down the full-list of items too.
Worked hard on this, and I think it is pretty good, but obviously it probably isn't perfect!
I gave this a try, initially on Windows 8.1, but will also try it on Linux Mint.
Works well for me with the exception of the following.
Got following exception on the second control, typing into it "thi", but I can't reproduce it on demand, so it must be some other keys I used at the time.
File "d:\devOther\samplesTest\NathanMcCorkle\ComboSearchVListBox.py", line 1050, in <module>
app.MainLoop()
File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\_core.py", line 8660, in MainLoop
wx.PyApp.MainLoop(self)
File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\_core.py", line 7952, in MainLoop
return _core_.PyApp_MainLoop(*args, **kwargs)
File "d:\devOther\samplesTest\NathanMcCorkle\ComboSearchVListBox.py", line 572, in OnKeyDown
self.NotifyItemSelected(self._VListBox.GetItemText(item))
File "d:\devOther\samplesTest\NathanMcCorkle\ComboSearchVListBox.py", line 657, in NotifyItemSelected
self._text.SetValue(text)
File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\_core.py", line 13078, in SetValue
return _core_.TextEntryBase_SetValue(*args, **kwargs)
TypeError: String or Unicode type required
O.K. just got it again and as I am in Wing IDE I can see that 'text' in NotifyItemSelected is "None". You might change the debug line to:
logging.debug("ComboSearchVListBox NotifyItemSelected: %s", text)
It seems to happen each time if you enter text and then hit "Enter", with debug I have these last few entries:
DEBUG:root:**********************
DEBUG:root:keycode pressed: 97
DEBUG:root:searchFtestList STRING BEFORE: thi
DEBUG:root:alphanumeric key pressed
DEBUG:root:searchFtestList STRING AFTER: thia
DEBUG:root:IsPopupShown == True
DEBUG:root:textbox OnKeyDown
DEBUG:root:textbox OnKeyDown RETURN PRESSED on item: -1 --- itemText: None
DEBUG:root:ComboSearchVListBox NotifyItemSelected: None
You might want to make it compatible with Phoenix, following low hanging changes:
- wx.TE_PROCESS_ENTER instead of wx.PROCESS_ENTER
- wx.Bitmap instead of wx.EmptyBitmap
You might want to add '#!/usr/bin/env python' as the first line.
If you want to release it I think you might want to add more documentation, if you do consider the Phoenix style:
http://wxpython.org/Phoenix/docs/html/DocstringsGuidelines.html
Also seeing this exception, but can't recreate it:
File "d:\devOther\samplesTest\NathanMcCorkle\ComboSearchVListBox.py", line 1053, in <module>
app.MainLoop()
File "c:\Python27\Lib\site-packages\wx-3.0.2-msw-phoenix\wx\core.py", line 1879, in MainLoop
rv = wx.PyApp.MainLoop(self)
File "d:\devOther\samplesTest\NathanMcCorkle\ComboSearchVListBox.py", line 247, in OnMouseHover
self._VListBox.SetSelection(item)
wx._core.wxAssertionError: C++ assertion "selection == (-1) || (selection >= 0 && (size_t)selection < GetItemCount())" failed at ..\..\src\generic\vlbox.cpp(286) in wxVListBox::SetSelection(): wxVListBox::SetSelection(): invalid item index
Will try and test on Linux Mint later today.
Wern
···
On 9/3/2014 1:11, Nathan McCorkle wrote: