]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/odcombo.cpp
fix compilation without wxUSE_STREAMS (closes #10900)
[wxWidgets.git] / src / generic / odcombo.cpp
index 618375b221244cbad0aaa1cc08a323e57d31762a..9759b33a33dff0ad28359f69db002636b56c64fd 100644 (file)
@@ -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