bool wxDataViewToggleRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) )
{
- // User wxRenderer here
-
- wxRect rect;
- rect.x = cell.x + cell.width/2 - 10;
- rect.width = 20;
- rect.y = cell.y + cell.height/2 - 10;
- rect.height = 20;
-
int flags = 0;
if (m_toggle)
flags |= wxCONTROL_CHECKED;
wxRendererNative::Get().DrawCheckBox(
GetOwner()->GetOwner(),
*dc,
- rect,
+ cell,
flags );
return true;
wxSize wxDataViewToggleRenderer::GetSize() const
{
- return wxSize(20,20);
+ // the window parameter is not used by GetCheckBoxSize() so it's
+ // safe to pass NULL
+ return wxRendererNative::Get().GetCheckBoxSize(NULL);
}
// ---------------------------------------------------------
dc.SetPen(m_penRule);
dc.SetBrush(*wxTRANSPARENT_BRUSH);
- for (unsigned int i = item_start; i <= item_last+1; i++)
+ for (unsigned int i = item_start; i <= item_last; i++)
{
int y = GetLineStart( i );
dc.DrawLine(x_start, y, x_last, y);