]> git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/gizmos/editlbox.h
added new gizmo: wxEditableListBox
[wxWidgets.git] / contrib / include / wx / gizmos / editlbox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: editlbox.h
3 // Purpose: ListBox with editable items
4 // Author: Vaclav Slavik
5 // RCS-ID: $Id$
6 // Copyright: (c) Vaclav Slavik
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10
11 #ifndef __WX_EDITLBOX_H__
12 #define __WX_EDITLBOX_H__
13
14 #ifdef __GNUG__
15 #pragma interface "editlbox.h"
16 #endif
17
18 #include "wx/panel.h"
19
20
21 class WXDLLEXPORT wxBitmapButton;
22 class WXDLLEXPORT wxListCtrl;
23 class WXDLLEXPORT wxListEvent;
24
25 // This class provides a composite control that lets the
26 // user easily enter list of strings
27
28 class WXDLLEXPORT wxEditableListBox : public wxPanel
29 {
30 DECLARE_CLASS(wxEditableListBox);
31
32 public:
33 wxEditableListBox(wxWindow *parent, wxWindowID id,
34 const wxString& label,
35 const wxPoint& pos = wxDefaultPosition,
36 const wxSize& size = wxDefaultSize);
37
38 void SetStrings(const wxArrayString& strings);
39 void GetStrings(wxArrayString& strings);
40
41 protected:
42 wxBitmapButton *m_bDel, *m_bNew, *m_bUp, *m_bDown, *m_bEdit;
43 wxListCtrl *m_listCtrl;
44 int m_selection;
45 bool m_edittingNew;
46
47 void OnItemSelected(wxListEvent& event);
48 void OnEndLabelEdit(wxListEvent& event);
49 void OnNewItem(wxCommandEvent& event);
50 void OnDelItem(wxCommandEvent& event);
51 void OnEditItem(wxCommandEvent& event);
52 void OnUpItem(wxCommandEvent& event);
53 void OnDownItem(wxCommandEvent& event);
54
55 DECLARE_EVENT_TABLE()
56 };
57
58 #endif