Do not modify selection if right-click is on a selected item [patch 1111174]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31613 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3176,8 +3176,14 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
|
|||||||
if (item == NULL) return; /* we hit the blank area */
|
if (item == NULL) return; /* we hit the blank area */
|
||||||
|
|
||||||
if ( event.RightDown() )
|
if ( event.RightDown() )
|
||||||
|
{
|
||||||
|
// If the item is already selected, do not update the selection.
|
||||||
|
// Multi-selections should not be cleared if a selected item is clicked.
|
||||||
|
if (!IsSelected(item))
|
||||||
{
|
{
|
||||||
DoSelectItem(item, true, false);
|
DoSelectItem(item, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, GetId());
|
wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, GetId());
|
||||||
nevent.m_item = item;
|
nevent.m_item = item;
|
||||||
nevent.m_pointDrag = CalcScrolledPosition(pt);
|
nevent.m_pointDrag = CalcScrolledPosition(pt);
|
||||||
|
Reference in New Issue
Block a user