3 * Custom list control, which send "list marked" events when the user right-
4 * click on a item, or double-click on a mark.
6 * Nicolas Boichat, April 2004
11 Copyright (C) 2004-2006 Kern Sibbald
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.
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.
28 #include "wx/wxprec.h"
34 #include <wx/listctrl.h>
36 BEGIN_DECLARE_EVENT_TYPES()
37 DECLARE_LOCAL_EVENT_TYPE(wxbLIST_MARKED_EVENT, 1)
38 END_DECLARE_EVENT_TYPES()
40 /* Customized list event, used for marking events */
41 class wxbListMarkedEvent: public wxEvent {
43 wxbListMarkedEvent(int id);
44 ~wxbListMarkedEvent();
45 wxbListMarkedEvent(const wxbListMarkedEvent& te);
46 virtual wxEvent *Clone() const;
50 typedef void (wxEvtHandler::*wxListMarkedEventFunction)(wxbListMarkedEvent&);
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, \
59 /* Customized list, which transmit double clicks on images */
60 class wxbListCtrl: public wxListCtrl {
62 wxbListCtrl(wxWindow* parent, wxEvtHandler* handler, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
66 void OnDoubleClicked(wxMouseEvent& event);
67 void OnRightClicked(wxMouseEvent& event);
69 wxEvtHandler* handler;
71 DECLARE_EVENT_TABLE();
74 #endif // WXBTREECTRL_H