]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/wx-console/wxbtreectrl.h
Tweak fix MySQL quoting again :-(
[bacula/bacula] / bacula / src / wx-console / wxbtreectrl.h
1 /*
2  *
3  *   Custom tree control, which send "tree marked" events when the user right-
4  *   click on a item, or double-click on a mark.
5  *
6  *    Nicolas Boichat, April 2004
7  *
8  *    Version $Id$
9  */
10 /*
11    Bacula® - The Network Backup Solution
12
13    Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
14
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
20    in the file LICENSE.
21
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.
26
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
30    02110-1301, USA.
31
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.
36 */
37
38 #ifndef WXBTREECTRL_H
39 #define WXBTREECTRL_H
40
41 #include "wx/wxprec.h"
42
43 #ifndef WX_PRECOMP
44    #include "wx/wx.h"
45 #endif
46
47 #include <wx/treectrl.h>
48
49 BEGIN_DECLARE_EVENT_TYPES()
50    DECLARE_LOCAL_EVENT_TYPE(wxbTREE_MARKED_EVENT,       618)
51 END_DECLARE_EVENT_TYPES()
52
53 /* Customized tree event, used for marking events */
54 class wxbTreeMarkedEvent: public wxEvent {
55    public:
56       wxbTreeMarkedEvent(int id, wxTreeItemId& item);
57       ~wxbTreeMarkedEvent();
58       wxbTreeMarkedEvent(const wxbTreeMarkedEvent& te);
59       virtual wxEvent *Clone() const;
60
61       wxTreeItemId GetItem();
62    private:
63       wxTreeItemId item;
64 };
65
66 typedef void (wxEvtHandler::*wxTreeMarkedEventFunction)(wxbTreeMarkedEvent&);
67
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, \
72         (wxObject *) NULL \
73     ),
74
75 /* Customized tree, which transmit double clicks on images */
76 class wxbTreeCtrl: public wxTreeCtrl {
77    public:
78       wxbTreeCtrl(wxWindow* parent, wxEvtHandler* handler, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
79       ~wxbTreeCtrl();
80
81    private:
82       void OnDoubleClicked(wxMouseEvent& event);
83       void OnRightClicked(wxMouseEvent& event);
84
85       wxEvtHandler* handler;
86
87       DECLARE_EVENT_TABLE();
88 };
89
90 #endif // WXBTREECTRL_H