]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/wx-console/wxblistctrl.h
Correct compile error
[bacula/bacula] / bacula / src / wx-console / wxblistctrl.h
1 /*
2  *
3  *   Custom list control, which send "list 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 two of the GNU 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 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 John Walker.
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 WXBLISTCTRL_H
39 #define WXBLISTCTRL_H
40
41 #include "wx/wxprec.h"
42
43 #ifndef WX_PRECOMP
44    #include "wx/wx.h"
45 #endif
46
47 #include <wx/listctrl.h>
48
49 BEGIN_DECLARE_EVENT_TYPES()
50    DECLARE_LOCAL_EVENT_TYPE(wxbLIST_MARKED_EVENT,       1)
51 END_DECLARE_EVENT_TYPES()
52
53 /* Customized list event, used for marking events */
54 class wxbListMarkedEvent: public wxEvent {
55    public:
56       wxbListMarkedEvent(int id);
57       ~wxbListMarkedEvent();
58       wxbListMarkedEvent(const wxbListMarkedEvent& te);
59       virtual wxEvent *Clone() const;
60
61 };
62
63 typedef void (wxEvtHandler::*wxListMarkedEventFunction)(wxbListMarkedEvent&);
64
65 #define EVT_LIST_MARKED_EVENT(id, fn) \
66     DECLARE_EVENT_TABLE_ENTRY( \
67         wxbLIST_MARKED_EVENT, id, wxID_ANY, \
68         (wxObjectEventFunction)(wxEventFunction)(wxListMarkedEventFunction)&fn, \
69         (wxObject *) NULL \
70     ),
71
72 /* Customized list, which transmit double clicks on images */
73 class wxbListCtrl: public wxListCtrl {
74    public:
75       wxbListCtrl(wxWindow* parent, wxEvtHandler* handler, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
76       ~wxbListCtrl();
77
78    private:
79       void OnDoubleClicked(wxMouseEvent& event);
80       void OnRightClicked(wxMouseEvent& event);
81
82       wxEvtHandler* handler;
83
84       DECLARE_EVENT_TABLE();
85 };
86
87 #endif // WXBTREECTRL_H