xtd - Reference Guide  0.1.0
Modern c++17 framework to create console, gui and unit test applications on Windows, macOS and Linux.
xtd::forms::menu_item Class Reference
Inheritance diagram for xtd::forms::menu_item:
xtd::forms::menu xtd::forms::component

Public Types

using menu_item_collection = layout::arranged_element_collection< menu_item >
 

Public Member Functions

 menu_item (const std::string &text)
 
 menu_item (const std::string &text, xtd::forms::shortcut shortcut)
 
 menu_item (const std::string &text, const xtd::drawing::image &image)
 
 menu_item (const std::string &text, const xtd::drawing::image &image, xtd::forms::shortcut shortcut)
 
 menu_item (const std::string &text, xtd::forms::menu_item_kind kind)
 
 menu_item (const std::string &text, xtd::forms::menu_item_kind kind, xtd::forms::shortcut shortcut)
 
 menu_item (const std::string &text, const xtd::drawing::image &image, xtd::forms::menu_item_kind kind)
 
 menu_item (const std::string &text, const xtd::drawing::image &image, xtd::forms::menu_item_kind kind, xtd::forms::shortcut shortcut)
 
 menu_item (const std::string &text, xtd::forms::menu_item_kind kind, bool checked)
 
 menu_item (const std::string &text, xtd::forms::menu_item_kind kind, bool checked, xtd::forms::shortcut shortcut)
 
 menu_item (const std::string &text, const xtd::drawing::image &image, xtd::forms::menu_item_kind kind, bool checked)
 
 menu_item (const std::string &text, const xtd::drawing::image &image, xtd::forms::menu_item_kind kind, bool checked, xtd::forms::shortcut shortcut)
 
 menu_item (const std::string &text, const xtd::event_handler< xtd::forms::component &> &on_click)
 
 menu_item (const std::string &text, const xtd::event_handler< xtd::forms::component &> &on_click, xtd::forms::shortcut shortcut)
 
 menu_item (const std::string &text, const xtd::event_handler< xtd::forms::component &> &on_click, const xtd::drawing::image &image)
 
 menu_item (const std::string &text, const xtd::event_handler< xtd::forms::component &> &on_click, const xtd::drawing::image &image, xtd::forms::shortcut shortcut)
 
 menu_item (const std::string &text, const xtd::event_handler< xtd::forms::component &> &on_click, xtd::forms::menu_item_kind kind)
 
 menu_item (const std::string &text, const xtd::event_handler< xtd::forms::component &> &on_click, xtd::forms::menu_item_kind kind, xtd::forms::shortcut shortcut)
 
 menu_item (const std::string &text, const xtd::event_handler< xtd::forms::component &> &on_click, const xtd::drawing::image &image, xtd::forms::menu_item_kind kind)
 
 menu_item (const std::string &text, const xtd::event_handler< xtd::forms::component &> &on_click, const xtd::drawing::image &image, xtd::forms::menu_item_kind kind, xtd::forms::shortcut shortcut)
 
 menu_item (const std::string &text, const xtd::event_handler< xtd::forms::component &> &on_click, xtd::forms::menu_item_kind kind, bool checked)
 
 menu_item (const std::string &text, const xtd::event_handler< xtd::forms::component &> &on_click, xtd::forms::menu_item_kind kind, bool checked, xtd::forms::shortcut shortcut)
 
 menu_item (const std::string &text, const xtd::event_handler< xtd::forms::component &> &on_click, const xtd::drawing::image &image, xtd::forms::menu_item_kind kind, bool checked)
 
 menu_item (const std::string &text, const xtd::event_handler< xtd::forms::component &> &on_click, const xtd::drawing::image &image, xtd::forms::menu_item_kind kind, bool checked, xtd::forms::shortcut shortcut)
 
 menu_item (const std::string &text, const std::vector< menu_item > &items)
 
std::optional< context_menuget_context_menu () const
 Gets the context_menu that contains this menu. More...
 
std::optional< main_menuget_main_menu () const
 Gets the main_menu that contains this menu. More...
 
intptr_t handle () const
 Gets a value representing the window handle for the menu. More...
 
bool is_parent () const
 Gets a value indicating whether this menu contains any menu items. More...
 
const menu_itemmdi_list_item () const
 Gets a value indicating the menu_item that is used to display a list of multiple document interface (MDI) child forms. More...
 
int menu_id () const
 
const menu_item_collectionmenu_items () const
 Gets a value indicating the collection of menu_item objects associated with the menu. More...
 
menu_item_collectionmenu_items ()
 Gets a value indicating the collection of menu_item objects associated with the menu. More...
 
menumenu_items (const menu_item_collection &value)
 Sets a value indicating the collection of menu_item objects associated with the menu. More...
 
virtual void merge_menu (const menu &menu_src)
 Merges the MenuItem objects of one menu with the current menu. More...
 
const std::string & name () const
 Gets the name of the menu. More...
 
menuname (const std::string &value)
 Sets the name of the menu. More...
 
std::any tag () const
 Gets user-defined data associated with the control. More...
 
menutag (std::any value)
 Sets user-defined data associated with the control. More...
 
const std::string & text () const
 
std::string to_string () const
 Returns a string that represents the menu control. More...
 

Static Public Attributes

static constexpr const int find_handle = 0
 Specifies that the find_menu_item(int32_t, intptr_t) method should search for a handle. More...
 
static constexpr const int find_shortcut = 1
 Specifies that the find_menu_item(int32_t, intptr_t) method should search for a shortcut. More...
 

Protected Member Functions

virtual bool can_raise_events () const
 Gets a value indicating whether the component can raise an event. More...
 
void clone_menu (const menu &menu_src)
 Copies the menu that is passed as a parameter to the current menu. More...
 
intptr_t create_menu_handle () override
 Creates a new handle to the Menu. More...
 
bool design_mode () const
 Gets a value that indicates whether the component is currently in design mode. More...
 
void destroy_menu_handle (intptr_t handle) override
 Destroy the handle to the Menu. More...
 

Protected Attributes

bool checked_ = false
 
friend context_menu
 
xtd::drawing::image image_ = xtd::drawing::image::empty
 
xtd::forms::menu_item_kind kind_ = xtd::forms::menu_item_kind::normal
 
friend main_menu
 
xtd::forms::shortcut shortcut_ = static_cast<xtd::forms::shortcut>(0)
 
std::string text_
 

The documentation for this class was generated from the following file: