]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/ctrlrend.cpp
Add doc for wxGraphicsContext.Create(), which is a lightweight context with no target...
[wxWidgets.git] / src / univ / ctrlrend.cpp
index 60d561ea2463bbc08eadb62a787b84c4d13a8e92..27d9b1e80907cfa841b70edc55c4fcd018393efd 100644 (file)
@@ -67,18 +67,38 @@ wxControlRenderer::wxControlRenderer(wxWindow *window,
     m_rect.height = size.y;
 }
 
-void wxControlRenderer::DrawLabel(const wxBitmap& bitmap,
-                                  wxCoord marginX, wxCoord marginY)
+void wxControlRenderer::DrawLabel()
 {
     m_dc.SetBackgroundMode(wxTRANSPARENT);
     m_dc.SetFont(m_window->GetFont());
     m_dc.SetTextForeground(m_window->GetForegroundColour());
 
     wxString label = m_window->GetLabel();
-    if ( !label.empty() || bitmap.Ok() )
+    if ( !label.empty() )
+    {
+        wxControl *ctrl = wxStaticCast(m_window, wxControl);
+
+        m_renderer->DrawLabel(m_dc,
+                              label,
+                              m_rect,
+                              m_window->GetStateFlags(),
+                              ctrl->GetAlignment(),
+                              ctrl->GetAccelIndex());
+    }
+}
+
+void wxControlRenderer::DrawButtonLabel(const wxBitmap& bitmap,
+                                        wxCoord marginX, wxCoord marginY)
+{
+    m_dc.SetBackgroundMode(wxTRANSPARENT);
+    m_dc.SetFont(m_window->GetFont());
+    m_dc.SetTextForeground(m_window->GetForegroundColour());
+
+    wxString label = m_window->GetLabel();
+    if ( !label.empty() || bitmap.IsOk() )
     {
         wxRect rectLabel = m_rect;
-        if ( bitmap.Ok() )
+        if ( bitmap.IsOk() )
         {
             rectLabel.Inflate(-marginX, -marginY);
         }
@@ -138,7 +158,7 @@ void wxControlRenderer::DrawBitmap(wxDC &dc,
 {
     // we may change the bitmap if we stretch it
     wxBitmap bmp = bitmap;
-    if ( !bmp.Ok() )
+    if ( !bmp.IsOk() )
         return;
 
     int width = bmp.GetWidth(),