From 91e5a8de8663f386778c270b78cd49eb44df57ac Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 24 Oct 2015 23:50:47 +0200 Subject: [PATCH] Document that wxListCtrl::SetItemState() sends events This is an exception to the usual rule, so should be documented, do it for both this method itself and wxListView::Select() using it. --- interface/wx/listctrl.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/interface/wx/listctrl.h b/interface/wx/listctrl.h index 34d4a17449..93a46c3e6d 100644 --- a/interface/wx/listctrl.h +++ b/interface/wx/listctrl.h @@ -1148,6 +1148,10 @@ public: Consider using wxListView if possible to avoid dealing with this error-prone and confusing method. + + Also notice that contrary to the usual rule that only user actions + generate events, this method does generate wxEVT_LIST_ITEM_SELECTED + event when it is used to select an item. */ bool SetItemState(long item, long state, long stateMask); @@ -1631,12 +1635,15 @@ public: /** Selects or unselects the given item. + Notice that this method inherits the unusual behaviour of + wxListCtrl::SetItemState() which sends a wxEVT_LIST_ITEM_SELECTED event + when it is used to select an item, contrary to the usual rule that only + the user actions result in selection. + @param n the item to select or unselect @param on if @true (default), selects the item, otherwise unselects it - - @see wxListCtrl::SetItemState */ void Select(long n, bool on = true);