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:
Vadim Zeitlin 2005-04-05 23:03:32 +00:00
parent fbd8ac5236
commit c545c23009
2 changed files with 22 additions and 0 deletions

View File

@ -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)

View File

@ -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,