r62940 fixed an appearance problem with the checkboxes in wxDataViewCtrl but
introduced another one: as the checkbox was now always drawn in the entire
cell rectangle, the cell alignment was not taken into account any more.
Fix this by only increasing the checkbox rectangle up to the required minimal
size but not any more.
Closes #14504.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72294
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
GetEnabled() == false)
flags |= wxCONTROL_DISABLED;
- // check boxes we draw must always have the same, standard size (if it's
- // bigger than the cell size the checkbox will be truncated because the
- // caller had set the clipping rectangle to prevent us from drawing outside
- // the cell)
- cell.SetSize(GetSize());
+ // Ensure that the check boxes always have at least the minimal required
+ // size, otherwise DrawCheckBox() doesn't really work well. If this size is
+ // greater than the cell size, the checkbox will be truncated but this is a
+ // lesser evil.
+ wxSize size = cell.GetSize();
+ size.IncTo(GetSize());
+ cell.SetSize(size);
wxRendererNative::Get().DrawCheckBox(
GetOwner()->GetOwner(),