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