X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f8d0234d39c66f3d1d7fc2346562cb96c8c7be20..cd67553cf4f42ea9a0da95b744fd88174e904dc9:/src/generic/gridctrl.cpp diff --git a/src/generic/gridctrl.cpp b/src/generic/gridctrl.cpp index 955c652ce8..54a79a9b0d 100644 --- a/src/generic/gridctrl.cpp +++ b/src/generic/gridctrl.cpp @@ -47,7 +47,7 @@ void wxGridCellRenderer::Draw(wxGrid& grid, dc.SetBackgroundMode( wxBRUSHSTYLE_SOLID ); wxColour clr; - if ( grid.IsEnabled() ) + if ( grid.IsThisEnabled() ) { if ( isSelected ) { @@ -392,7 +392,7 @@ void wxGridCellStringRenderer::SetTextColoursAndFont(const wxGrid& grid, // TODO some special colours for attr.IsReadOnly() case? // different coloured text when the grid is disabled - if ( grid.IsEnabled() ) + if ( grid.IsThisEnabled() ) { if ( isSelected ) { @@ -743,11 +743,6 @@ void wxGridCellFloatRenderer::SetParameters(const wxString& params) wxSize wxGridCellBoolRenderer::ms_sizeCheckMark; -// FIXME these checkbox size calculations are really ugly... - -// between checkmark and box -static const wxCoord wxGRID_CHECKMARK_MARGIN = 2; - wxSize wxGridCellBoolRenderer::GetBestSize(wxGrid& grid, wxGridCellAttr& WXUNUSED(attr), wxDC& WXUNUSED(dc), @@ -757,18 +752,7 @@ wxSize wxGridCellBoolRenderer::GetBestSize(wxGrid& grid, // compute it only once (no locks for MT safeness in GUI thread...) if ( !ms_sizeCheckMark.x ) { - // get checkbox size - wxCheckBox *checkbox = new wxCheckBox(&grid, wxID_ANY, wxEmptyString); - wxSize size = checkbox->GetBestSize(); - wxCoord checkSize = size.y + 2 * wxGRID_CHECKMARK_MARGIN; - -#if defined(__WXMOTIF__) - checkSize -= size.y / 2; -#endif - - delete checkbox; - - ms_sizeCheckMark.x = ms_sizeCheckMark.y = checkSize; + ms_sizeCheckMark = wxRendererNative::Get().GetCheckBoxSize(&grid); } return ms_sizeCheckMark;