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
#include <xtd/iclonable>
9
11
namespace
xtd
{
13
namespace
forms
{
15
class
control
;
17
36
class
forms_export_
context_menu
:
public
menu
,
public
iclonable
{
37
public
:
39
42
using
menu_item_collection
= std::vector<menu_item_ref>;
44
46
49
context_menu
();
52
explicit
context_menu
(
const
menu_item_collection
&
menu_items
);
54
56
explicit
context_menu
(
const
std::initializer_list<const_menu_item_ref>&
menu_items
);
57
context_menu
(
context_menu
&&) =
default
;
58
context_menu
(
const
context_menu
&) =
default
;
59
context_menu
& operator =(
const
context_menu
&) =
default
;
60
~context_menu
();
62
64
70
void
show
(
const
xtd::forms::control
& control,
const
xtd::drawing::point
& pos);
73
protected
:
75
81
xtd::uptr<xtd::object>
clone
()
const override
;
82
83
intptr
create_menu_handle
()
override
;
84
void
destroy_menu_handle
(
intptr
handle
)
override
;
85
void
on_item_added(
xtd::usize
pos,
menu_item_ref
item)
override
;
86
void
on_item_removed(
xtd::usize
pos,
menu_item_ref
item)
override
;
88
89
private
:
90
friend
class
control;
91
bool
on_item_click(
intptr
menu_id);
92
};
93
}
94
}
xtd::forms::context_menu::menu_item_collection
std::vector< menu_item_ref > menu_item_collection
Represents menu items collection.
Definition
context_menu.hpp:42
xtd::forms::context_menu::create_menu_handle
intptr create_menu_handle() override
Creates a new handle to the Menu.
xtd::forms::context_menu::show
void show(const xtd::forms::control &control, const xtd::drawing::point &pos)
Displays the shortcut menu at the specified position.
xtd::forms::context_menu::clone
xtd::uptr< xtd::object > clone() const override
Creates a new object that is a copy of the current instance.
xtd::forms::context_menu::destroy_menu_handle
void destroy_menu_handle(intptr handle) override
Destroys the handle to the Menu.
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::control
Defines the base class for controls, which are components with visual representation.
Definition
control.hpp:82
xtd::forms::menu::menu
menu()
Initializes a new instance of the Menu class.
xtd::forms::menu::handle
intptr handle() const noexcept
Gets a value representing the window handle for the menu.
xtd::forms::menu::menu_items
const menu_item_collection & menu_items() const noexcept
Gets a value indicating the collection of menu_item objects associated with the menu.
xtd::iclonable
Supports cloning, which creates a new instance of a class with the same value as an existing instance...
Definition
iclonable.hpp:21
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::uptr
xtd::unique_ptr_object< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition
uptr.hpp:25
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< 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.