summaryrefslogtreecommitdiff
path: root/doc/classes/OptionButton.xml
blob: 28fd8deba80f74e68a957315aa8c0f5f92bac2f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OptionButton" inherits="Button" category="Core" version="3.2">
	<brief_description>
		Button control that provides selectable options when pressed.
	</brief_description>
	<description>
		OptionButton is a type button that provides a selectable list of items when pressed. The item selected becomes the "current" item and is displayed as the button text.
	</description>
	<tutorials>
	</tutorials>
	<demos>
	</demos>
	<methods>
		<method name="add_icon_item">
			<return type="void">
			</return>
			<argument index="0" name="texture" type="Texture">
			</argument>
			<argument index="1" name="label" type="String">
			</argument>
			<argument index="2" name="id" type="int" default="-1">
			</argument>
			<description>
				Add an item, with a "texture" icon, text "label" and (optionally) id. If no "id" is passed, "id" becomes the item index. New items are appended at the end.
			</description>
		</method>
		<method name="add_item">
			<return type="void">
			</return>
			<argument index="0" name="label" type="String">
			</argument>
			<argument index="1" name="id" type="int" default="-1">
			</argument>
			<description>
				Add an item, with text "label" and (optionally) id. If no "id" is passed, "id" becomes the item index. New items are appended at the end.
			</description>
		</method>
		<method name="add_separator">
			<return type="void">
			</return>
			<description>
				Add a separator to the list of items. Separators help to group items. Separator also takes up an index and is appended at the end.
			</description>
		</method>
		<method name="clear">
			<return type="void">
			</return>
			<description>
				Clear all the items in the [OptionButton].
			</description>
		</method>
		<method name="get_item_count" qualifiers="const">
			<return type="int">
			</return>
			<description>
				Return the amount of items in the OptionButton.
			</description>
		</method>
		<method name="get_item_icon" qualifiers="const">
			<return type="Texture">
			</return>
			<argument index="0" name="idx" type="int">
			</argument>
			<description>
				Return the icon of the item at index "idx".
			</description>
		</method>
		<method name="get_item_id" qualifiers="const">
			<return type="int">
			</return>
			<argument index="0" name="idx" type="int">
			</argument>
			<description>
				Return the ID of the item at index [code]idx[/code].
			</description>
		</method>
		<method name="get_item_index" qualifiers="const">
			<return type="int">
			</return>
			<argument index="0" name="id" type="int">
			</argument>
			<description>
				Return the index of the item with the given [code]id[/code].
			</description>
		</method>
		<method name="get_item_metadata" qualifiers="const">
			<return type="Variant">
			</return>
			<argument index="0" name="idx" type="int">
			</argument>
			<description>
			</description>
		</method>
		<method name="get_item_text" qualifiers="const">
			<return type="String">
			</return>
			<argument index="0" name="idx" type="int">
			</argument>
			<description>
				Return the text of the item at index "idx".
			</description>
		</method>
		<method name="get_popup" qualifiers="const">
			<return type="PopupMenu">
			</return>
			<description>
				Return the [PopupMenu] contained in this button.
			</description>
		</method>
		<method name="get_selected_id" qualifiers="const">
			<return type="int">
			</return>
			<description>
			</description>
		</method>
		<method name="get_selected_metadata" qualifiers="const">
			<return type="Variant">
			</return>
			<description>
			</description>
		</method>
		<method name="is_item_disabled" qualifiers="const">
			<return type="bool">
			</return>
			<argument index="0" name="idx" type="int">
			</argument>
			<description>
			</description>
		</method>
		<method name="remove_item">
			<return type="void">
			</return>
			<argument index="0" name="idx" type="int">
			</argument>
			<description>
			</description>
		</method>
		<method name="select">
			<return type="void">
			</return>
			<argument index="0" name="idx" type="int">
			</argument>
			<description>
				Select an item by index and make it the current item.
			</description>
		</method>
		<method name="set_item_disabled">
			<return type="void">
			</return>
			<argument index="0" name="idx" type="int">
			</argument>
			<argument index="1" name="disabled" type="bool">
			</argument>
			<description>
			</description>
		</method>
		<method name="set_item_icon">
			<return type="void">
			</return>
			<argument index="0" name="idx" type="int">
			</argument>
			<argument index="1" name="texture" type="Texture">
			</argument>
			<description>
				Set the icon of an item at index "idx".
			</description>
		</method>
		<method name="set_item_id">
			<return type="void">
			</return>
			<argument index="0" name="idx" type="int">
			</argument>
			<argument index="1" name="id" type="int">
			</argument>
			<description>
				Set the ID of an item at index "idx".
			</description>
		</method>
		<method name="set_item_metadata">
			<return type="void">
			</return>
			<argument index="0" name="idx" type="int">
			</argument>
			<argument index="1" name="metadata" type="Variant">
			</argument>
			<description>
			</description>
		</method>
		<method name="set_item_text">
			<return type="void">
			</return>
			<argument index="0" name="idx" type="int">
			</argument>
			<argument index="1" name="text" type="String">
			</argument>
			<description>
				Set the text of an item at index "idx".
			</description>
		</method>
	</methods>
	<members>
		<member name="selected" type="int" setter="_select_int" getter="get_selected">
		</member>
	</members>
	<signals>
		<signal name="item_focused">
			<argument index="0" name="ID" type="int">
			</argument>
			<description>
				This signal is emitted when user navigated to an item using [code]ui_up[/code] or [code]ui_down[/code] action. ID of the item selected is passed as argument.
			</description>
		</signal>
		<signal name="item_selected">
			<argument index="0" name="ID" type="int">
			</argument>
			<description>
				This signal is emitted when the current item was changed by the user. Index of the item selected is passed as argument.
			</description>
		</signal>
	</signals>
	<constants>
	</constants>
	<theme_items>
		<theme_item name="arrow" type="Texture">
		</theme_item>
		<theme_item name="arrow_margin" type="int">
		</theme_item>
		<theme_item name="disabled" type="StyleBox">
		</theme_item>
		<theme_item name="focus" type="StyleBox">
		</theme_item>
		<theme_item name="font" type="Font">
		</theme_item>
		<theme_item name="font_color" type="Color">
		</theme_item>
		<theme_item name="font_color_disabled" type="Color">
		</theme_item>
		<theme_item name="font_color_hover" type="Color">
		</theme_item>
		<theme_item name="font_color_pressed" type="Color">
		</theme_item>
		<theme_item name="hover" type="StyleBox">
		</theme_item>
		<theme_item name="hseparation" type="int">
		</theme_item>
		<theme_item name="normal" type="StyleBox">
		</theme_item>
		<theme_item name="pressed" type="StyleBox">
		</theme_item>
	</theme_items>
</class>