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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "treebase.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
33 #include "wx/treebase.h"
34 #include "wx/settings.h"
37 #include "wx/dynarray.h"
38 #include "wx/arrimpl.cpp"
39 #include "wx/dcclient.h"
42 // ----------------------------------------------------------------------------
44 // ----------------------------------------------------------------------------
46 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_BEGIN_DRAG
)
47 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_BEGIN_RDRAG
)
48 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT
)
49 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_END_LABEL_EDIT
)
50 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_DELETE_ITEM
)
51 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_GET_INFO
)
52 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_SET_INFO
)
53 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_EXPANDED
)
54 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_EXPANDING
)
55 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_COLLAPSED
)
56 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_COLLAPSING
)
57 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_SEL_CHANGED
)
58 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_SEL_CHANGING
)
59 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_KEY_DOWN
)
60 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_ACTIVATED
)
61 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK
)
62 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK
)
63 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_END_DRAG
)
64 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK
)
65 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP
)
66 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_MENU
)
68 // ----------------------------------------------------------------------------
70 // ----------------------------------------------------------------------------
72 IMPLEMENT_DYNAMIC_CLASS(wxTreeEvent
, wxNotifyEvent
)
75 wxTreeEvent::wxTreeEvent(wxEventType commandType
, int id
)
76 : wxNotifyEvent(commandType
, id
)
79 m_editCancelled
= false;
82 wxTreeEvent::wxTreeEvent(const wxTreeEvent
& event
)
83 : wxNotifyEvent(event
)
85 m_evtKey
= event
.m_evtKey
;
86 m_item
= event
.m_item
;
87 m_itemOld
= event
.m_itemOld
;
88 m_pointDrag
= event
.m_pointDrag
;
89 m_label
= event
.m_label
;
90 m_editCancelled
= event
.m_editCancelled
;
93 #if WXWIN_COMPATIBILITY_2_2
95 int wxTreeEvent::GetCode() const
97 return m_evtKey
.GetKeyCode();
100 #endif // WXWIN_COMPATIBILITY_2_2
102 #endif // wxUSE_TREECTRL