]> git.saurik.com Git - wxWidgets.git/commitdiff
use different image for pressed button state
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 21 Feb 2005 00:10:56 +0000 (00:10 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 21 Feb 2005 00:10:56 +0000 (00:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32273 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/datectlg.cpp

index f44aec61ddfc6fd2f94b5362465a88ca5d4a8ae7..05524a461f4c2cf05a62c9e4dcaf8a94c1148d09 100644 (file)
@@ -155,10 +155,6 @@ bool wxDropdownButton::Create(wxWindow *parent,
                                  pos, wxDefaultSize, BTN_FLAGS, validator) )
         return false;
 
-#if (BTNFLAGS & wxBU_AUTODRAW ) == 0
-    m_windowStyle |= wxBU_AUTODRAW;
-#endif
-
     const wxSize sz = GetSize();
     int w = chkBmp.GetWidth(),
         h = chkBmp.GetHeight();
@@ -196,8 +192,15 @@ void wxDropdownButton::DoMoveWindow(int x, int y, int w, int h)
         wxBitmap bmp(bw, bh);
         dc.SelectObject(bmp);
 
-        wxRendererNative::Get().DrawComboBoxDropButton(this, dc, wxRect(0,0,bw, bh));
+        wxRect r(0,0,bw, bh);
+        wxRendererNative& renderer = wxRendererNative::Get();
+        renderer.DrawComboBoxDropButton(this, dc, r);
         SetBitmapLabel(bmp);
+
+        wxBitmap bmpSel(bw, bh);
+        dc.SelectObject(bmpSel);
+        renderer.DrawComboBoxDropButton(this, dc, r, wxCONTROL_PRESSED);
+        SetBitmapSelected(bmpSel);
     }
 
     wxBitmapButton::DoMoveWindow(x, y, w, h);