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