⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Wt
All Projects
Wt
Overview
Activity
Roadmap
Issues
Wiki
Forums
Download (1.29 KB)
Bug #6044
ยป issue_6044.cpp
Roel Standaert, 08/27/2018 11:41 AM
#include
<Wt/WApplication.h>
#include
<Wt/WContainerWidget.h>
#include
<Wt/WColor.h>
#include
<Wt/WCssDecorationStyle.h>
#include
<Wt/WEnvironment.h>
#include
<Wt/WHBoxLayout.h>
#include
<Wt/WServer.h>
#include
<Wt/WTabWidget.h>
#include
<Wt/WText.h>
#include
<Wt/WVBoxLayout.h>
int
main
(
int
argc
,
char
*
argv
[])
{
return
Wt
::
WRun
(
argc
,
argv
,
[](
const
Wt
::
WEnvironment
&
env
){
Wt
::
LayoutImplementation
impl
=
Wt
::
LayoutImplementation
::
Flex
;
const
std
::
string
*
const
implP
=
env
.
getParameter
(
"impl"
);
if
(
implP
)
{
if
(
*
implP
==
"flex"
)
{
impl
=
Wt
::
LayoutImplementation
::
Flex
;
}
else
if
(
*
implP
==
"js"
)
{
impl
=
Wt
::
LayoutImplementation
::
JavaScript
;
}
}
auto
app
=
std
::
make_unique
<
Wt
::
WApplication
>
(
env
);
auto
root
=
app
->
root
();
auto
layout
=
root
->
setLayout
(
std
::
make_unique
<
Wt
::
WVBoxLayout
>
());
layout
->
setPreferredImplementation
(
impl
);
auto
tabWidget
=
layout
->
addWidget
(
std
::
make_unique
<
Wt
::
WTabWidget
>
(),
1
);
auto
tab1P
=
std
::
make_unique
<
Wt
::
WContainerWidget
>
();
auto
tab1
=
tab1P
.
get
();
tabWidget
->
addTab
(
std
::
move
(
tab1P
),
Wt
::
utf8
(
"tab 1"
));
tab1
->
decorationStyle
().
setBackgroundColor
(
Wt
::
StandardColor
::
Red
);
tab1
->
addWidget
(
std
::
make_unique
<
Wt
::
WText
>
(
Wt
::
utf8
(
"Tab 1 contents"
)));
return
app
;
});
}
(1-1/1)
Loading...