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