1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: ListBox with editable items
4 // Author: Vaclav Slavik
6 // Copyright: (c) Vaclav Slavik
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 #ifndef __WX_EDITLBOX_H__
12 #define __WX_EDITLBOX_H__
15 #include "wx/gizmos/gizmos.h"
17 class WXDLLEXPORT wxBitmapButton
;
18 class WXDLLEXPORT wxListCtrl
;
19 class WXDLLEXPORT wxListEvent
;
21 #define wxEL_ALLOW_NEW 0x0100
22 #define wxEL_ALLOW_EDIT 0x0200
23 #define wxEL_ALLOW_DELETE 0x0400
24 #define wxEL_NO_REORDER 0x0800
26 // This class provides a composite control that lets the
27 // user easily enter list of strings
29 class WXDLLIMPEXP_GIZMOS wxEditableListBox
: public wxPanel
31 DECLARE_CLASS(wxEditableListBox
)
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"));
41 void SetStrings(const wxArrayString
& strings
);
42 void GetStrings(wxArrayString
& strings
) const;
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
; }
52 wxBitmapButton
*m_bDel
, *m_bNew
, *m_bUp
, *m_bDown
, *m_bEdit
;
53 wxListCtrl
*m_listCtrl
;
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
);