3 * Custom tree control, which send "tree marked" events when the user right-
4 * click on a item, or double-click on a mark.
6 * Nicolas Boichat, April 2004
11 Copyright (C) 2004-2006 Kern Sibbald
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License
15 version 2 as amended with additional clauses defined in the
16 file LICENSE in the main source directory.
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 the file LICENSE for additional details.
28 #include "wx/wxprec.h"
34 #include <wx/treectrl.h>
36 BEGIN_DECLARE_EVENT_TYPES()
37 DECLARE_LOCAL_EVENT_TYPE(wxbTREE_MARKED_EVENT, 618)
38 END_DECLARE_EVENT_TYPES()
40 /* Customized tree event, used for marking events */
41 class wxbTreeMarkedEvent: public wxEvent {
43 wxbTreeMarkedEvent(int id, wxTreeItemId& item);
44 ~wxbTreeMarkedEvent();
45 wxbTreeMarkedEvent(const wxbTreeMarkedEvent& te);
46 virtual wxEvent *Clone() const;
48 wxTreeItemId GetItem();
53 typedef void (wxEvtHandler::*wxTreeMarkedEventFunction)(wxbTreeMarkedEvent&);
55 #define EVT_TREE_MARKED_EVENT(id, fn) \
56 DECLARE_EVENT_TABLE_ENTRY( \
57 wxbTREE_MARKED_EVENT, id, wxID_ANY, \
58 (wxObjectEventFunction)(wxEventFunction)(wxTreeMarkedEventFunction)&fn, \
62 /* Customized tree, which transmit double clicks on images */
63 class wxbTreeCtrl: public wxTreeCtrl {
65 wxbTreeCtrl(wxWindow* parent, wxEvtHandler* handler, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
69 void OnDoubleClicked(wxMouseEvent& event);
70 void OnRightClicked(wxMouseEvent& event);
72 wxEvtHandler* handler;
74 DECLARE_EVENT_TABLE();
77 #endif // WXBTREECTRL_H