Allow ignoring margins in wxRendererNative::GetCheckBoxSize()

Add ability to get the size of the checkbox without any margins by
passing wxCONTROL_CELL flag: this can be useful when the checkbox is
part of some "cell", e.g. wxGrid one, and doesn't need any extra margins
around it.

Currently wxCONTROL_CELL is only really used by wxGTK2 implementation.
This commit is contained in:
Ilya Sinitsyn
2019-11-07 01:13:32 +07:00
committed by Vadim Zeitlin
parent 5ad2470504
commit 53ffbf6cf5
6 changed files with 55 additions and 22 deletions

View File

@@ -111,7 +111,7 @@ public:
const wxRect& rect,
int flags = 0) wxOVERRIDE;
virtual wxSize GetCheckBoxSize(wxWindow *win) wxOVERRIDE;
virtual wxSize GetCheckBoxSize(wxWindow *win, int flags = 0) wxOVERRIDE;
virtual wxSize GetCheckMarkSize(wxWindow *win) wxOVERRIDE;
@@ -731,7 +731,7 @@ wxRendererGeneric::DrawCheckMark(wxWindow *WXUNUSED(win),
dc.DrawCheckMark(rect);
}
wxSize wxRendererGeneric::GetCheckBoxSize(wxWindow *win)
wxSize wxRendererGeneric::GetCheckBoxSize(wxWindow *win, int WXUNUSED(flags))
{
wxCHECK_MSG( win, wxSize(0, 0), "Must have a valid window" );
@@ -740,7 +740,7 @@ wxSize wxRendererGeneric::GetCheckBoxSize(wxWindow *win)
wxSize wxRendererGeneric::GetCheckMarkSize(wxWindow *win)
{
return GetCheckBoxSize(win);
return GetCheckBoxSize(win, wxCONTROL_CELL);
}
wxSize wxRendererGeneric::GetExpanderSize(wxWindow *win)