improve look of wxDataViewCtrl and of its renderer on wxMSW when windows XP themeing is not used (wxRendererXP::DrawItemSelectionRect implementation is ok also for wxRendererMSW; share the code).

Fix a typo in the drawing code for horizontal rules in wxDataViewCtrl.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59327 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2009-03-05 00:36:17 +00:00
parent 826da45133
commit de4bf0b305
2 changed files with 77 additions and 68 deletions

View File

@@ -861,14 +861,6 @@ bool wxDataViewToggleRenderer::GetValue( wxVariant &WXUNUSED(value) ) const
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;
@@ -878,7 +870,7 @@ bool wxDataViewToggleRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state
wxRendererNative::Get().DrawCheckBox(
GetOwner()->GetOwner(),
*dc,
rect,
cell,
flags );
return true;
@@ -897,7 +889,9 @@ bool wxDataViewToggleRenderer::Activate( wxRect WXUNUSED(cell),
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);
}
// ---------------------------------------------------------
@@ -1681,7 +1675,7 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
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);