1. wxRenderer now has DrawCheckButton
2. wxCheckBox seems to work under MSW git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8313 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -634,54 +634,3 @@ void wxControlRenderer::DrawItems(const wxListBox *lbox,
|
||||
rect.y += lineHeight;
|
||||
}
|
||||
}
|
||||
|
||||
void wxControlRenderer::DrawLabelBox(const wxBitmap& bitmap,
|
||||
wxCoord marginLeft,
|
||||
wxCoord marginRight,
|
||||
wxCoord marginTop)
|
||||
{
|
||||
m_dc.SetFont(m_window->GetFont());
|
||||
m_dc.SetTextForeground(m_window->GetForegroundColour());
|
||||
|
||||
// draw the focus border around everything
|
||||
int flags = m_window->GetStateFlags();
|
||||
if ( flags & wxCONTROL_FOCUSED )
|
||||
{
|
||||
m_renderer->DrawCheckBoxFocusBorder(m_dc, &m_rect);
|
||||
}
|
||||
|
||||
// calculate the position of the bitmap and of the label
|
||||
wxCoord xBmp,
|
||||
yBmp = m_rect.y
|
||||
+ (m_rect.height - bitmap.GetHeight() + 1) / 2
|
||||
+ marginTop;
|
||||
|
||||
wxRect rectLabel;
|
||||
wxString label = m_window->GetLabel();
|
||||
m_dc.GetMultiLineTextExtent(label, NULL, &rectLabel.height);
|
||||
rectLabel.y = m_rect.y + (m_rect.height - rectLabel.height) / 2;
|
||||
|
||||
if ( m_window->GetWindowStyle() & wxALIGN_RIGHT )
|
||||
{
|
||||
xBmp = m_rect.GetRight() - bitmap.GetWidth() - marginLeft;
|
||||
rectLabel.SetLeft(m_rect.GetLeft());
|
||||
rectLabel.SetRight(xBmp - marginRight);
|
||||
}
|
||||
else // normal (checkbox to the left of the text) case
|
||||
{
|
||||
xBmp = m_rect.GetLeft() + marginLeft;
|
||||
rectLabel.SetLeft(xBmp + bitmap.GetWidth() + marginRight);
|
||||
rectLabel.SetRight(m_rect.GetRight());
|
||||
}
|
||||
|
||||
m_dc.DrawBitmap(bitmap, xBmp, yBmp, TRUE /* use mask */);
|
||||
|
||||
wxControl *ctrl = wxStaticCast(m_window, wxControl);
|
||||
|
||||
m_renderer->DrawLabel(m_dc,
|
||||
label,
|
||||
rectLabel,
|
||||
flags,
|
||||
wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL,
|
||||
ctrl->GetAccelIndex());
|
||||
}
|
||||
|
Reference in New Issue
Block a user