#include <menu.h>
Represents the base functionality for all menus. Although tool_strip_drop_down and tool_strip_drop_down_menu replace and add functionality to the menu control of previous versions, menu is retained for both backward compatibility and future use if you choose.
- Namespace
- xtd::forms
- Library
- xtd.forms
Inherits xtd::forms::component.
Inherited by xtd::forms::context_menu, xtd::forms::main_menu, and xtd::forms::menu_item.
|
static constexpr const int | find_handle |
| Specifies that the find_menu_item(int32_t, intptr_t) method should search for a handle. More...
|
|
static constexpr const int | find_shortcut |
| Specifies that the find_menu_item(int32_t, intptr_t) method should search for a shortcut. More...
|
|
|
static bool | equals (const object &object_a, const object &object_b) noexcept |
| Determines whether the specified object instances are considered equal. More...
|
|
static bool | reference_equals (const object &object_a, const object &object_b) noexcept |
| Determines whether the specified object instances are the same instance. More...
|
|
◆ menu_item_collection
Represents a collection of menu_item objects.
◆ menu() [1/2]
xtd::forms::menu::menu |
( |
| ) |
|
|
protected |
Initializes a new instance of the Menu class.
◆ menu() [2/2]
Initializes a new instance of the Menu class.
- Parameters
-
items | An array of type MenuItem containing the objects to add to the menu. |
◆ clone_menu()
void xtd::forms::menu::clone_menu |
( |
const menu & |
menu_src | ) |
|
|
protected |
Copies the menu that is passed as a parameter to the current menu.
- Parameters
-
menu_src | The Menu to copy. |
◆ create_menu_handle()
virtual intptr_t xtd::forms::menu::create_menu_handle |
( |
| ) |
|
|
protectedpure virtual |
◆ destroy_menu_handle()
virtual void xtd::forms::menu::destroy_menu_handle |
( |
intptr_t |
handle | ) |
|
|
protectedpure virtual |
◆ get_context_menu()
std::optional<context_menu> xtd::forms::menu::get_context_menu |
( |
| ) |
const |
Gets the context_menu that contains this menu.
- Returns
- The context_menu that contains this menu. The default is no value.
◆ get_main_menu()
std::optional<main_menu> xtd::forms::menu::get_main_menu |
( |
| ) |
const |
Gets the main_menu that contains this menu.
- Returns
- The main_menu that contains this menu. The default is has no value.
◆ handle()
intptr_t xtd::forms::menu::handle |
( |
| ) |
const |
|
inline |
Gets a value representing the window handle for the menu.
- Returns
- The HMENU value of the menu.
◆ is_parent()
bool xtd::forms::menu::is_parent |
( |
| ) |
const |
Gets a value indicating whether this menu contains any menu items.
- Returns
- true if this menu contains menu_item objects; otherwise, false. The default is false.
◆ mdi_list_item()
const menu_item& xtd::forms::menu::mdi_list_item |
( |
| ) |
const |
Gets a value indicating the menu_item that is used to display a list of multiple document interface (MDI) child forms.
- Returns
- A MenuItem that represents the menu item displaying a list of MDI child forms that are open in the application.
◆ menu_items() [1/3]
◆ menu_items() [2/3]
◆ menu_items() [3/3]
Sets a value indicating the collection of menu_item objects associated with the menu.
- Parameters
-
- Returns
- Current menu class.
◆ merge_menu()
virtual void xtd::forms::menu::merge_menu |
( |
const menu & |
menu_src | ) |
|
|
virtual |
Merges the MenuItem objects of one menu with the current menu.
- Parameters
-
menu_src | The menu whose menu items are merged with the menu items of the current menu. |
- Exceptions
-
std::invalid_argument | It was attempted to merge the menu with itself. |
◆ name() [1/2]
Gets the name of the menu.
- Returns
- A string representing the name.
◆ name() [2/2]
Sets the name of the menu.
- Parameters
-
value | A string representing the name. |
- Returns
- Current menu class.
◆ tag() [1/2]
std::any xtd::forms::menu::tag |
( |
| ) |
const |
|
inline |
Gets user-defined data associated with the control.
- Returns
- An object representing the data.
◆ tag() [2/2]
menu& xtd::forms::menu::tag |
( |
std::any |
value | ) |
|
|
inline |
Sets user-defined data associated with the control.
- Parameters
-
value | An object representing the data. |
- Returns
- Current menu class.
◆ to_string()
Returns a string that represents the menu control.
- Returns
- A string that represents the current menu.
Reimplemented from xtd::object.
Reimplemented in xtd::forms::menu_item.
◆ find_handle
constexpr const int xtd::forms::menu::find_handle |
|
staticconstexpr |
Specifies that the find_menu_item(int32_t, intptr_t) method should search for a handle.
◆ find_shortcut
constexpr const int xtd::forms::menu::find_shortcut |
|
staticconstexpr |
Specifies that the find_menu_item(int32_t, intptr_t) method should search for a shortcut.
The documentation for this class was generated from the following file:
- xtd.forms/include/xtd/forms/menu.h