]> git.saurik.com Git - wxWidgets.git/blob - include/wx/editlbox.h
Change SetValue( wxVariant &value ) to
[wxWidgets.git] / include / wx / editlbox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/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 #include "wx/panel.h"
15
16 class WXDLLEXPORT wxBitmapButton;
17 class WXDLLEXPORT wxListCtrl;
18 class WXDLLEXPORT wxListEvent;
19
20 #define wxEL_ALLOW_NEW 0x0100
21 #define wxEL_ALLOW_EDIT 0x0200
22 #define wxEL_ALLOW_DELETE 0x0400
23 #define wxEL_NO_REORDER 0x0800
24
25 // This class provides a composite control that lets the
26 // user easily enter list of strings
27
28 class WXDLLIMPEXP_ADV wxEditableListBox : public wxPanel
29 {
30 public:
31 wxEditableListBox(wxWindow *parent, wxWindowID id,
32 const wxString& label,
33 const wxPoint& pos = wxDefaultPosition,
34 const wxSize& size = wxDefaultSize,
35 long style = wxEL_ALLOW_NEW | wxEL_ALLOW_EDIT | wxEL_ALLOW_DELETE,
36 const wxString& name = wxT("editableListBox"));
37
38 void SetStrings(const wxArrayString& strings);
39 void GetStrings(wxArrayString& strings) const;
40
41 wxListCtrl* GetListCtrl() { return m_listCtrl; }
42 wxBitmapButton* GetDelButton() { return m_bDel; }
43 wxBitmapButton* GetNewButton() { return m_bNew; }
44 wxBitmapButton* GetUpButton() { return m_bUp; }
45 wxBitmapButton* GetDownButton() { return m_bDown; }
46 wxBitmapButton* GetEditButton() { return m_bEdit; }
47
48 protected:
49 wxBitmapButton *m_bDel, *m_bNew, *m_bUp, *m_bDown, *m_bEdit;
50 wxListCtrl *m_listCtrl;
51 int m_selection;
52 long m_style;
53
54 void OnItemSelected(wxListEvent& event);
55 void OnEndLabelEdit(wxListEvent& event);
56 void OnNewItem(wxCommandEvent& event);
57 void OnDelItem(wxCommandEvent& event);
58 void OnEditItem(wxCommandEvent& event);
59 void OnUpItem(wxCommandEvent& event);
60 void OnDownItem(wxCommandEvent& event);
61
62 DECLARE_CLASS(wxEditableListBox)
63 DECLARE_EVENT_TABLE()
64 };
65
66 #endif // __WX_EDITLBOX_H__