Add a separate wxControlRenderer::DrawButtonLabel() too.
wxControlRenderer::DrawLabel() was used by both wxStaticText and wxButton but their labels may need to be drawn differently and wxRenderer does have different DrawLabel() and DrawButtonLabel() to do it. Now also add a separate method for the buttons to wxControlRenderer. See #11220. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62004 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -67,8 +67,28 @@ 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() )
|
||||
{
|
||||
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());
|
||||
|
||||
Reference in New Issue
Block a user