From: Vadim Zeitlin Date: Mon, 2 Apr 2001 12:25:51 +0000 (+0000) Subject: oops... wrong patch, second try X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0326c494a9b12442a12a4c004dbf44fbda5387bf oops... wrong patch, second try git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9645 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 61d3d2e8ab..0984a23ed2 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -2488,13 +2488,26 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event ) m_lastOnSame = FALSE; } } - else + else // !RightDown() && !LeftUp() ==> LeftDown() || LeftDClick() { if ( event.LeftDown() ) { m_lastOnSame = item == m_current; } + if ( flags & wxTREE_HITTEST_ONITEMBUTTON ) + { + // only toggle the item for a single click, double click on + // the button doesn't do anything (it toggles the item twice) + if ( event.LeftDown() ) + { + Toggle( item ); + } + + // don't select the item if the button was clicked + return; + } + // how should the selection work for this event? bool is_multiple, extended_select, unselect_others; EventFlagsToSelType(GetWindowStyleFlag(),