]>
Commit | Line | Data |
---|---|---|
f55d21eb VS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: editlbox.h | |
3 | // Purpose: ListBox with editable items | |
4 | // Author: Vaclav Slavik | |
5 | // RCS-ID: $Id$ | |
6 | // Copyright: (c) Vaclav Slavik | |
7 | // Licence: wxWindows licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | ||
11 | #ifndef __WX_EDITLBOX_H__ | |
12 | #define __WX_EDITLBOX_H__ | |
13 | ||
f55d21eb | 14 | #include "wx/panel.h" |
936a13b5 | 15 | #include "wx/gizmos/gizmos.h" |
f55d21eb VS |
16 | |
17 | class WXDLLEXPORT wxBitmapButton; | |
18 | class WXDLLEXPORT wxListCtrl; | |
19 | class WXDLLEXPORT wxListEvent; | |
086ab766 | 20 | |
6187ec8f RD |
21 | #define wxEL_ALLOW_NEW 0x0100 |
22 | #define wxEL_ALLOW_EDIT 0x0200 | |
23 | #define wxEL_ALLOW_DELETE 0x0400 | |
24 | ||
f55d21eb VS |
25 | // This class provides a composite control that lets the |
26 | // user easily enter list of strings | |
27 | ||
936a13b5 | 28 | class WXDLLIMPEXP_GIZMOS wxEditableListBox : public wxPanel |
f55d21eb | 29 | { |
fde63257 | 30 | DECLARE_CLASS(wxEditableListBox) |
f55d21eb VS |
31 | |
32 | public: | |
33 | wxEditableListBox(wxWindow *parent, wxWindowID id, | |
34 | const wxString& label, | |
35 | const wxPoint& pos = wxDefaultPosition, | |
00b2a5df | 36 | const wxSize& size = wxDefaultSize, |
6187ec8f | 37 | long style = wxEL_ALLOW_NEW | wxEL_ALLOW_EDIT | wxEL_ALLOW_DELETE, |
00b2a5df | 38 | const wxString& name = wxT("editableListBox")); |
f55d21eb VS |
39 | |
40 | void SetStrings(const wxArrayString& strings); | |
41 | void GetStrings(wxArrayString& strings); | |
42 | ||
366d7bd6 RD |
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; } | |
49 | ||
f55d21eb VS |
50 | protected: |
51 | wxBitmapButton *m_bDel, *m_bNew, *m_bUp, *m_bDown, *m_bEdit; | |
52 | wxListCtrl *m_listCtrl; | |
53 | int m_selection; | |
6187ec8f | 54 | long m_style; |
f55d21eb VS |
55 | |
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); | |
63 | ||
64 | DECLARE_EVENT_TABLE() | |
65 | }; | |
66 | ||
67 | #endif |