]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: editlbox.h | |
e54c96f1 | 3 | // Purpose: interface of wxEditableListBox |
23324ae1 FM |
4 | // Author: wxWidgets team |
5 | // RCS-ID: $Id$ | |
526954c5 | 6 | // Licence: wxWindows licence |
23324ae1 FM |
7 | ///////////////////////////////////////////////////////////////////////////// |
8 | ||
d72927c1 RD |
9 | #define wxEL_ALLOW_NEW 0x0100 |
10 | #define wxEL_ALLOW_EDIT 0x0200 | |
11 | #define wxEL_ALLOW_DELETE 0x0400 | |
12 | #define wxEL_NO_REORDER 0x0800 | |
13 | #define wxEL_DEFAULT_STYLE (wxEL_ALLOW_NEW | wxEL_ALLOW_EDIT | wxEL_ALLOW_DELETE) | |
14 | ||
23324ae1 FM |
15 | /** |
16 | @class wxEditableListBox | |
7c913512 | 17 | |
1f1d2182 FM |
18 | An editable listbox is composite control that lets the user easily enter, |
19 | delete and reorder a list of strings. | |
7c913512 | 20 | |
23324ae1 | 21 | @beginStyleTable |
8c6791e4 | 22 | @style{wxEL_ALLOW_NEW} |
23324ae1 | 23 | Allows the user to enter new strings. |
8c6791e4 | 24 | @style{wxEL_ALLOW_EDIT} |
23324ae1 | 25 | Allows the user to edit existing strings. |
8c6791e4 | 26 | @style{wxEL_ALLOW_DELETE} |
23324ae1 | 27 | Allows the user to delete existing strings. |
8c6791e4 | 28 | @style{wxEL_NO_REORDER} |
23324ae1 | 29 | Does not allow the user to reorder the strings. |
8c6791e4 | 30 | @style{wxEL_DEFAULT_STYLE} |
1f1d2182 | 31 | Default style: wxEL_ALLOW_NEW|wxEL_ALLOW_EDIT|wxEL_ALLOW_DELETE. |
23324ae1 | 32 | @endStyleTable |
7c913512 | 33 | |
32ace389 RR |
34 | The control uses a wxListCtrl internally and emit its events. |
35 | ||
23324ae1 | 36 | @library{wxadv} |
1f1d2182 | 37 | @category{ctrl} |
7c913512 | 38 | |
32ace389 | 39 | @see wxListBox, wxListCtrl |
23324ae1 FM |
40 | */ |
41 | class wxEditableListBox : public wxPanel | |
42 | { | |
43 | public: | |
1f1d2182 FM |
44 | /** |
45 | Default ctor. | |
46 | */ | |
47 | wxEditableListBox(); | |
48 | ||
23324ae1 FM |
49 | /** |
50 | Constructor, creating and showing a list box. | |
3c4f71cc | 51 | |
7c913512 | 52 | @param parent |
4cc4bfaf | 53 | Parent window. Must not be @NULL. |
7c913512 | 54 | @param id |
4cc4bfaf | 55 | Window identifier. The value wxID_ANY indicates a default value. |
7c913512 | 56 | @param label |
4cc4bfaf | 57 | The text shown just before the list control. |
7c913512 | 58 | @param pos |
4cc4bfaf | 59 | Window position. |
dc1b07fd | 60 | If ::wxDefaultPosition is specified then a default position is chosen. |
7c913512 | 61 | @param size |
dc1b07fd FM |
62 | Window size. |
63 | If ::wxDefaultSize is specified then the window is sized appropriately. | |
7c913512 | 64 | @param style |
4cc4bfaf | 65 | Window style. See wxEditableListBox. |
7c913512 | 66 | @param name |
4cc4bfaf | 67 | Window name. |
3c4f71cc | 68 | |
4cc4bfaf | 69 | @see Create() |
23324ae1 | 70 | */ |
7c913512 FM |
71 | wxEditableListBox(wxWindow* parent, wxWindowID id, |
72 | const wxString& label, | |
73 | const wxPoint& pos = wxDefaultPosition, | |
74 | const wxSize& size = wxDefaultSize, | |
75 | long style = wxEL_DEFAULT_STYLE, | |
408776d0 | 76 | const wxString& name = wxEditableListBoxNameStr); |
23324ae1 FM |
77 | |
78 | /** | |
79 | Destructor, destroying the list box. | |
80 | */ | |
adaaa686 | 81 | virtual ~wxEditableListBox(); |
23324ae1 FM |
82 | |
83 | /** | |
1f1d2182 FM |
84 | Creates the editable listbox for two-step construction. |
85 | See wxEditableListBox() for further details. | |
23324ae1 | 86 | */ |
43c48e1e | 87 | bool Create(wxWindow* parent, wxWindowID id, const wxString& label, |
23324ae1 FM |
88 | const wxPoint& pos = wxDefaultPosition, |
89 | const wxSize& size = wxDefaultSize, | |
90 | long style = wxEL_DEFAULT_STYLE, | |
43c48e1e | 91 | const wxString& name = wxEditableListBoxNameStr); |
23324ae1 FM |
92 | |
93 | /** | |
94 | Replaces current contents with given strings. | |
95 | */ | |
96 | void SetStrings(const wxArrayString& strings); | |
1f1d2182 FM |
97 | |
98 | ||
99 | /** | |
100 | Returns in the given array the current contents of the control | |
101 | (the array will be erased before control's contents are appended). | |
102 | */ | |
f1d5aa12 | 103 | void GetStrings(wxArrayString& strings) const; |
23324ae1 | 104 | }; |
e54c96f1 | 105 |