1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Base wxTreeCtrl classes
4 // Author: Julian Smart
8 // Copyright: (c) 1998 Robert Roebling, Julian Smart et al
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // =============================================================================
14 // =============================================================================
16 // -----------------------------------------------------------------------------
18 // -----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
29 #include "wx/treebase.h"
30 #include "wx/settings.h"
33 #include "wx/dynarray.h"
34 #include "wx/arrimpl.cpp"
35 #include "wx/dcclient.h"
38 // ----------------------------------------------------------------------------
40 // ----------------------------------------------------------------------------
42 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_BEGIN_DRAG
)
43 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_BEGIN_RDRAG
)
44 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT
)
45 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_END_LABEL_EDIT
)
46 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_DELETE_ITEM
)
47 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_GET_INFO
)
48 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_SET_INFO
)
49 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_EXPANDED
)
50 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_EXPANDING
)
51 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_COLLAPSED
)
52 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_COLLAPSING
)
53 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_SEL_CHANGED
)
54 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_SEL_CHANGING
)
55 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_KEY_DOWN
)
56 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_ACTIVATED
)
57 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK
)
58 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK
)
59 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_END_DRAG
)
60 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK
)
61 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP
)
62 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_MENU
)
64 // ----------------------------------------------------------------------------
66 // ----------------------------------------------------------------------------
68 IMPLEMENT_DYNAMIC_CLASS(wxTreeEvent
, wxNotifyEvent
)
71 wxTreeEvent::wxTreeEvent(wxEventType commandType
, int id
)
72 : wxNotifyEvent(commandType
, id
)
75 m_editCancelled
= false;
78 wxTreeEvent::wxTreeEvent(const wxTreeEvent
& event
)
79 : wxNotifyEvent(event
)
81 m_evtKey
= event
.m_evtKey
;
82 m_item
= event
.m_item
;
83 m_itemOld
= event
.m_itemOld
;
84 m_pointDrag
= event
.m_pointDrag
;
85 m_label
= event
.m_label
;
86 m_editCancelled
= event
.m_editCancelled
;
89 #if WXWIN_COMPATIBILITY_2_2
91 int wxTreeEvent::GetCode() const
93 return m_evtKey
.GetKeyCode();
96 #endif // WXWIN_COMPATIBILITY_2_2
98 #endif // wxUSE_TREECTRL