37 const wxRect& cellRect,
43 const wxCoord
minSize = wxMin(cellRect.width, cellRect.height);
50 contentSize.y = fittingSize;
53 wxRect contentRect(contentSize);
55 if ( hAlign & wxALIGN_CENTER_HORIZONTAL )
57 contentRect = contentRect.CentreIn(cellRect, wxHORIZONTAL);
59 else if ( hAlign & wxALIGN_RIGHT )
61 contentRect.SetX(cellRect.x + cellRect.width
69 if ( vAlign & wxALIGN_CENTER_VERTICAL )
71 contentRect = contentRect.CentreIn(cellRect, wxVERTICAL);
73 else if ( vAlign & wxALIGN_BOTTOM )
75 contentRect.SetY(cellRect.y + cellRect.height
98 wxGridCellRenderer::Draw(
grid, attr, dc, rect, row, col, isSelected);
100 int hAlign = wxALIGN_LEFT;
101 int vAlign = wxALIGN_CENTRE_VERTICAL;
102 attr.GetNonDefaultAlignment(&hAlign, &vAlign);
104 const wxRect checkBoxRect =
106 rect, hAlign, vAlign);
109 if (
grid.GetTable()->CanGetValueAs(row, col, wxGRID_VALUE_BOOL) )
111 value =
grid.GetTable()->GetValueAsBool(row, col);
115 wxString cellval(
grid.GetTable()->GetValue(row, col) );
116 value = wxGridCellBoolEditor::IsTrueValue(cellval);
119 int flags = wxCONTROL_CELL;
122 flags |= wxCONTROL_UNDETERMINED;
126 flags |= wxCONTROL_CHECKED;
128 wxRendererNative::Get().DrawCheckBox( &
grid, dc, checkBoxRect, flags );
void Draw(wxGrid &grid, wxGridCellAttr &attr, wxDC &dc, const wxRect &rect, int row, int col, bool isSelected) override