]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/wx-console/wxbtreectrl.h
Removed unused local variable.
[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  */
9 /*
10    Copyright (C) 2004 Kern Sibbald and John Walker
11
12    This program is free software; you can redistribute it and/or
13    modify it under the terms of the GNU General Public License
14    as published by the Free Software Foundation; either version 2
15    of the License, or (at your option) any later version.
16
17    This program is distributed in the hope that it will be useful,
18    but WITHOUT ANY WARRANTY; without even the implied warranty of
19    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20    GNU General Public License for more details.
21
22    You should have received a copy of the GNU General Public License
23    along with this program; if not, write to the Free Software
24    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25  */
26
27 #ifndef WXBTREECTRL_H
28 #define WXBTREECTRL_H
29
30 #include "wx/wxprec.h"
31
32 #ifndef WX_PRECOMP
33    #include "wx/wx.h"
34 #endif
35
36 #include <wx/treectrl.h>
37
38 BEGIN_DECLARE_EVENT_TYPES()
39    DECLARE_LOCAL_EVENT_TYPE(wxbTREE_MARKED_EVENT,       1)
40 END_DECLARE_EVENT_TYPES()
41
42 /* Customized tree event, used for marking events */
43 class wxbTreeMarkedEvent: public wxEvent {
44    public:
45       wxbTreeMarkedEvent(int id, wxTreeItemId& item);
46       ~wxbTreeMarkedEvent();
47       wxbTreeMarkedEvent(const wxbTreeMarkedEvent& te);
48       virtual wxEvent *Clone() const;
49       
50       wxTreeItemId GetItem();
51    private:
52       wxTreeItemId item;
53 };
54
55 typedef void (wxEvtHandler::*wxTreeMarkedEventFunction)(wxbTreeMarkedEvent&);
56
57 #define EVT_TREE_MARKED_EVENT(id, fn) \
58     DECLARE_EVENT_TABLE_ENTRY( \
59         wxbTREE_MARKED_EVENT, id, wxID_ANY, \
60         (wxObjectEventFunction)(wxEventFunction)(wxTreeMarkedEventFunction)&fn, \
61         (wxObject *) NULL \
62     ),
63
64 /* Customized tree, which transmit double clicks on images */
65 class wxbTreeCtrl: public wxTreeCtrl {
66    public:
67       wxbTreeCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
68       ~wxbTreeCtrl();
69       
70    private:
71       void OnDoubleClicked(wxMouseEvent& event);
72       void OnRightClicked(wxMouseEvent& event);
73       
74       DECLARE_EVENT_TABLE();
75 };
76
77 #endif // WXBTREECTRL_H
78