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
25 // This class provides a composite control that lets the
26 // user easily enter list of strings
28 class WXDLLIMPEXP_GIZMOS wxEditableListBox
: public wxPanel
30 DECLARE_CLASS(wxEditableListBox
)
33 wxEditableListBox(wxWindow
*parent
, wxWindowID id
,
34 const wxString
& label
,
35 const wxPoint
& pos
= wxDefaultPosition
,
36 const wxSize
& size
= wxDefaultSize
,
37 long style
= wxEL_ALLOW_NEW
| wxEL_ALLOW_EDIT
| wxEL_ALLOW_DELETE
,
38 const wxString
& name
= wxT("editableListBox"));
40 void SetStrings(const wxArrayString
& strings
);
41 void GetStrings(wxArrayString
& strings
);
43 wxListCtrl
* GetListCtrl() { return m_listCtrl
; }
44 wxBitmapButton
* GetDelButton() { return m_bDel
; }
45 wxBitmapButton
* GetNewButton() { return m_bNew
; }
46 wxBitmapButton
* GetUpButton() { return m_bUp
; }
47 wxBitmapButton
* GetDownButton() { return m_bDown
; }
48 wxBitmapButton
* GetEditButton() { return m_bEdit
; }
51 wxBitmapButton
*m_bDel
, *m_bNew
, *m_bUp
, *m_bDown
, *m_bEdit
;
52 wxListCtrl
*m_listCtrl
;
56 void OnItemSelected(wxListEvent
& event
);
57 void OnEndLabelEdit(wxListEvent
& event
);
58 void OnNewItem(wxCommandEvent
& event
);
59 void OnDelItem(wxCommandEvent
& event
);
60 void OnEditItem(wxCommandEvent
& event
);
61 void OnUpItem(wxCommandEvent
& event
);
62 void OnDownItem(wxCommandEvent
& event
);