Translate keycode(s) into character more consistenly in wxVListBoxComboPopup::HandleKey() (fixes #10395)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@58203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2009-01-18 20:05:07 +00:00
parent 5e5e1badf5
commit 991248b7f9

View File

@@ -258,13 +258,22 @@ bool wxVListBoxComboPopup::HandleKey( int keycode, bool saturate, wxChar unicode
// this is the character equivalent of the code
wxChar keychar = 0;
if ((keycode >= WXK_SPACE) && (keycode <=255) && (keycode != WXK_DELETE) && wxIsprint(keycode))
if ( keycode < WXK_START )
{
#if wxUSE_UNICODE
if ( unicode > 0 )
{
if ( wxIsprint(unicode) )
keychar = unicode;
}
else
#else
wxUnusedVar(unicode);
#endif
if ( wxIsprint(keycode) )
{
keychar = (wxChar) keycode;
}
else if (unicode>0)
{
keychar = unicode;
}
if ( keycode == WXK_DOWN || keycode == WXK_RIGHT )
@@ -287,7 +296,7 @@ bool wxVListBoxComboPopup::HandleKey( int keycode, bool saturate, wxChar unicode
value-=10;
StopPartialCompletion();
}
else if ( comboStyle & wxCB_READONLY )
else if ( keychar && (comboStyle & wxCB_READONLY) )
{
// Try partial completion