]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_combobox.i
All wxScrolledWindows shoudl have wxHSCROLL|wxVSCROLL now.
[wxWidgets.git] / wxPython / src / _combobox.i
CommitLineData
d14a1e28
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: _combobox.i
3// Purpose: SWIG interface defs for wxComboBox
4//
5// Author: Robin Dunn
6//
7// Created: 10-June-1998
8// RCS-ID: $Id$
9// Copyright: (c) 2003 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
13// Not a %module
14
15
16//---------------------------------------------------------------------------
17
b2dc1044 18MAKE_CONST_WXSTRING(ComboBoxNameStr);
d14a1e28
RD
19
20//---------------------------------------------------------------------------
21%newgroup;
22
23
6ad421ae 24DocStr(wxComboBox,
d07d2bc9
RD
25"A combobox is like a combination of an edit control and a
26listbox. It can be displayed as static list with editable or
27read-only text field; or a drop-down list with text field.
28
29A combobox permits a single selection only. Combobox items are
30numbered from zero.", "
31
32Styles
33------
34 ================ ===============================================
35 wx.CB_SIMPLE Creates a combobox with a permanently
36 displayed list. Windows only.
37
38 wx.CB_DROPDOWN Creates a combobox with a drop-down list.
39
40 wx.CB_READONLY Same as wxCB_DROPDOWN but only the strings
41 specified as the combobox choices can be
42 selected, it is impossible to select
43 (even from a program) a string which is
44 not in the choices list.
45
46 wx.CB_SORT Sorts the entries in the list alphabetically.
47 ================ ===============================================
48
49Events
50-------
51 ================ ===============================================
52 EVT_COMBOBOX Sent when an item on the list is selected.
53 EVT_TEXT Sent when the combobox text changes.
54 ================ ===============================================
6ad421ae
RD
55");
56
57
58
ab1f7d2a
RD
59MustHaveApp(wxComboBox);
60
d14a1e28
RD
61#ifdef __WXMSW__
62class wxComboBox : public wxChoice
63#else
64class wxComboBox : public wxControl, public wxItemContainer
65#endif
66{
67public:
2b9048c5
RD
68 %pythonAppend wxComboBox "self._setOORInfo(self)"
69 %pythonAppend wxComboBox() ""
d14a1e28 70
6ad421ae 71 DocCtorAStr(
907c2926 72 wxComboBox(wxWindow* parent, wxWindowID id=-1,
6ad421ae
RD
73 const wxString& value = wxPyEmptyString,
74 const wxPoint& pos = wxDefaultPosition,
75 const wxSize& size = wxDefaultSize,
76 const wxArrayString& choices = wxPyEmptyStringArray,
77 long style = 0,
78 const wxValidator& validator = wxDefaultValidator,
79 const wxString& name = wxPyComboBoxNameStr),
d07d2bc9
RD
80 "__init__(Window parent, int id, String value=EmptyString,
81 Point pos=DefaultPosition, Size size=DefaultSize,
82 List choices=[], long style=0, Validator validator=DefaultValidator,
83 String name=ComboBoxNameStr) -> ComboBox",
84 "Constructor, creates and shows a ComboBox control.", "");
6ad421ae
RD
85
86 DocCtorStrName(
87 wxComboBox(),
d07d2bc9 88 "Precreate a ComboBox control for 2-phase creation.", "",
6ad421ae
RD
89 PreComboBox);
90
91
92 DocDeclAStr(
907c2926 93 bool, Create(wxWindow *parent, wxWindowID id=-1,
6ad421ae
RD
94 const wxString& value = wxPyEmptyString,
95 const wxPoint& pos = wxDefaultPosition,
96 const wxSize& size = wxDefaultSize,
97 const wxArrayString& choices = wxPyEmptyStringArray,
98 long style = 0,
99 const wxValidator& validator = wxDefaultValidator,
100 const wxString& name = wxPyChoiceNameStr),
d07d2bc9
RD
101 "Create(Window parent, int id, String value=EmptyString,
102 Point pos=DefaultPosition, Size size=DefaultSize,
103 List choices=[], long style=0, Validator validator=DefaultValidator,
104 String name=ChoiceNameStr) -> bool",
105 "Actually create the GUI wxComboBox control for 2-phase creation", "");
6ad421ae
RD
106
107
108 DocDeclStr(
109 virtual wxString , GetValue() const,
d07d2bc9 110 "Returns the current value in the combobox text field.", "");
6ad421ae
RD
111
112 DocDeclStr(
113 virtual void , SetValue(const wxString& value),
d07d2bc9 114 "", "");
6ad421ae
RD
115
116
117 DocDeclStr(
118 virtual void , Copy(),
d07d2bc9 119 "Copies the selected text to the clipboard.", "");
6ad421ae
RD
120
121 DocDeclStr(
122 virtual void , Cut(),
d07d2bc9 123 "Copies the selected text to the clipboard and removes the selection.", "");
6ad421ae
RD
124
125 DocDeclStr(
126 virtual void , Paste(),
d07d2bc9 127 "Pastes text from the clipboard to the text field.", "");
6ad421ae
RD
128
129
130 DocDeclStr(
131 virtual void , SetInsertionPoint(long pos),
d07d2bc9 132 "Sets the insertion point in the combobox text field.", "");
6ad421ae
RD
133
134 DocDeclStr(
135 virtual long , GetInsertionPoint() const,
d07d2bc9 136 "Returns the insertion point for the combobox's text field.", "");
6ad421ae
RD
137
138 DocDeclStr(
139 virtual long , GetLastPosition() const,
d07d2bc9 140 "Returns the last position in the combobox text field.", "");
6ad421ae
RD
141
142 DocDeclStr(
143 virtual void , Replace(long from, long to, const wxString& value),
d07d2bc9
RD
144 "Replaces the text between two positions with the given text, in the
145combobox text field.", "");
6ad421ae
RD
146
147 DocDeclStr(
148 void , SetSelection(int n),
d07d2bc9 149 "Sets the item at index 'n' to be the selected item.", "");
d14a1e28 150
f8c88923
RD
151 DocDeclStrName(
152 virtual void , SetSelection(long from, long to),
d07d2bc9 153 "Selects the text between the two positions in the combobox text field.", "",
f8c88923 154 SetMark);
d14a1e28 155
f8c88923
RD
156 DocDeclStr(
157 bool , SetStringSelection(const wxString& string),
d07d2bc9 158 "Select the item with the specifed string", "");
f8c88923
RD
159
160 DocDeclStr(
161 void , SetString(int n, const wxString& string),
d07d2bc9 162 "Set the label for the n'th item (zero based) in the list.", "");
f8c88923 163
6ad421ae
RD
164 DocDeclStr(
165 virtual void , SetEditable(bool editable),
d07d2bc9 166 "", "");
6ad421ae
RD
167
168
169 DocDeclStr(
170 virtual void , SetInsertionPointEnd(),
d07d2bc9 171 "Sets the insertion point at the end of the combobox text field.", "");
6ad421ae
RD
172
173 DocDeclStr(
174 virtual void , Remove(long from, long to),
d07d2bc9 175 "Removes the text between the two positions in the combobox text field.", "");
6ad421ae 176
880715c9
RD
177 static wxVisualAttributes
178 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
d14a1e28
RD
179};
180
181//---------------------------------------------------------------------------