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__
16 class WXDLLEXPORT wxBitmapButton
;
17 class WXDLLEXPORT wxListCtrl
;
18 class WXDLLEXPORT wxListEvent
;
20 #define wxEL_ALLOW_NEW 0x0100
21 #define wxEL_ALLOW_EDIT 0x0200
22 #define wxEL_ALLOW_DELETE 0x0400
23 #define wxEL_NO_REORDER 0x0800
25 // This class provides a composite control that lets the
26 // user easily enter list of strings
28 class WXDLLIMPEXP_ADV wxEditableListBox
: public wxPanel
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"));
38 void SetStrings(const wxArrayString
& strings
);
39 void GetStrings(wxArrayString
& strings
) const;
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
; }
49 wxBitmapButton
*m_bDel
, *m_bNew
, *m_bUp
, *m_bDown
, *m_bEdit
;
50 wxListCtrl
*m_listCtrl
;
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
);
62 DECLARE_CLASS(wxEditableListBox
)
66 #endif // __WX_EDITLBOX_H__