]>
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 | ||
ab7ce33c | 14 | #if defined(__GNUG__) && !defined(__APPLE__) |
f55d21eb VS |
15 | #pragma interface "editlbox.h" |
16 | #endif | |
17 | ||
18 | #include "wx/panel.h" | |
19 | ||
086ab766 RD |
20 | #ifdef GIZMOISDLL |
21 | #define GIZMODLLEXPORT WXDLLEXPORT | |
22 | #else | |
23 | #define GIZMODLLEXPORT | |
24 | #endif | |
25 | ||
f55d21eb VS |
26 | |
27 | class WXDLLEXPORT wxBitmapButton; | |
28 | class WXDLLEXPORT wxListCtrl; | |
29 | class WXDLLEXPORT wxListEvent; | |
086ab766 | 30 | |
6187ec8f RD |
31 | #define wxEL_ALLOW_NEW 0x0100 |
32 | #define wxEL_ALLOW_EDIT 0x0200 | |
33 | #define wxEL_ALLOW_DELETE 0x0400 | |
34 | ||
f55d21eb VS |
35 | // This class provides a composite control that lets the |
36 | // user easily enter list of strings | |
37 | ||
086ab766 | 38 | class GIZMODLLEXPORT wxEditableListBox : public wxPanel |
f55d21eb VS |
39 | { |
40 | DECLARE_CLASS(wxEditableListBox); | |
41 | ||
42 | public: | |
43 | wxEditableListBox(wxWindow *parent, wxWindowID id, | |
44 | const wxString& label, | |
45 | const wxPoint& pos = wxDefaultPosition, | |
00b2a5df | 46 | const wxSize& size = wxDefaultSize, |
6187ec8f | 47 | long style = wxEL_ALLOW_NEW | wxEL_ALLOW_EDIT | wxEL_ALLOW_DELETE, |
00b2a5df | 48 | const wxString& name = wxT("editableListBox")); |
f55d21eb VS |
49 | |
50 | void SetStrings(const wxArrayString& strings); | |
51 | void GetStrings(wxArrayString& strings); | |
52 | ||
366d7bd6 RD |
53 | wxListCtrl* GetListCtrl() { return m_listCtrl; } |
54 | wxBitmapButton* GetDelButton() { return m_bDel; } | |
55 | wxBitmapButton* GetNewButton() { return m_bNew; } | |
56 | wxBitmapButton* GetUpButton() { return m_bUp; } | |
57 | wxBitmapButton* GetDownButton() { return m_bDown; } | |
58 | wxBitmapButton* GetEditButton() { return m_bEdit; } | |
59 | ||
f55d21eb VS |
60 | protected: |
61 | wxBitmapButton *m_bDel, *m_bNew, *m_bUp, *m_bDown, *m_bEdit; | |
62 | wxListCtrl *m_listCtrl; | |
63 | int m_selection; | |
6187ec8f | 64 | long m_style; |
f55d21eb VS |
65 | |
66 | void OnItemSelected(wxListEvent& event); | |
67 | void OnEndLabelEdit(wxListEvent& event); | |
68 | void OnNewItem(wxCommandEvent& event); | |
69 | void OnDelItem(wxCommandEvent& event); | |
70 | void OnEditItem(wxCommandEvent& event); | |
71 | void OnUpItem(wxCommandEvent& event); | |
72 | void OnDownItem(wxCommandEvent& event); | |
73 | ||
74 | DECLARE_EVENT_TABLE() | |
75 | }; | |
76 | ||
77 | #endif |