From 3bb918c0974fae6a4e68da6b553440911a3948fa Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 24 Sep 2006 11:13:17 +0000 Subject: [PATCH] Added test to reproduce [ 1541148 ] wxTreeCtrol: crash if right mouse click The MSW tree control sends a series of invalid events. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/treectrl/treetest.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index 722f5f4bdf..1357cfd5f6 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -895,7 +895,12 @@ void MyTreeCtrl::DoToggleIcon(const wxTreeItemId& item) #define TREE_EVENT_HANDLER(name) \ void MyTreeCtrl::name(wxTreeEvent& event) \ { \ - wxLogMessage(wxT(#name)); \ + wxLogMessage( wxT("%s from:"), wxT(#name) ); \ + wxTreeItemId item = event.GetItem(); \ + if (item.IsOk()) \ + wxLogMessage( GetItemText(item) ); \ + else \ + wxLogMessage(wxT("invalid item")); \ SetLastItem(wxTreeItemId()); \ event.Skip(); \ }