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:
Vadim Zeitlin
2000-09-09 19:41:33 +00:00
parent 0399bce91f
commit a02336b2bb
8 changed files with 246 additions and 222 deletions

View File

@@ -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());
}