Determine the checkbox size in wxGetGridCheckBoxRect() itself

It doesn't make much sense to pass the size to the function supposed to
compute it, so call wxRendererNative::GetCheckBoxSize() from the
function itself instead of forcing its callers to do it.

No real changes.
This commit is contained in:
Vadim Zeitlin
2019-11-22 01:07:20 +01:00
parent f4756eaa2f
commit 851d11ba2c
4 changed files with 23 additions and 23 deletions

View File

@@ -10332,13 +10332,17 @@ wxGridCellEditor* wxGridTypeRegistry::GetEditor(int index)
return editor;
}
wxRect wxGetGridCheckBoxRect(const wxSize& checkBoxSize,
wxRect wxGetGridCheckBoxRect(wxWindow* win,
const wxRect& cellRect,
int hAlign, int WXUNUSED(vAlign))
int hAlign,
int WXUNUSED(vAlign))
{
// TODO: support vAlign
const wxSize checkBoxSize =
wxRendererNative::Get().GetCheckBoxSize(win, wxCONTROL_CELL);
wxRect checkBoxRect;
// TODO: support vAlign
checkBoxRect.SetY(cellRect.y + cellRect.height / 2 - checkBoxSize.y / 2);
wxCoord minSize = wxMin(cellRect.width, cellRect.height);