]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/combo.cpp
wxArrayEditorDialog now uses wxEditableListBox. It has also been renamed to wxPGArray...
[wxWidgets.git] / src / msw / combo.cpp
index 733e068430e5855adc385d7d4e706726a29cabe7..109c74cbd344675235324d35c46037a5afc3a6cb 100644 (file)
@@ -221,31 +221,6 @@ wxComboCtrl::~wxComboCtrl()
 {
 }
 
-void wxComboCtrl::OnThemeChange()
-{
-    // there doesn't seem to be any way to get the text colour using themes
-    // API: TMT_TEXTCOLOR doesn't work neither for EDIT nor COMBOBOX
-    if ( !m_hasFgCol )
-    {
-        wxColour fgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
-        SetForegroundColour(fgCol);
-        m_hasFgCol = false;
-    }
-
-    // NB: use EDIT, not COMBOBOX (the latter works in XP but not Vista)
-    wxColour bgCol = MSWGetThemeColour(L"EDIT",
-                                       EP_EDITTEXT,
-                                       ETS_NORMAL,
-                                       ThemeColourBackground,
-                                       wxSYS_COLOUR_WINDOW);
-
-    if ( !m_hasBgCol )
-    {
-        SetBackgroundColour(bgCol);
-        m_hasBgCol = false;
-    }
-}
-
 void wxComboCtrl::OnResize()
 {
     //
@@ -755,6 +730,7 @@ void wxComboCtrl::DoTimerEvent()
 {
     bool stopTimer = false;
 
+    wxWindow* win = GetPopupWindow();
     wxWindow* popup = GetPopupControl()->GetControl();
 
     // Popup was hidden before it was fully shown?
@@ -766,7 +742,6 @@ void wxComboCtrl::DoTimerEvent()
     {
         wxLongLong t = ::wxGetLocalTimeMillis();
         const wxRect& rect = m_animRect;
-        wxWindow* win = GetPopupWindow();
 
         int pos = (int) (t-m_animStart).GetLo();
         if ( pos < COMBOBOX_ANIMATION_DURATION )
@@ -784,8 +759,10 @@ void wxComboCtrl::DoTimerEvent()
             }
             else
             {
-                popup->Move( 0, -y );
+                // Note that apparently Move() should be called after
+                // SetSize() to reduce (or even eliminate) animation garbage
                 win->SetSize( rect.x, rect.y, rect.width, h );
+                popup->Move( 0, -y );
             }
         }
         else
@@ -796,9 +773,13 @@ void wxComboCtrl::DoTimerEvent()
 
     if ( stopTimer )
     {
-        popup->Move( 0, 0 );
         m_animTimer.Stop();
         DoShowPopup( m_animRect, m_animFlags );
+        popup->Move( 0, 0 );
+
+        // Do a one final refresh to clean up the rare cases of animation
+        // garbage
+        win->Refresh();
     }
 }
 #endif
@@ -856,18 +837,12 @@ bool wxComboCtrl::IsKeyPopupToggle(const wxKeyEvent& event) const
 
         case WXK_DOWN:
         case WXK_UP:
-            // On XP or with writable combo in Classic, arrows don't open the
-            // popup but Alt-arrow does
-            if ( event.AltDown() ||
-                    ( !isPopupShown &&
-                      HasFlag(wxCB_READONLY)
-#if wxUSE_UXTHEME
-                      && !wxUxThemeEngine::GetIfActive()
-#endif
-                    ) )
-            {
+        case WXK_NUMPAD_DOWN:
+        case WXK_NUMPAD_UP:
+            // Arrow keys (and mouse wheel) toggle the popup in the native
+            // combo boxes
+            if ( event.AltDown() )
                 return true;
-            }
             break;
     }