Always draw standard-sized checkboxes in generic wxDataViewToggleRenderer.

The checkbox should be always shown in its normal size, otherwise it looks
strange. And this also fixes the overflow of the checkbox in the next column
which happened if the size passed to Render() had negative width before.

See #11558.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2009-12-19 11:17:32 +00:00
parent c3fe02e952
commit 68d7680d0f

View File

@ -800,6 +800,12 @@ bool wxDataViewToggleRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state
if (GetMode() != wxDATAVIEW_CELL_ACTIVATABLE)
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());
wxRendererNative::Get().DrawCheckBox(
GetOwner()->GetOwner(),
*dc,