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

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58202 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2009-01-18 19:57:23 +00:00
parent 8da17c8609
commit b5b3c8a0cf

View File

@@ -257,14 +257,18 @@ bool wxVListBoxComboPopup::HandleKey( int keycode, bool saturate, wxChar unicode
int comboStyle = m_combo->GetWindowStyle(); int comboStyle = m_combo->GetWindowStyle();
// this is the character equivalent of the code // this is the character equivalent of the code
wxChar keychar=0; wxChar keychar = 0;
if ((keycode >= WXK_SPACE) && (keycode <=255) && (keycode != WXK_DELETE) && wxIsprint(keycode)) if ( keycode < WXK_START )
{ {
keychar = (wxChar)keycode; if ( unicode > 0 )
} {
else if (unicode>0) if ( wxIsprint(unicode) )
{ keychar = unicode;
keychar = unicode; }
else if ( wxIsprint(keycode) )
{
keychar = (wxChar) keycode;
}
} }
if ( keycode == WXK_DOWN || keycode == WXK_RIGHT ) if ( keycode == WXK_DOWN || keycode == WXK_RIGHT )
@@ -287,7 +291,7 @@ bool wxVListBoxComboPopup::HandleKey( int keycode, bool saturate, wxChar unicode
value-=10; value-=10;
StopPartialCompletion(); StopPartialCompletion();
} }
else if ( comboStyle & wxCB_READONLY ) else if ( keychar && (comboStyle & wxCB_READONLY) )
{ {
// Try partial completion // Try partial completion