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 #if wxUSE_EDITABLELISTBOX
20 class WXDLLEXPORT wxBitmapButton
;
21 class WXDLLEXPORT wxListCtrl
;
22 class WXDLLEXPORT wxListEvent
;
24 #define wxEL_ALLOW_NEW 0x0100
25 #define wxEL_ALLOW_EDIT 0x0200
26 #define wxEL_ALLOW_DELETE 0x0400
27 #define wxEL_NO_REORDER 0x0800
29 // This class provides a composite control that lets the
30 // user easily enter list of strings
32 class WXDLLIMPEXP_ADV wxEditableListBox
: public wxPanel
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"));
42 void SetStrings(const wxArrayString
& strings
);
43 void GetStrings(wxArrayString
& strings
) const;
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
; }
53 wxBitmapButton
*m_bDel
, *m_bNew
, *m_bUp
, *m_bDown
, *m_bEdit
;
54 wxListCtrl
*m_listCtrl
;
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
);
66 DECLARE_CLASS(wxEditableListBox
)
70 #endif // wxUSE_EDITABLELISTBOX
72 #endif // __WX_EDITLBOX_H__