]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/wx-console/wxblistctrl.h
kes wx-console crashes because of differences between Bacula and wxWidgets
[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-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 WXBLISTCTRL_H
26 #define WXBLISTCTRL_H
27
28 #include "wx/wxprec.h"
29
30 #ifndef WX_PRECOMP
31    #include "wx/wx.h"
32 #endif
33
34 #include <wx/listctrl.h>
35
36 BEGIN_DECLARE_EVENT_TYPES()
37    DECLARE_LOCAL_EVENT_TYPE(wxbLIST_MARKED_EVENT,       1)
38 END_DECLARE_EVENT_TYPES()
39
40 /* Customized list event, used for marking events */
41 class wxbListMarkedEvent: public wxEvent {
42    public:
43       wxbListMarkedEvent(int id);
44       ~wxbListMarkedEvent();
45       wxbListMarkedEvent(const wxbListMarkedEvent& te);
46       virtual wxEvent *Clone() const;
47
48 };
49
50 typedef void (wxEvtHandler::*wxListMarkedEventFunction)(wxbListMarkedEvent&);
51
52 #define EVT_LIST_MARKED_EVENT(id, fn) \
53     DECLARE_EVENT_TABLE_ENTRY( \
54         wxbLIST_MARKED_EVENT, id, wxID_ANY, \
55         (wxObjectEventFunction)(wxEventFunction)(wxListMarkedEventFunction)&fn, \
56         (wxObject *) NULL \
57     ),
58
59 /* Customized list, which transmit double clicks on images */
60 class wxbListCtrl: public wxListCtrl {
61    public:
62       wxbListCtrl(wxWindow* parent, wxEvtHandler* handler, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
63       ~wxbListCtrl();
64
65    private:
66       void OnDoubleClicked(wxMouseEvent& event);
67       void OnRightClicked(wxMouseEvent& event);
68
69       wxEvtHandler* handler;
70
71       DECLARE_EVENT_TABLE();
72 };
73
74 #endif // WXBTREECTRL_H