]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_combobox.i
fixed introspection of objects with attrs without string names.
[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
RD
24DocStr(wxComboBox,
25"A combobox is like a combination of an edit control and a listbox. It can be
26displayed as static list with editable or read-only text field; or a drop-down
27list with text field.");
28
29RefDoc(wxComboBox, "
30 Styles
31 wx.CB_SIMPLE: Creates a combobox with a permanently displayed list.
32 Windows only.
33
34 wx.CB_DROPDOWN: Creates a combobox with a drop-down list.
35
36 wx.CB_READONLY: Same as wxCB_DROPDOWN but only the strings specified as
37 the combobox choices can be selected, it is impossible
38 to select (even from a program) a string which is not in
39 the choices list.
40
41 wx.CB_SORT: Sorts the entries in the list alphabetically.
42
43 Events
44
45 EVT_COMBOBOX: Sent when an item on the list is selected.
46 EVT_TEXT: Sent when the combobox text changes.
47");
48
49
50
d14a1e28
RD
51#ifdef __WXMSW__
52class wxComboBox : public wxChoice
53#else
54class wxComboBox : public wxControl, public wxItemContainer
55#endif
56{
57public:
2b9048c5
RD
58 %pythonAppend wxComboBox "self._setOORInfo(self)"
59 %pythonAppend wxComboBox() ""
d14a1e28 60
e029dde7
RD
61 RefDoc(wxComboBox, ""); // turn it off for the ctors
62
6ad421ae 63 DocCtorAStr(
907c2926 64 wxComboBox(wxWindow* parent, wxWindowID id=-1,
6ad421ae
RD
65 const wxString& value = wxPyEmptyString,
66 const wxPoint& pos = wxDefaultPosition,
67 const wxSize& size = wxDefaultSize,
68 const wxArrayString& choices = wxPyEmptyStringArray,
69 long style = 0,
70 const wxValidator& validator = wxDefaultValidator,
71 const wxString& name = wxPyComboBoxNameStr),
72 "__init__(Window parent, int id, String value=EmptyString,\n"
73 " Point pos=DefaultPosition, Size size=DefaultSize,\n"
74 " List choices=[], long style=0, Validator validator=DefaultValidator,\n"
75 " String name=ComboBoxNameStr) -> ComboBox",
76 "Constructor, creates and shows a ComboBox control.");
77
78 DocCtorStrName(
79 wxComboBox(),
80 "Precreate a ComboBox control for 2-phase creation.",
81 PreComboBox);
82
83
84 DocDeclAStr(
907c2926 85 bool, Create(wxWindow *parent, wxWindowID id=-1,
6ad421ae
RD
86 const wxString& value = wxPyEmptyString,
87 const wxPoint& pos = wxDefaultPosition,
88 const wxSize& size = wxDefaultSize,
89 const wxArrayString& choices = wxPyEmptyStringArray,
90 long style = 0,
91 const wxValidator& validator = wxDefaultValidator,
92 const wxString& name = wxPyChoiceNameStr),
93 "Create(Window parent, int id, String value=EmptyString,\n"
94 " Point pos=DefaultPosition, Size size=DefaultSize,\n"
95 " List choices=[], long style=0, Validator validator=DefaultValidator,\n"
96 " String name=ChoiceNameStr) -> bool",
014577f3 97 "Actually create the GUI wxComboBox control for 2-phase creation");
6ad421ae
RD
98
99
100 DocDeclStr(
101 virtual wxString , GetValue() const,
102 "Returns the current value in the combobox text field.");
103
104 DocDeclStr(
105 virtual void , SetValue(const wxString& value),
106 "");
107
108
109 DocDeclStr(
110 virtual void , Copy(),
111 "Copies the selected text to the clipboard.");
112
113 DocDeclStr(
114 virtual void , Cut(),
115 "Copies the selected text to the clipboard and removes the selection.");
116
117 DocDeclStr(
118 virtual void , Paste(),
119 "Pastes text from the clipboard to the text field.");
120
121
122 DocDeclStr(
123 virtual void , SetInsertionPoint(long pos),
124 "Sets the insertion point in the combobox text field.");
125
126 DocDeclStr(
127 virtual long , GetInsertionPoint() const,
128 "Returns the insertion point for the combobox's text field.");
129
130 DocDeclStr(
131 virtual long , GetLastPosition() const,
132 "Returns the last position in the combobox text field.");
133
134 DocDeclStr(
135 virtual void , Replace(long from, long to, const wxString& value),
136 "Replaces the text between two positions with the given text, in the\n"
137 "combobox text field.");
138
139 DocDeclStr(
140 void , SetSelection(int n),
f8c88923 141 "Sets the item at index 'n' to be the selected item.");
d14a1e28 142
f8c88923
RD
143 DocDeclStrName(
144 virtual void , SetSelection(long from, long to),
5ce4d9fa 145 "Selects the text between the two positions in the combobox text field.",
f8c88923 146 SetMark);
d14a1e28 147
f8c88923
RD
148 DocDeclStr(
149 bool , SetStringSelection(const wxString& string),
150 "Select the item with the specifed string");
151
152 DocDeclStr(
153 void , SetString(int n, const wxString& string),
154 "Set the label for the n'th item (zero based) in the list.");
155
6ad421ae
RD
156 DocDeclStr(
157 virtual void , SetEditable(bool editable),
158 "");
159
160
161 DocDeclStr(
162 virtual void , SetInsertionPointEnd(),
163 "Sets the insertion point at the end of the combobox text field.");
164
165 DocDeclStr(
166 virtual void , Remove(long from, long to),
167 "Removes the text between the two positions in the combobox text field.");
168
d14a1e28
RD
169};
170
171//---------------------------------------------------------------------------