Minor formatting fixes to recently changed wxListCtrl code

No real changes.
This commit is contained in:
Vadim Zeitlin
2017-12-18 16:58:59 +01:00
parent 8285be78f6
commit aa7c99b275

View File

@@ -3107,18 +3107,17 @@ void wxListCtrl::OnPaint(wxPaintEvent& event)
} }
/* /*
The drawing can be clipped horizontally to the rightmost column. This The drawing can be clipped horizontally to the rightmost column.
happens when an item is added (and visible) and results in a This happens when an item is added (and visible) and results in a
horizontal rule being clipped instead of drawn across the entire list horizontal rule being clipped instead of drawn across the entire
control. In that case we request for the part to the right of the list control. In that case we request for the part to the right of
rightmost column to be drawn as well. the rightmost column to be drawn as well.
*/ */
if ( clipRect.GetRight() != clientSize.GetWidth() - 1 if ( clipRect.GetRight() != clientSize.x - 1 && clipRect.width )
&& clipRect.width)
{ {
RefreshRect(wxRect(clipRect.GetRight(), clipRect.y, RefreshRect(wxRect(clipRect.GetRight(), clipRect.y,
clientSize.x - clipRect.width, clipRect.height), clientSize.x - clipRect.width, clipRect.height),
false /* erase background? */); false /* don't erase background */);
} }
} }
@@ -3130,25 +3129,25 @@ void wxListCtrl::OnPaint(wxPaintEvent& event)
if (GetItemRect(bottom, bottomItemRect)) if (GetItemRect(bottom, bottomItemRect))
{ {
/* /*
This is a fix for ticket #747: erase the pixels which we would This is a fix for ticket #747: erase the pixels which we would
otherwise leave on the screen. otherwise leave on the screen.
The drawing of the rectangle as a fix to erase trailing pixels The drawing of the rectangle as a fix to erase trailing pixels
when resizing a column is only needed for ComCtl32 prior to when resizing a column is only needed for ComCtl32 prior to
6.0, i.e. when not using a manifest in which case 5.82 is 6.0, i.e. when not using a manifest in which case 5.82 is used.
used. And even then it only happens when "Show window contents And even then it only happens when "Show window contents while
while dragging" is enabled under Windows, resulting in live dragging" is enabled under Windows, resulting in live updates
updates when resizing columns. Note that even with that setting when resizing columns. Note that even with that setting on, at
on, at least under Windows 7 and 10 no live updating is done when least under Windows 7 and 10 no live updating is done when
using ComCtl32 5.82. using ComCtl32 5.82.
Revision b66c3a67519caa9debfd76e6d74954eaebfa56d9 made this fix Revision b66c3a67519caa9debfd76e6d74954eaebfa56d9 made this fix
almost redundant, except that when you do NOT handle almost redundant, except that when you do NOT handle
EVT_LIST_COL_DRAGGING (or do and skip the event) the trailing EVT_LIST_COL_DRAGGING (or do and skip the event) the trailing
pixels still appear. In case of wanting to reproduce the problem pixels still appear. In case of wanting to reproduce the
in the listctrl sample: comment out handling oF problem in the listctrl sample: comment out handling oF
EVT_LIST_COL_DRAGGING and also set useDrawFix to false and gap to EVT_LIST_COL_DRAGGING and also set useDrawFix to false and gap
2 (not 0). to 2 (not 0).
*/ */
static const bool useDrawFix = wxApp::GetComCtl32Version() < 600; static const bool useDrawFix = wxApp::GetComCtl32Version() < 600;