]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/wx-console/wxbtreectrl.h
Update the Microsoft Visual Studio build to match the MinGW32 build.
[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    Copyright (C) 2004-2006 Kern Sibbald
12
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.
17
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.
22
23  */
24
25 #ifndef WXBTREECTRL_H
26 #define WXBTREECTRL_H
27
28 #include "wx/wxprec.h"
29
30 #ifndef WX_PRECOMP
31    #include "wx/wx.h"
32 #endif
33
34 #include <wx/treectrl.h>
35
36 BEGIN_DECLARE_EVENT_TYPES()
37    DECLARE_LOCAL_EVENT_TYPE(wxbTREE_MARKED_EVENT,       618)
38 END_DECLARE_EVENT_TYPES()
39
40 /* Customized tree event, used for marking events */
41 class wxbTreeMarkedEvent: public wxEvent {
42    public:
43       wxbTreeMarkedEvent(int id, wxTreeItemId& item);
44       ~wxbTreeMarkedEvent();
45       wxbTreeMarkedEvent(const wxbTreeMarkedEvent& te);
46       virtual wxEvent *Clone() const;
47
48       wxTreeItemId GetItem();
49    private:
50       wxTreeItemId item;
51 };
52
53 typedef void (wxEvtHandler::*wxTreeMarkedEventFunction)(wxbTreeMarkedEvent&);
54
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, \
59         (wxObject *) NULL \
60     ),
61
62 /* Customized tree, which transmit double clicks on images */
63 class wxbTreeCtrl: public wxTreeCtrl {
64    public:
65       wxbTreeCtrl(wxWindow* parent, wxEvtHandler* handler, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
66       ~wxbTreeCtrl();
67
68    private:
69       void OnDoubleClicked(wxMouseEvent& event);
70       void OnRightClicked(wxMouseEvent& event);
71
72       wxEvtHandler* handler;
73
74       DECLARE_EVENT_TABLE();
75 };
76
77 #endif // WXBTREECTRL_H