Project

General

Profile

Bug #3445 » test_20140708a_layout_display_none.C

Bruce Toll, 07/08/2014 08:37 PM

 
1
#include <Wt/WApplication>
2
#include <Wt/WEnvironment>
3
#include <Wt/WContainerWidget>
4
#include <Wt/WTabWidget>
5
#include <Wt/WVBoxLayout>
6
#include <Wt/WText>
7

    
8
using namespace Wt;
9

    
10
class TestApplication : public WApplication
11
{
12
public:
13
  TestApplication(const WEnvironment& env);
14
};
15

    
16
TestApplication::TestApplication(const WEnvironment& env) : WApplication(env)
17
{
18
  setTitle("Layout with display none");
19

    
20
  auto root_layout = new WVBoxLayout();
21
  root()->setLayout(root_layout);
22

    
23
  auto tab2_container = new WContainerWidget();
24
  auto tab2_layout = new WVBoxLayout();
25
  auto tab2_subtab = new WTabWidget();
26
  tab2_subtab->addTab(new WText("subtab 1"), "subtab1");
27
  tab2_container->setLayout(tab2_layout);
28
  tab2_layout->addWidget(tab2_subtab);
29
  tab2_subtab->hide();
30

    
31
  auto tab_widget = new WTabWidget();
32
  tab_widget->addTab(new WText("tab1 text"), "tab1");
33
  tab_widget->addTab(tab2_container, "tab2 (click for error)");
34

    
35
  root_layout->addWidget(tab_widget);
36
}
37

    
38
int main(int argc, char **argv)
39
{
40
  return WRun(argc, argv, [](const WEnvironment& env) {return new TestApplication(env);});
41
}
(1-1/2)