]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/combocmn.cpp
move ScrollWindow() implementation to the base class and call private DoScrollHorz...
[wxWidgets.git] / src / common / combocmn.cpp
index 8fb796c2ccaa3761846f249699c53cc5215bad84..af78618a59a0e7fd81e0f16d7b5d8d9a5a50eea3 100644 (file)
@@ -1177,6 +1177,8 @@ bool wxComboCtrlBase::Enable(bool enable)
         m_btn->Enable(enable);
     if ( m_text )
         m_text->Enable(enable);
+        
+    Refresh();
 
     return true;
 }
@@ -1233,16 +1235,15 @@ void wxComboCtrlBase::SetValidator(const wxValidator& validator)
 
     if ( textCtrl )
         textCtrl->SetValidator( validator );
+    else
+        wxControl::SetValidator( validator );
 }
 
 wxValidator* wxComboCtrlBase::GetValidator()
 {
     wxTextCtrl* textCtrl = GetTextCtrl();
 
-    if ( textCtrl )
-        return textCtrl->GetValidator();
-
-    return wxControl::GetValidator();
+    return textCtrl ? textCtrl->GetValidator() : wxControl::GetValidator();
 }
 #endif // wxUSE_VALIDATORS
 
@@ -1651,22 +1652,8 @@ void wxComboCtrlBase::OnKeyEvent(wxKeyEvent& event)
     }
     else // no popup
     {
-        int keycode = event.GetKeyCode();
-
-        if ( keycode == WXK_TAB )
-        {
-            wxNavigationKeyEvent evt;
-
-            wxWindow* mainCtrl = GetMainWindowOfCompositeControl();
-
-            evt.SetFlags(wxNavigationKeyEvent::FromTab|
-                         (!event.ShiftDown() ? wxNavigationKeyEvent::IsForward
-                                             : wxNavigationKeyEvent::IsBackward));
-            evt.SetEventObject(mainCtrl);
-            evt.SetCurrentFocus(mainCtrl);
-            mainCtrl->GetParent()->GetEventHandler()->AddPendingEvent(evt);
+        if ( HandleAsNavigationKey(event) )
             return;
-        }
 
         if ( IsKeyPopupToggle(event) )
         {
@@ -1683,6 +1670,8 @@ void wxComboCtrlBase::OnKeyEvent(wxKeyEvent& event)
             return;
         }
 
+        int keycode = event.GetKeyCode();
+
         if ( (comboStyle & wxCB_READONLY) ||
              (keycode != WXK_RIGHT && keycode != WXK_LEFT) )
         {