xtd
1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
xtd.forms
include
xtd
forms
context_menu.hpp
Go to the documentation of this file.
1
4
#pragma once
5
#include "
menu.hpp
"
6
#include "
message.hpp
"
7
#include <xtd/drawing/point>
8
10
namespace
xtd
{
12
namespace
forms
{
14
class
control
;
16
35
class
forms_export_
context_menu
:
public
xtd::forms::menu
{
36
public
:
38
41
using
menu_item_collection
= std::vector<xtd::forms::menu_item_ref>;
43
45
48
context_menu
();
51
explicit
context_menu
(
const
menu_item_collection
&
menu_items
);
53
55
explicit
context_menu
(
const
std::initializer_list<xtd::forms::const_menu_item_ref>&
menu_items
);
56
context_menu
(
context_menu
&&) =
default
;
57
context_menu
(
const
context_menu
&) =
default
;
58
context_menu
& operator =(
const
context_menu
&) =
default
;
59
~context_menu
();
61
63
69
auto
show
(
const
xtd::forms::control
& control,
const
xtd::drawing::point
& pos) -> void;
72
protected
:
74
76
[[nodiscard]]
auto
create_menu_handle
() ->
xtd::intptr
override
;
77
auto
destroy_menu_handle
(
intptr
handle
) ->
void
override
;
78
auto
on_item_added(
xtd::usize
pos,
menu_item_ref
item) ->
void
override
;
79
auto
on_item_removed(
xtd::usize
pos,
menu_item_ref
item) ->
void
override
;
81
82
private
:
83
friend
class
control;
84
[[nodiscard]]
auto
on_item_click(
intptr
menu_id) -> bool;
85
};
86
}
87
}
xtd::forms::context_menu::menu_item_collection
std::vector< xtd::forms::menu_item_ref > menu_item_collection
Represents menu items collection.
Definition
context_menu.hpp:41
xtd::forms::context_menu::create_menu_handle
auto create_menu_handle() -> xtd::intptr override
Creates a new handle to the Menu.
xtd::forms::context_menu::show
auto show(const xtd::forms::control &control, const xtd::drawing::point &pos) -> void
Displays the shortcut menu at the specified position.
xtd::forms::context_menu::context_menu
context_menu()
Initialize context_menu class.
xtd::forms::context_menu::context_menu
context_menu(const menu_item_collection &menu_items)
Initialize a new instance of context_menu class.
xtd::forms::context_menu::destroy_menu_handle
auto destroy_menu_handle(intptr handle) -> void override
Destroys the handle to the Menu.
xtd::forms::control
Defines the base class for controls, which are components with visual representation.
Definition
control.hpp:81
xtd::forms::menu
Represents the base functionality for all menus. Although tool_strip_drop_down and tool_strip_drop_do...
Definition
menu.hpp:37
xtd::forms::menu::menu_items
auto menu_items() const noexcept -> const menu_item_collection &
Gets a value indicating the collection of menu_item objects associated with the menu.
xtd::forms::menu::handle
auto handle() const noexcept -> xtd::intptr
Gets a value representing the window handle for the menu.
forms_export_
#define forms_export_
Define shared library export.
Definition
forms_export.hpp:13
xtd::intptr
std::intmax_t intptr
Represent a pointer or a handle.
Definition
intptr.hpp:23
xtd::usize
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition
usize.hpp:22
xtd::forms::menu_item_ref
xtd::ref< xtd::forms::menu_item > menu_item_ref
Represents a menu item reference.
Definition
menu_item_ref.hpp:23
menu.hpp
Contains xtd::forms::menu menu.
message.hpp
Contains xtd::forms::message class.
xtd::forms
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition
texts.hpp:219
xtd
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition
abstract_object.hpp:8
xtd::drawing::point
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition
point.hpp:54
Generated on
for xtd by
Gammasoft
. All rights reserved.