summaryrefslogtreecommitdiff
path: root/doc/classes/EditorProperty.xml
blob: e187b8156b936b6d8f6f0bf5b8211d3d671973a5 (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
<?xml version="1.0" encoding="UTF-8" ?>
<class name="EditorProperty" inherits="Container" category="Core" version="3.2">
	<brief_description>
		Custom control to edit properties for adding into the inspector
	</brief_description>
	<description>
		This control allows property editing for one or multiple properties into [EditorInspector]. It is added via [EditorInspectorPlugin].
	</description>
	<tutorials>
	</tutorials>
	<methods>
		<method name="add_focusable">
			<return type="void">
			</return>
			<argument index="0" name="control" type="Control">
			</argument>
			<description>
			If any of the controls added can gain keyboard focus, add it here. This ensures that focus will be restored if the inspector is refreshed.
			</description>
		</method>
		<method name="emit_changed">
			<return type="void">
			</return>
			<argument index="0" name="property" type="String">
			</argument>
			<argument index="1" name="value" type="Variant">
			</argument>
			<argument index="2" name="field" type="String" default="&quot;&quot;">
			</argument>
			<argument index="3" name="changing" type="bool" default="false">
			</argument>
			<description>
				If one (or many properties) changed, this must be called. "Field" is used in case your editor can modify fields separately (as an example, Vector3.x). The "changing" argument avoids the editor requesting this property to be refreshed (leave as false if unsure).
			</description>
		</method>
		<method name="get_edited_object">
			<return type="Object">
			</return>
			<description>
				Get the edited object.
			</description>
		</method>
		<method name="get_edited_property">
			<return type="String">
			</return>
			<description>
				Get the edited property. If your editor is for a single property (added via [method EditorInspectorPlugin.parse_property]), then this will return it..
			</description>
		</method>
		<method name="get_tooltip_text" qualifiers="const">
			<return type="String">
			</return>
			<description>
				Override if you want to allow a custom tooltip over your property.
			</description>
		</method>
		<method name="set_bottom_editor">
			<return type="void">
			</return>
			<argument index="0" name="editor" type="Control">
			</argument>
			<description>
			Add controls with this function if you want them on the bottom (below the label).
			</description>
		</method>
		<method name="update_property" qualifiers="virtual">
			<return type="void">
			</return>
			<description>
				When this virtual function is called, you must update your editor.
			</description>
		</method>
	</methods>
	<members>
		<member name="checkable" type="bool" setter="set_checkable" getter="is_checkable">
			Used by the inspector, set when property is checkable.
		</member>
		<member name="checked" type="bool" setter="set_checked" getter="is_checked">
			Used by the inspector, when the property is checked.
		</member>
		<member name="draw_red" type="bool" setter="set_draw_red" getter="is_draw_red">
			Used by the inspector, when the property must draw with error color.
		</member>
		<member name="keying" type="bool" setter="set_keying" getter="is_keying">
			Used by the inspector, when the property can add keys for animation/
		</member>
		<member name="label" type="String" setter="set_label" getter="get_label">
			Set this property to change the label (if you want to show one)
		</member>
		<member name="read_only" type="bool" setter="set_read_only" getter="is_read_only">
			Used by the inspector, when the property is read-only.
		</member>
	</members>
	<signals>
		<signal name="multiple_properties_changed">
			<argument index="0" name="properties" type="PoolStringArray">
			</argument>
			<argument index="1" name="value" type="Array">
			</argument>
			<description>
				Emit yourself if you want multiple properties modified at the same time. Do not use if added via [method EditorInspectorPlugin.parse_property]
			</description>
		</signal>
		<signal name="object_id_selected">
			<argument index="0" name="property" type="String">
			</argument>
			<argument index="1" name="id" type="int">
			</argument>
			<description>
				Used by sub-inspectors. Emit if what was selected was an Object ID.
			</description>
		</signal>
		<signal name="property_changed">
			<argument index="0" name="property" type="String">
			</argument>
			<argument index="1" name="value" type="Nil">
			</argument>
			<description>
				Do not emit this manually, use the [method emit_changed] method instead.
			</description>
		</signal>
		<signal name="property_checked">
			<argument index="0" name="property" type="String">
			</argument>
			<argument index="1" name="bool" type="String">
			</argument>
			<description>
				Used internally, when a property was checked.
			</description>
		</signal>
		<signal name="property_keyed">
			<argument index="0" name="property" type="String">
			</argument>
			<description>
				Emit if you want to add this value as an animation key (check keying being enabled first).
			</description>
		</signal>
		<signal name="property_keyed_with_value">
			<argument index="0" name="property" type="String">
			</argument>
			<argument index="1" name="value" type="Nil">
			</argument>
			<description>
				Emit if you want to key a property with a single value.
			</description>
		</signal>
		<signal name="resource_selected">
			<argument index="0" name="path" type="String">
			</argument>
			<argument index="1" name="resource" type="Resource">
			</argument>
			<description>
				If you want a sub-resource to be edited, emit this signal with the resource.
			</description>
		</signal>
		<signal name="selected">
			<argument index="0" name="path" type="String">
			</argument>
			<argument index="1" name="focusable_idx" type="int">
			</argument>
			<description>
				Internal, used when selected.
			</description>
		</signal>
	</signals>
	<constants>
	</constants>
</class>