]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/button.cpp
Use the OOR typemap for wxTreeCtrls too.
[wxWidgets.git] / src / univ / button.cpp
index 23a4d96eea253a9f9c59a5f11ae7fb147c729f7e..b06789a25d7ee39caad11d32bd2c52fe0e05a8c9 100644 (file)
@@ -39,6 +39,7 @@
 #include "wx/univ/renderer.h"
 #include "wx/univ/inphand.h"
 #include "wx/univ/theme.h"
+#include "wx/univ/colschem.h"
 
 // ----------------------------------------------------------------------------
 // constants
@@ -162,6 +163,30 @@ void wxButton::DoDraw(wxControlRenderer *renderer)
     renderer->DrawLabel(m_bitmap, m_marginBmpX, m_marginBmpY);
 }
 
+bool wxButton::DoDrawBackground(wxDC& dc)
+{
+    wxRect rect;
+    wxSize size = GetSize();
+    rect.width = size.x;
+    rect.height = size.y;
+    
+    if ( GetBackgroundBitmap().Ok() )
+    {
+        // get the bitmap and the flags
+        int alignment;
+        wxStretch stretch;
+        wxBitmap bmp = GetBackgroundBitmap(&alignment, &stretch);
+        wxControlRenderer::DrawBitmap(dc, bmp, rect, alignment, stretch);
+    }
+    else
+    {
+        m_renderer->DrawButtonSurface(dc, wxTHEME_BG_COLOUR(this),
+                                      rect, GetStateFlags());
+    }
+
+    return TRUE;
+}
+
 // ----------------------------------------------------------------------------
 // input processing
 // ----------------------------------------------------------------------------