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