diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-08-01 12:28:16 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-08-18 22:25:44 +0300 |
commit | 8c56a7416b423e4fa3bf0a3a143fe4afbb8e7ba2 (patch) | |
tree | 434138e74dd299292e8997a8000d135bc6198812 /doc/classes/MenuBar.xml | |
parent | 9bb6cc591c598f41ad718760e17f6c8847797ed0 (diff) |
Implement `MenuBar` control to wrap `PopupMenu`s or native menu, use native menu for editor.
Diffstat (limited to 'doc/classes/MenuBar.xml')
-rw-r--r-- | doc/classes/MenuBar.xml | 172 |
1 files changed, 172 insertions, 0 deletions
diff --git a/doc/classes/MenuBar.xml b/doc/classes/MenuBar.xml new file mode 100644 index 0000000000..3ef0572e9f --- /dev/null +++ b/doc/classes/MenuBar.xml @@ -0,0 +1,172 @@ +<?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="shortcut_context" type="Node" setter="set_shortcut_context" getter="get_shortcut_context"> + The [Node] which must be a parent of the focused GUI [Control] for the shortcut to be activated. If [code]null[/code], the shortcut can be activated when any control is focused (a global shortcut). This allows shortcuts to be accepted only when the user has a certain area of the GUI focused. + </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> |