]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: treebase.cpp | |
3 | // Purpose: Base wxTreeCtrl classes | |
4 | // Author: Julian Smart | |
5 | // Created: 01/02/97 | |
6 | // Modified: | |
7 | // Id: $Id$ | |
8 | // Copyright: (c) 1998 Robert Roebling, Julian Smart et al | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | // ============================================================================= | |
13 | // declarations | |
14 | // ============================================================================= | |
15 | ||
16 | // ----------------------------------------------------------------------------- | |
17 | // headers | |
18 | // ----------------------------------------------------------------------------- | |
19 | ||
20 | // For compilers that support precompilation, includes "wx.h". | |
21 | #include "wx/wxprec.h" | |
22 | ||
23 | #ifdef __BORLANDC__ | |
24 | #pragma hdrstop | |
25 | #endif | |
26 | ||
27 | #if wxUSE_TREECTRL | |
28 | ||
29 | #include "wx/treebase.h" | |
30 | #include "wx/settings.h" | |
31 | #include "wx/log.h" | |
32 | #include "wx/intl.h" | |
33 | #include "wx/dynarray.h" | |
34 | #include "wx/arrimpl.cpp" | |
35 | #include "wx/dcclient.h" | |
36 | ||
37 | ||
38 | // ---------------------------------------------------------------------------- | |
39 | // events | |
40 | // ---------------------------------------------------------------------------- | |
41 | ||
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) | |
63 | ||
64 | // ---------------------------------------------------------------------------- | |
65 | // Tree event | |
66 | // ---------------------------------------------------------------------------- | |
67 | ||
68 | IMPLEMENT_DYNAMIC_CLASS(wxTreeEvent, wxNotifyEvent) | |
69 | ||
70 | ||
71 | wxTreeEvent::wxTreeEvent(wxEventType commandType, int id) | |
72 | : wxNotifyEvent(commandType, id) | |
73 | { | |
74 | m_itemOld = 0l; | |
75 | m_editCancelled = false; | |
76 | } | |
77 | ||
78 | wxTreeEvent::wxTreeEvent(const wxTreeEvent & event) | |
79 | : wxNotifyEvent(event) | |
80 | { | |
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; | |
87 | } | |
88 | ||
89 | #endif // wxUSE_TREECTRL | |
90 |