Added right/middle click item support
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3962 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1901,7 +1901,7 @@ void wxTreeCtrl::OnRenameAccept()
|
|||||||
|
|
||||||
void wxTreeCtrl::OnMouse( wxMouseEvent &event )
|
void wxTreeCtrl::OnMouse( wxMouseEvent &event )
|
||||||
{
|
{
|
||||||
if ( !(event.LeftUp() || event.LeftDClick() || event.Dragging()) ) return;
|
if ( !(event.LeftUp() || event.RightDown() || event.LeftDClick() || event.Dragging()) ) return;
|
||||||
|
|
||||||
if ( !m_anchor ) return;
|
if ( !m_anchor ) return;
|
||||||
|
|
||||||
@@ -1939,6 +1939,15 @@ void wxTreeCtrl::OnMouse( wxMouseEvent &event )
|
|||||||
|
|
||||||
if (item == NULL) return; /* we hit the blank area */
|
if (item == NULL) return; /* we hit the blank area */
|
||||||
|
|
||||||
|
if (event.RightDown()) {
|
||||||
|
wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK,GetId());
|
||||||
|
nevent.m_item=item;
|
||||||
|
nevent.m_code=0;
|
||||||
|
nevent.SetEventObject(this);
|
||||||
|
GetEventHandler()->ProcessEvent(nevent);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (event.LeftUp() && (item == m_current) &&
|
if (event.LeftUp() && (item == m_current) &&
|
||||||
(flags & wxTREE_HITTEST_ONITEMLABEL) &&
|
(flags & wxTREE_HITTEST_ONITEMLABEL) &&
|
||||||
HasFlag(wxTR_EDIT_LABELS) )
|
HasFlag(wxTR_EDIT_LABELS) )
|
||||||
|
Reference in New Issue
Block a user