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__
14 #if defined(__GNUG__) && !defined(__APPLE__)
15 #pragma interface "editlbox.h"
19 #include "wx/gizmos/gizmos.h"
21 class WXDLLEXPORT wxBitmapButton
;
22 class WXDLLEXPORT wxListCtrl
;
23 class WXDLLEXPORT wxListEvent
;
25 #define wxEL_ALLOW_NEW 0x0100
26 #define wxEL_ALLOW_EDIT 0x0200
27 #define wxEL_ALLOW_DELETE 0x0400
29 // This class provides a composite control that lets the
30 // user easily enter list of strings
32 class WXDLLIMPEXP_GIZMOS wxEditableListBox
: public wxPanel
34 DECLARE_CLASS(wxEditableListBox
)
37 wxEditableListBox(wxWindow
*parent
, wxWindowID id
,
38 const wxString
& label
,
39 const wxPoint
& pos
= wxDefaultPosition
,
40 const wxSize
& size
= wxDefaultSize
,
41 long style
= wxEL_ALLOW_NEW
| wxEL_ALLOW_EDIT
| wxEL_ALLOW_DELETE
,
42 const wxString
& name
= wxT("editableListBox"));
44 void SetStrings(const wxArrayString
& strings
);
45 void GetStrings(wxArrayString
& strings
);
47 wxListCtrl
* GetListCtrl() { return m_listCtrl
; }
48 wxBitmapButton
* GetDelButton() { return m_bDel
; }
49 wxBitmapButton
* GetNewButton() { return m_bNew
; }
50 wxBitmapButton
* GetUpButton() { return m_bUp
; }
51 wxBitmapButton
* GetDownButton() { return m_bDown
; }
52 wxBitmapButton
* GetEditButton() { return m_bEdit
; }
55 wxBitmapButton
*m_bDel
, *m_bNew
, *m_bUp
, *m_bDown
, *m_bEdit
;
56 wxListCtrl
*m_listCtrl
;
60 void OnItemSelected(wxListEvent
& event
);
61 void OnEndLabelEdit(wxListEvent
& event
);
62 void OnNewItem(wxCommandEvent
& event
);
63 void OnDelItem(wxCommandEvent
& event
);
64 void OnEditItem(wxCommandEvent
& event
);
65 void OnUpItem(wxCommandEvent
& event
);
66 void OnDownItem(wxCommandEvent
& event
);