]> git.saurik.com Git - wxWidgets.git/commitdiff
Always draw standard-sized checkboxes in generic wxDataViewToggleRenderer.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 19 Dec 2009 11:17:32 +0000 (11:17 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 19 Dec 2009 11:17:32 +0000 (11:17 +0000)
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

src/generic/datavgen.cpp

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