From 595995a5a7d5b0862cce1d198b8abf823e0f0c34 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Tue, 22 Mar 2022 11:26:36 +0200 Subject: [macOS] Add missing global menu features. --- doc/classes/DisplayServer.xml | 329 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 325 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 5a67170086..47bc496100 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -136,7 +136,74 @@ + + + Adds a new checkable item with text [code]label[/code] to the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] + + + + + + + + + + + + + Adds a new checkable item with text [code]label[/code] and icon [code]icon[/code] to the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] + + + + + + + + + + + + + Adds a new item with text [code]label[/code] and icon [code]icon[/code] to the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] + + + + + + + + + + + + + Adds a new radio-checkable item with text [code]label[/code] and icon [code]icon[/code] to the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method global_menu_set_item_checked] for more info on how to control it. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] @@ -145,13 +212,70 @@ + + + + Adds a new item with text [code]label[/code] to the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] + + + + + + + + + + + + + + Adds a new item with text [code]label[/code] to the global menu with ID [code]menu_root[/code]. + Contrarily to normal binary items, multistate items can have more than two states, as defined by [code]max_states[/code]. Each press or activate of the item will increase the state by one. The default value is defined by [code]default_state[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] + + + + + + + + + + + Adds a new radio-checkable item with text [code]label[/code] to the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method global_menu_set_item_checked] for more info on how to control it. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] + + Adds a separator between items to the global menu with ID [code]menu_root[/code]. Separators also occupy an index. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] @@ -159,41 +283,127 @@ + + Adds an item that will act as a submenu of the global menu [code]menu_root[/code]. The [code]submenu[/code] argument is the ID of the global menu root that will be shown when the item is clicked. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] + Removes all items from the global menu with ID [code]menu_root[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Supported system menu IDs:[/b] + [codeblock] + "" - Main menu (macOS). + "_dock" - Dock popup menu (macOS). + [/codeblock] - + + + + + + Returns the accelerator of the item at index [code]idx[/code]. Accelerators are special combinations of keys that activate the item, no matter which control is focused. + [b]Note:[/b] This method is implemented on macOS. + + + + Returns the callback of the item at index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. + + + + + + + + Returns the icon of the item at index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. + + + + + + + + Returns the index of the item with the specified [code]tag[/code]. Index is automatically assigned to each item by the engine. Index can not be set manually. + [b]Note:[/b] This method is implemented on macOS. - + + + + + + Returns the index of the item with the specified [code]text[/code]. Index is automatically assigned to each item by the engine. Index can not be set manually. + [b]Note:[/b] This method is implemented on macOS. + + + + + + + + Returns number of states of an multistate item. See [method global_menu_add_multistate_item] for details. + [b]Note:[/b] This method is implemented on macOS. + + + + + + + + Returns the state of an multistate item. See [method global_menu_add_multistate_item] for details. + [b]Note:[/b] This method is implemented on macOS. + + + + Returns the submenu ID of the item at index [code]idx[/code]. See [method global_menu_add_submenu_item] for more info on how to add a submenu. + [b]Note:[/b] This method is implemented on macOS. - + + Returns the metadata of the specified item, which might be of any type. You can set it with [method global_menu_set_item_tag], which provides a simple way of assigning context data to items. + [b]Note:[/b] This method is implemented on macOS. - + + Returns the text of the item at index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. + + + + + + + + Returns the tooltip associated with the specified index index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. @@ -201,6 +411,8 @@ + Returns [code]true[/code] if the item at index [code]idx[/code] is checkable in some way, i.e. if it has a checkbox or radio button. + [b]Note:[/b] This method is implemented on macOS. @@ -208,6 +420,28 @@ + Returns [code]true[/code] if the item at index [code]idx[/code] is checked. + [b]Note:[/b] This method is implemented on macOS. + + + + + + + + Returns [code]true[/code] if the item at index [code]idx[/code] is disabled. When it is disabled it can't be selected, or its action invoked. + See [method global_menu_set_item_disabled] for more info on how to disable an item. + [b]Note:[/b] This method is implemented on macOS. + + + + + + + + Returns [code]true[/code] if the item at index [code]idx[/code] has radio button-style checkability. + [b]Note:[/b] This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups. + [b]Note:[/b] This method is implemented on macOS. @@ -215,6 +449,19 @@ + Removes the item at index [code]idx[/code] from the global menu [code]menu_root[/code]. + [b]Note:[/b] The indices of items after the removed item will be shifted by one. + [b]Note:[/b] This method is implemented on macOS. + + + + + + + + + Sets the accelerator of the item at index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. @@ -223,6 +470,8 @@ + Sets the callback of the item at index [code]idx[/code]. Callback is emitted when an item is pressed or its accelerator is activated. + [b]Note:[/b] This method is implemented on macOS. @@ -231,6 +480,8 @@ + Sets whether the item at index [code]idx[/code] has a checkbox. If [code]false[/code], sets the type of the item to plain text. + [b]Note:[/b] This method is implemented on macOS. @@ -239,6 +490,60 @@ + Sets the checkstate status of the item at index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. + + + + + + + + + Enables/disables the item at index [code]idx[/code]. When it is disabled, it can't be selected and its action can't be invoked. + [b]Note:[/b] This method is implemented on macOS. + + + + + + + + + Replaces the [Texture2D] icon of the specified [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. + [b]Note:[/b] This method is not supported by macOS "_dock" menu items. + + + + + + + + + Sets number of state of an multistate item. See [method global_menu_add_multistate_item] for details. + [b]Note:[/b] This method is implemented on macOS. + + + + + + + + + Sets the type of the item at the specified index [code]idx[/code] to radio button. If [code]false[/code], sets the type of the item to plain text + [b]Note:[/b] This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups. + [b]Note:[/b] This method is implemented on macOS. + + + + + + + + + Sets the state of an multistate item. See [method global_menu_add_multistate_item] for details. + [b]Note:[/b] This method is implemented on macOS. @@ -247,6 +552,8 @@ + Sets the submenu of the item at index [code]idx[/code]. The submenu is the ID of a global menu root that would be shown when the item is clicked. + [b]Note:[/b] This method is implemented on macOS. @@ -255,6 +562,8 @@ + Sets the metadata of an item, which may be of any type. You can later get it with [method global_menu_get_item_tag], which provides a simple way of assigning context data to items. + [b]Note:[/b] This method is implemented on macOS. @@ -263,6 +572,18 @@ + Sets the text of the item at index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. + + + + + + + + + Sets the [String] tooltip of the item at the specified index [code]idx[/code]. + [b]Note:[/b] This method is implemented on macOS. -- cgit v1.2.3