|
#include <Wt/WServer>
|
|
#include <Wt/WEnvironment>
|
|
#include <Wt/WContainerWidget>
|
|
#include <Wt/WText>
|
|
#include <Wt/WBreak>
|
|
#include <Wt/WMenuItem>
|
|
#include <Wt/WTabWidget>
|
|
#include <Wt/WTextArea>
|
|
|
|
using namespace Wt;
|
|
|
|
class TestApplication : public WApplication
|
|
{
|
|
public:
|
|
TestApplication(const WEnvironment& env);
|
|
~TestApplication();
|
|
|
|
private:
|
|
};
|
|
|
|
TestApplication::TestApplication(const WEnvironment& env)
|
|
: WApplication(env)
|
|
{
|
|
setTitle("tabwidget without js issue");
|
|
setCssTheme("polished");
|
|
|
|
WContainerWidget *w = new WContainerWidget(root());
|
|
new WText("TabWidget does not work correctly wihtout javascript", w);
|
|
|
|
new WBreak(w);
|
|
|
|
WTabWidget *tabW = new WTabWidget(w);
|
|
tabW->addTab(new WTextArea("This is the contents of the first tab."),
|
|
"First", WTabWidget::PreLoading);
|
|
tabW->addTab(new WTextArea("The contents of the tabs are pre-loaded in"
|
|
" the browser to ensure swift switching."),
|
|
"Preload", WTabWidget::PreLoading);
|
|
tabW->addTab(new WTextArea("You could change any other style attribute of the"
|
|
" tab widget by modifying the style class."
|
|
" The style class 'trhead' is applied to this tab."),
|
|
"Style", WTabWidget::PreLoading);
|
|
|
|
WMenuItem *tab
|
|
= tabW->addTab(new WTextArea("You can close this tab"
|
|
" by clicking on the close icon."),
|
|
"Close");
|
|
tab->setCloseable(true);
|
|
|
|
// tabW->setStyleClass("tabwidget");
|
|
}
|
|
|
|
TestApplication::~TestApplication()
|
|
{
|
|
}
|
|
|
|
WApplication *createApplication(const WEnvironment& env)
|
|
{
|
|
return new TestApplication(env);
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
int status = WRun(argc, argv, &createApplication);
|
|
return status;
|
|
}
|