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
|
<?xml version="1.0" encoding="UTF-8" ?>
<class name="MenuBar" inherits="Control" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A horizontal menu bar, which displays [PopupMenu]s or system global menu.
</brief_description>
<description>
New items can be created by adding [PopupMenu] nodes to his node.
</description>
<tutorials>
</tutorials>
<methods>
<method name="get_menu_count" qualifiers="const">
<return type="int" />
<description>
Returns number of menu items.
</description>
</method>
<method name="get_menu_popup" qualifiers="const">
<return type="PopupMenu" />
<param index="0" name="menu" type="int" />
<description>
Returns [PopupMenu] associated with menu item.
</description>
</method>
<method name="get_menu_title" qualifiers="const">
<return type="String" />
<param index="0" name="menu" type="int" />
<description>
Returns menu item title.
</description>
</method>
<method name="get_menu_tooltip" qualifiers="const">
<return type="String" />
<param index="0" name="menu" type="int" />
<description>
Returns menu item tooltip.
</description>
</method>
<method name="is_menu_disabled" qualifiers="const">
<return type="bool" />
<param index="0" name="menu" type="int" />
<description>
Returns [code]true[/code], if menu item is disabled.
</description>
</method>
<method name="is_menu_hidden" qualifiers="const">
<return type="bool" />
<param index="0" name="menu" type="int" />
<description>
Returns [code]true[/code], if menu item is hidden.
</description>
</method>
<method name="is_native_menu" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code], if system global menu is supported and used by this [MenuBar].
</description>
</method>
<method name="set_disable_shortcuts">
<return type="void" />
<param index="0" name="disabled" type="bool" />
<description>
If [code]true[/code], shortcuts are disabled and cannot be used to trigger the button.
</description>
</method>
<method name="set_menu_disabled">
<return type="void" />
<param index="0" name="menu" type="int" />
<param index="1" name="disabled" type="bool" />
<description>
If [code]true[/code], menu item is disabled.
</description>
</method>
<method name="set_menu_hidden">
<return type="void" />
<param index="0" name="menu" type="int" />
<param index="1" name="hidden" type="bool" />
<description>
If [code]true[/code], menu item is hidden.
</description>
</method>
<method name="set_menu_title">
<return type="void" />
<param index="0" name="menu" type="int" />
<param index="1" name="title" type="String" />
<description>
Sets menu item title.
</description>
</method>
<method name="set_menu_tooltip">
<return type="void" />
<param index="0" name="menu" type="int" />
<param index="1" name="tooltip" type="String" />
<description>
Sets menu item tooltip.
</description>
</method>
</methods>
<members>
<member name="flat" type="bool" setter="set_flat" getter="is_flat" default="false">
Flat [MenuBar] don't display item decoration.
</member>
<member name="language" type="String" setter="set_language" getter="get_language" default="""">
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
</member>
<member name="prefer_global_menu" type="bool" setter="set_prefer_global_menu" getter="is_prefer_global_menu" default="true">
If [code]true[/code], [MenuBar] will use system global menu when supported.
</member>
<member name="start_index" type="int" setter="set_start_index" getter="get_start_index" default="-1">
Position in the global menu to insert first [MenuBar] item at.
</member>
<member name="switch_on_hover" type="bool" setter="set_switch_on_hover" getter="is_switch_on_hover" default="true">
If [code]true[/code], when the cursor hovers above menu item, it will close the current [PopupMenu] and open the other one.
</member>
<member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0">
Base text writing direction.
</member>
</members>
<theme_items>
<theme_item name="font_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)">
Default text [Color] of the menu item.
</theme_item>
<theme_item name="font_disabled_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 0.5)">
Text [Color] used when the menu item is disabled.
</theme_item>
<theme_item name="font_focus_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)">
Text [Color] used when the menu item is focused. Only replaces the normal text color of the menu item. Disabled, hovered, and pressed states take precedence over this color.
</theme_item>
<theme_item name="font_hover_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)">
Text [Color] used when the menu item is being hovered.
</theme_item>
<theme_item name="font_hover_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
Text [Color] used when the menu item is being hovered and pressed.
</theme_item>
<theme_item name="font_outline_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
The tint of text outline of the menu item.
</theme_item>
<theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
Text [Color] used when the menu item is being pressed.
</theme_item>
<theme_item name="h_separation" data_type="constant" type="int" default="4">
The horizontal space between menu items.
</theme_item>
<theme_item name="outline_size" data_type="constant" type="int" default="0">
The size of the text outline.
</theme_item>
<theme_item name="font" data_type="font" type="Font">
[Font] of the menu item's text.
</theme_item>
<theme_item name="font_size" data_type="font_size" type="int">
Font size of the menu item's text.
</theme_item>
<theme_item name="disabled" data_type="style" type="StyleBox">
[StyleBox] used when the menu item is disabled.
</theme_item>
<theme_item name="focus" data_type="style" type="StyleBox">
[StyleBox] used when the menu item is focused. The [code]focus[/code] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.
</theme_item>
<theme_item name="hover" data_type="style" type="StyleBox">
[StyleBox] used when the menu item is being hovered.
</theme_item>
<theme_item name="normal" data_type="style" type="StyleBox">
Default [StyleBox] for the menu item.
</theme_item>
<theme_item name="pressed" data_type="style" type="StyleBox">
[StyleBox] used when the menu item is being pressed.
</theme_item>
</theme_items>
</class>
|