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 Kern Sibbald and John Walker
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 as published by the Free Software Foundation; either version 2
16 of the License, or (at your option) any later version.
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 GNU General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #include "wx/wxprec.h"
37 #include <wx/treectrl.h>
39 BEGIN_DECLARE_EVENT_TYPES()
40 DECLARE_LOCAL_EVENT_TYPE(wxbTREE_MARKED_EVENT, 618)
41 END_DECLARE_EVENT_TYPES()
43 /* Customized tree event, used for marking events */
44 class wxbTreeMarkedEvent: public wxEvent {
46 wxbTreeMarkedEvent(int id, wxTreeItemId& item);
47 ~wxbTreeMarkedEvent();
48 wxbTreeMarkedEvent(const wxbTreeMarkedEvent& te);
49 virtual wxEvent *Clone() const;
51 wxTreeItemId GetItem();
56 typedef void (wxEvtHandler::*wxTreeMarkedEventFunction)(wxbTreeMarkedEvent&);
58 #define EVT_TREE_MARKED_EVENT(id, fn) \
59 DECLARE_EVENT_TABLE_ENTRY( \
60 wxbTREE_MARKED_EVENT, id, wxID_ANY, \
61 (wxObjectEventFunction)(wxEventFunction)(wxTreeMarkedEventFunction)&fn, \
65 /* Customized tree, which transmit double clicks on images */
66 class wxbTreeCtrl: public wxTreeCtrl {
68 wxbTreeCtrl(wxWindow* parent, wxEvtHandler* handler, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
72 void OnDoubleClicked(wxMouseEvent& event);
73 void OnRightClicked(wxMouseEvent& event);
75 wxEvtHandler* handler;
77 DECLARE_EVENT_TABLE();
80 #endif // WXBTREECTRL_H