⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Wt
All Projects
Wt
Overview
Activity
Roadmap
Issues
Wiki
Forums
Download (901 Bytes)
Bug #11103
ยป popup_submenu.cpp
Max Quatember
, 11/23/2022 09:53 AM
class
TestPopupSubMenu
:
public
Wt
::
WApplication
{
public:
TestPopupSubMenu
(
const
Wt
::
WEnvironment
&
env
)
:
Wt
::
WApplication
(
env
)
{
auto
b
=
root
()
->
addNew
<
Wt
::
WPushButton
>
(
"show WPopupMenu"
);
b
->
clicked
().
connect
(
[
=
](
const
Wt
::
WMouseEvent
&
me
)
{
auto
popup
=
root
()
->
addChild
(
std
::
make_unique
<
Wt
::
WPopupMenu
>
());
auto
item
=
popup
->
addItem
(
"0"
);
item
->
triggered
().
connect
(
[
=
]
{
root
()
->
addNew
<
Wt
::
WBreak
>
();
root
()
->
addNew
<
Wt
::
WLabel
>
(
"triggered 0"
);
});
auto
sub
=
std
::
make_unique
<
Wt
::
WPopupMenu
>
();
auto
subItem
=
sub
->
addItem
(
"1"
);
subItem
->
triggered
().
connect
(
[
=
]
{
root
()
->
addNew
<
Wt
::
WBreak
>
();
root
()
->
addNew
<
Wt
::
WLabel
>
(
"triggered 1"
);
});
item
->
setMenu
(
std
::
move
(
sub
)
);
item
->
setSelectable
(
true
);
popup
->
popup
(
me
);
});
}
};
(1-1/1)
Loading...