⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Wt
All Projects
Wt
Overview
Activity
Roadmap
Issues
Wiki
Forums
Download (907 Bytes)
Bug #1812
ยป test.cpp
Max Quatember
, 04/04/2013 02:00 PM
namespace
{
class
DiaReject
:
public
Wt
::
WDialog
{
public:
Wt
::
WPushButton
*
button
;
DiaReject
(
Wt
::
WPushButton
*
b
)
{
button
=
b
;
auto
line
=
new
Wt
::
WLineEdit
;
setWindowTitle
(
"press escape! (it should not close the dialog!)"
);
line
->
setFocus
();
contents
()
->
addWidget
(
line
);
}
virtual
void
reject
()
override
{
button
->
setText
(
"rejected"
);
}
};
class
TestDiaLineEdit
:
public
Wt
::
WApplication
{
public:
Wt
::
WPushButton
*
button
;
TestDiaLineEdit
(
const
Wt
::
WEnvironment
&
env
)
:
Wt
::
WApplication
(
env
)
{
button
=
new
Wt
::
WPushButton
(
"click"
);
root
()
->
addWidget
(
button
);
button
->
clicked
().
connect
(
[
&
](...)
{
static
int
c
=
0
;
if
(
c
==
2
)
button
->
setText
(
"now close the browser tab, the server crashes..."
);
c
++
;
DiaReject
dia
(
button
);
dia
.
exec
();
});
}
};
}
(1-1/1)
Loading...