1
|
#include <Wt/WServer>
|
2
|
#include <Wt/WEnvironment>
|
3
|
#include <Wt/WContainerWidget>
|
4
|
#include <Wt/WText>
|
5
|
#include <Wt/WBreak>
|
6
|
#include <Wt/WMenuItem>
|
7
|
#include <Wt/WTabWidget>
|
8
|
#include <Wt/WTextArea>
|
9
|
|
10
|
using namespace Wt;
|
11
|
|
12
|
class TestApplication : public WApplication
|
13
|
{
|
14
|
public:
|
15
|
TestApplication(const WEnvironment& env);
|
16
|
~TestApplication();
|
17
|
|
18
|
private:
|
19
|
};
|
20
|
|
21
|
TestApplication::TestApplication(const WEnvironment& env)
|
22
|
: WApplication(env)
|
23
|
{
|
24
|
setTitle("tabwidget without js issue");
|
25
|
setCssTheme("polished");
|
26
|
|
27
|
WContainerWidget *w = new WContainerWidget(root());
|
28
|
new WText("TabWidget does not work correctly wihtout javascript", w);
|
29
|
|
30
|
new WBreak(w);
|
31
|
|
32
|
WTabWidget *tabW = new WTabWidget(w);
|
33
|
tabW->addTab(new WTextArea("This is the contents of the first tab."),
|
34
|
"First", WTabWidget::PreLoading);
|
35
|
tabW->addTab(new WTextArea("The contents of the tabs are pre-loaded in"
|
36
|
" the browser to ensure swift switching."),
|
37
|
"Preload", WTabWidget::PreLoading);
|
38
|
tabW->addTab(new WTextArea("You could change any other style attribute of the"
|
39
|
" tab widget by modifying the style class."
|
40
|
" The style class 'trhead' is applied to this tab."),
|
41
|
"Style", WTabWidget::PreLoading);
|
42
|
|
43
|
WMenuItem *tab
|
44
|
= tabW->addTab(new WTextArea("You can close this tab"
|
45
|
" by clicking on the close icon."),
|
46
|
"Close");
|
47
|
tab->setCloseable(true);
|
48
|
|
49
|
// tabW->setStyleClass("tabwidget");
|
50
|
}
|
51
|
|
52
|
TestApplication::~TestApplication()
|
53
|
{
|
54
|
}
|
55
|
|
56
|
WApplication *createApplication(const WEnvironment& env)
|
57
|
{
|
58
|
return new TestApplication(env);
|
59
|
}
|
60
|
|
61
|
int main(int argc, char **argv)
|
62
|
{
|
63
|
int status = WRun(argc, argv, &createApplication);
|
64
|
return status;
|
65
|
}
|