From: Vadim Zeitlin Date: Thu, 1 Nov 2007 00:09:13 +0000 (+0000) Subject: also assert in generic GetSelection() if the control is in multiselection mode, for... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d1f7240a09844a821b256809b2dbe319e85745ff?ds=inline also assert in generic GetSelection() if the control is in multiselection mode, for consistency with wxMSW and other controls git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/generic/treectlg.h b/include/wx/generic/treectlg.h index 67d13c69db..f57802cf70 100644 --- a/include/wx/generic/treectlg.h +++ b/include/wx/generic/treectlg.h @@ -112,7 +112,13 @@ public: // ---------- virtual wxTreeItemId GetRootItem() const { return m_anchor; } - virtual wxTreeItemId GetSelection() const { return m_current; } + virtual wxTreeItemId GetSelection() const + { + wxASSERT_MSG( !HasFlag(wxTR_MULTIPLE), + wxT("must use GetSelections() with this control") ); + + return m_current; + } virtual size_t GetSelections(wxArrayTreeItemIds&) const; virtual wxTreeItemId GetItemParent(const wxTreeItemId& item) const;