added a wxTreeEvent ctor taking the associated wxTreeCtrl and optional wxTreeItemId; this reduces code duplication and also allows us to easily ensure that client data pointer is set properly for all events (it was never initialized before) (replaces patch 1503531)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39852 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-06-27 14:58:46 +00:00
parent bf85ddfc8a
commit 09f277d683
3 changed files with 48 additions and 87 deletions

View File

@@ -59,14 +59,21 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_MENU)
// Tree event
// ----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxTreeEvent, wxNotifyEvent)
IMPLEMENT_ABSTRACT_CLASS(wxTreeEvent, wxNotifyEvent)
wxTreeEvent::wxTreeEvent(wxEventType commandType, int id)
: wxNotifyEvent(commandType, id)
wxTreeEvent::wxTreeEvent(wxEventType commandType,
wxTreeCtrlBase *tree,
const wxTreeItemId& item)
: wxNotifyEvent(commandType, tree->GetId()),
m_item(item)
{
m_itemOld = 0l;
m_editCancelled = false;
SetEventObject(tree);
if ( item.IsOk() )
SetClientObject(tree->GetItemData(item));
}
wxTreeEvent::wxTreeEvent(const wxTreeEvent & event)