xtd - Reference Guide  0.1.2
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
main_menu.h
Go to the documentation of this file.
1
4#pragma once
5#include "menu_item.h"
6#include "message.h"
7#include "theme_images.h"
8#include <xtd/drawing/size.h>
9
11namespace xtd {
13 namespace forms {
15 class form;
17
30 class forms_export_ main_menu : public menu {
31 public:
36 main_menu(const std::vector<menu_item>& menu_items);
38 main_menu(const std::initializer_list<menu_item>& menu_items);
39 ~main_menu();
41
68
70 template<typename on_click_type>
71 static xtd::forms::main_menu create_standard_items(on_click_type on_click) {return create_standard_items(xtd::event_handler(on_click));}
72 template<typename on_click_type>
73 static xtd::forms::main_menu create_standard_items(const xtd::drawing::size& size, on_click_type on_click) {return create_standard_items(size, xtd::event_handler(on_click));}
74 template<typename on_click_type>
75 static xtd::forms::main_menu create_standard_items(const xtd::ustring& theme, on_click_type on_click) {return create_standard_items(theme, xtd::event_handler(on_click));}
76 template<typename on_click_type>
77 static xtd::forms::main_menu create_standard_items(const xtd::ustring& theme, const xtd::drawing::size& size, on_click_type on_click) {return create_standard_items(theme, size, xtd::event_handler(on_click));}
78 template<typename on_click_type>
79 static xtd::forms::main_menu create_standard_items(const xtd::forms::theme_images& theme, const xtd::drawing::size& size, on_click_type on_click) {return create_standard_items(theme, size, xtd::event_handler(on_click));}
81
82 protected:
83 intptr_t create_menu_handle() override;
84
85 void destroy_menu_handle(intptr_t handle) override;
86
87 private:
88 friend class form;
89 void wm_click(message& message);
90 };
91 }
92}
Stores an ordered pair of integers, which specify a height and width.
Definition size.h:25
Represents a window or dialog box that makes up an application's user interface.
Definition form.h:40
Represents the menu structure of a form.
Definition main_menu.h:30
main_menu(const std::vector< menu_item > &menu_items)
Initialize a new instance of main_menu class.
static xtd::forms::main_menu create_standard_items(const xtd::event_handler &on_click)
A factory to create a main menu with specified on click event handler.
intptr_t create_menu_handle() override
Creates a new handle to the Menu.
main_menu()
Initialize a new instance of main_menu class.
void destroy_menu_handle(intptr_t handle) override
Destroy the handle to the Menu.
static xtd::forms::main_menu create_standard_items(const xtd::ustring &theme, const xtd::drawing::size &size, const xtd::event_handler &on_click)
A factory to create a main menu with specified theme, image size and on click event handler.
static xtd::forms::main_menu create_standard_items(const xtd::forms::theme_images &theme, const xtd::drawing::size &size, const xtd::event_handler &on_click)
A factory to create a main menu with specified theme, image size and on click event handler.
static xtd::forms::main_menu create_standard_items(const xtd::drawing::size &image_size, const xtd::event_handler &on_click)
A factory to create a main menu with specified image size and on click event handler.
static xtd::forms::main_menu create_standard_items(const xtd::ustring &theme, const xtd::event_handler &on_click)
A factory to create a main menu with specified theme and on click event handler.
Represents the base functionality for all menus. Although tool_strip_drop_down and tool_strip_drop_do...
Definition menu.h:32
Implements a Windows message.
Definition message.h:25
Definition theme_images.h:14
Definition theme.h:14
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:48
generic_event_handler<> event_handler
Represents the method that will handle an event that has no event data.
Definition event_handler.h:33
#define forms_export_
Define shared library export.
Definition forms_export.h:13
size_t size
Represents a size of any object in bytes.
Definition types.h:171
Contains xtd::forms::menu_item menu.
Contains xtd::forms::message class.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition about_box.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition system_report.h:17
Contains xtd::drawing::size class.
Contains xtd::forms::theme_images class.