Add wxRenderer::DrawCheckButton for use inside

wxDataViewCtrl.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38794 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2006-04-18 16:14:12 +00:00
parent f6630099a7
commit 862d8041ab
4 changed files with 116 additions and 14 deletions

View File

@@ -315,26 +315,23 @@ bool wxDataViewToggleCell::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) )
{
// User wxRenderer here
if (GetMode() == wxDATAVIEW_CELL_ACTIVATABLE)
dc->SetPen( *wxBLACK_PEN );
else
dc->SetPen( *wxGREY_PEN );
dc->SetBrush( *wxTRANSPARENT_BRUSH );
wxRect rect;
rect.x = cell.x + cell.width/2 - 10;
rect.width = 20;
rect.y = cell.y + cell.height/2 - 10;
rect.height = 20;
dc->DrawRectangle( rect );
int flags = 0;
if (m_toggle)
{
rect.x += 2;
rect.y += 2;
rect.width -= 4;
rect.height -= 4;
dc->DrawLine( rect.x, rect.y, rect.x+rect.width, rect.y+rect.height );
dc->DrawLine( rect.x+rect.width, rect.y, rect.x, rect.y+rect.height );
}
flags |= wxCONTROL_CHECKED;
if (GetMode() != wxDATAVIEW_CELL_ACTIVATABLE)
flags |= wxCONTROL_DISABLED;
wxRendererNative::Get().DrawCheckButton(
GetOwner()->GetOwner(),
*dc,
rect,
flags );
return true;
}