log right mouse down/up events too
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33362 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
fbd8ac5236
commit
c545c23009
@ -144,6 +144,9 @@ BEGIN_EVENT_TABLE(MyTreeCtrl, wxTreeCtrl)
|
||||
EVT_TREE_SEL_CHANGING(TreeTest_Ctrl, MyTreeCtrl::OnSelChanging)
|
||||
EVT_TREE_KEY_DOWN(TreeTest_Ctrl, MyTreeCtrl::OnTreeKeyDown)
|
||||
EVT_TREE_ITEM_ACTIVATED(TreeTest_Ctrl, MyTreeCtrl::OnItemActivated)
|
||||
|
||||
EVT_RIGHT_DOWN(MyTreeCtrl::OnRMouseDown)
|
||||
EVT_RIGHT_UP(MyTreeCtrl::OnRMouseUp)
|
||||
EVT_RIGHT_DCLICK(MyTreeCtrl::OnRMouseDClick)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
@ -1216,6 +1219,20 @@ void MyTreeCtrl::ShowMenu(wxTreeItemId id, const wxPoint& pt)
|
||||
#endif // wxUSE_MENUS
|
||||
}
|
||||
|
||||
void MyTreeCtrl::OnRMouseDown(wxMouseEvent& event)
|
||||
{
|
||||
wxLogMessage(wxT("Right mouse button down"));
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void MyTreeCtrl::OnRMouseUp(wxMouseEvent& event)
|
||||
{
|
||||
wxLogMessage(wxT("Right mouse button up"));
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void MyTreeCtrl::OnRMouseDClick(wxMouseEvent& event)
|
||||
{
|
||||
wxTreeItemId id = HitTest(event.GetPosition());
|
||||
@ -1227,6 +1244,8 @@ void MyTreeCtrl::OnRMouseDClick(wxMouseEvent& event)
|
||||
if ( item )
|
||||
wxLogMessage(wxT("Item '%s' under mouse"), item->GetDesc());
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
static inline const wxChar *Bool2String(bool b)
|
||||
|
@ -86,6 +86,9 @@ public:
|
||||
void OnSelChanging(wxTreeEvent& event);
|
||||
void OnTreeKeyDown(wxTreeEvent& event);
|
||||
void OnItemActivated(wxTreeEvent& event);
|
||||
|
||||
void OnRMouseDown(wxMouseEvent& event);
|
||||
void OnRMouseUp(wxMouseEvent& event);
|
||||
void OnRMouseDClick(wxMouseEvent& event);
|
||||
|
||||
void GetItemsRecursively(const wxTreeItemId& idParent,
|
||||
|
Loading…
Reference in New Issue
Block a user