X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd11f777738a2572d3ee6b866d103cff5edfb667..b85b06e13d22e7fc1604ec1a49caa1227a1b3d36:/src/generic/odcombo.cpp?ds=sidebyside diff --git a/src/generic/odcombo.cpp b/src/generic/odcombo.cpp index fa036b21e2..9759b33a33 100644 --- a/src/generic/odcombo.cpp +++ b/src/generic/odcombo.cpp @@ -257,14 +257,18 @@ bool wxVListBoxComboPopup::HandleKey( int keycode, bool saturate, wxChar unicode int comboStyle = m_combo->GetWindowStyle(); // this is the character equivalent of the code - wxChar keychar=0; - if ((keycode >= WXK_SPACE) && (keycode <=255) && (keycode != WXK_DELETE) && wxIsprint(keycode)) + wxChar keychar = 0; + if ( keycode < WXK_START ) { - keychar = (wxChar)keycode; - } - else if (unicode>0) - { - keychar = unicode; + if ( unicode > 0 ) + { + if ( wxIsprint(unicode) ) + keychar = unicode; + } + else if ( wxIsprint(keycode) ) + { + keychar = (wxChar) keycode; + } } if ( keycode == WXK_DOWN || keycode == WXK_RIGHT ) @@ -287,7 +291,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 @@ -477,7 +481,8 @@ void wxVListBoxComboPopup::Insert( const wxString& item, int pos ) } m_strings.Insert(item,pos); - m_clientDatas.Insert(NULL, pos); + if ( (int)m_clientDatas.size() >= pos ) + m_clientDatas.Insert(NULL, pos); m_widths.Insert(-1,pos); m_widthsDirty = true;