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 Bacula® - The Network Backup Solution
13 Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
15 The main author of Bacula is Kern Sibbald, with contributions from
16 many others, a complete list can be found in the file AUTHORS.
17 This program is Free Software; you can redistribute it and/or
18 modify it under the terms of version three of the GNU Affero General Public
19 License as published by the Free Software Foundation and included
22 This program is distributed in the hope that it will be useful, but
23 WITHOUT ANY WARRANTY; without even the implied warranty of
24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 General Public License for more details.
27 You should have received a copy of the GNU Affero General Public License
28 along with this program; if not, write to the Free Software
29 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
32 Bacula® is a registered trademark of Kern Sibbald.
33 The licensor of Bacula is the Free Software Foundation Europe
34 (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
35 Switzerland, email:ftf@fsfeurope.org.
41 #include "wx/wxprec.h"
47 #include <wx/treectrl.h>
49 BEGIN_DECLARE_EVENT_TYPES()
50 DECLARE_LOCAL_EVENT_TYPE(wxbTREE_MARKED_EVENT, 618)
51 END_DECLARE_EVENT_TYPES()
53 /* Customized tree event, used for marking events */
54 class wxbTreeMarkedEvent: public wxEvent {
56 wxbTreeMarkedEvent(int id, wxTreeItemId& item);
57 ~wxbTreeMarkedEvent();
58 wxbTreeMarkedEvent(const wxbTreeMarkedEvent& te);
59 virtual wxEvent *Clone() const;
61 wxTreeItemId GetItem();
66 typedef void (wxEvtHandler::*wxTreeMarkedEventFunction)(wxbTreeMarkedEvent&);
68 #define EVT_TREE_MARKED_EVENT(id, fn) \
69 DECLARE_EVENT_TABLE_ENTRY( \
70 wxbTREE_MARKED_EVENT, id, wxID_ANY, \
71 (wxObjectEventFunction)(wxEventFunction)(wxTreeMarkedEventFunction)&fn, \
75 /* Customized tree, which transmit double clicks on images */
76 class wxbTreeCtrl: public wxTreeCtrl {
78 wxbTreeCtrl(wxWindow* parent, wxEvtHandler* handler, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
82 void OnDoubleClicked(wxMouseEvent& event);
83 void OnRightClicked(wxMouseEvent& event);
85 wxEvtHandler* handler;
87 DECLARE_EVENT_TABLE();
90 #endif // WXBTREECTRL_H