]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/wx-console/wxblistctrl.h
This commit was manufactured by cvs2svn to create tag
[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    Copyright (C) 2004 Kern Sibbald and John Walker
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    as published by the Free Software Foundation; either version 2
16    of the License, or (at your option) any later version.
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    GNU General Public License for more details.
22
23    You should have received a copy of the GNU General Public License
24    along with this program; if not, write to the Free Software
25    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
26  */
27
28 #ifndef WXBLISTCTRL_H
29 #define WXBLISTCTRL_H
30
31 #include "wx/wxprec.h"
32
33 #ifndef WX_PRECOMP
34    #include "wx/wx.h"
35 #endif
36
37 #include <wx/listctrl.h>
38
39 BEGIN_DECLARE_EVENT_TYPES()
40    DECLARE_LOCAL_EVENT_TYPE(wxbLIST_MARKED_EVENT,       1)
41 END_DECLARE_EVENT_TYPES()
42
43 /* Customized list event, used for marking events */
44 class wxbListMarkedEvent: public wxEvent {
45    public:
46       wxbListMarkedEvent(int id);
47       ~wxbListMarkedEvent();
48       wxbListMarkedEvent(const wxbListMarkedEvent& te);
49       virtual wxEvent *Clone() const;
50
51 };
52
53 typedef void (wxEvtHandler::*wxListMarkedEventFunction)(wxbListMarkedEvent&);
54
55 #define EVT_LIST_MARKED_EVENT(id, fn) \
56     DECLARE_EVENT_TABLE_ENTRY( \
57         wxbLIST_MARKED_EVENT, id, wxID_ANY, \
58         (wxObjectEventFunction)(wxEventFunction)(wxListMarkedEventFunction)&fn, \
59         (wxObject *) NULL \
60     ),
61
62 /* Customized list, which transmit double clicks on images */
63 class wxbListCtrl: public wxListCtrl {
64    public:
65       wxbListCtrl(wxWindow* parent, wxEvtHandler* handler, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
66       ~wxbListCtrl();
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