コード例 #1
0
ファイル: WTreeTable.C プロジェクト: kdeforche/wt
WTreeTable::WTreeTable()
{
  setImplementation(std::unique_ptr<WContainerWidget>(impl_ = new WContainerWidget()));

  setStyleClass("Wt-treetable");
  setPositionScheme(PositionScheme::Relative);

  headers_ = impl_->addWidget(cpp14::make_unique<WContainerWidget>());
  headers_->setStyleClass("Wt-header header");

  /*
   * spacer for when a scroll bar is visible
   */
  WContainerWidget *spacer
    = headers_->addWidget(cpp14::make_unique<WContainerWidget>());
  spacer->setStyleClass("Wt-sbspacer");

  headerContainer_
    = headers_->addWidget(cpp14::make_unique<WContainerWidget>());
  headerContainer_->setFloatSide(Side::Right);

  headers_->addWidget(cpp14::make_unique<WText>());
  columnWidths_.push_back(WLength::Auto);

  WContainerWidget *content
    = impl_->addWidget(cpp14::make_unique<WContainerWidget>());
  content->setStyleClass("Wt-content");
  if (!wApp->environment().agentIsIE())
    content->setOverflow(Overflow::Auto);
  else
    content->setAttributeValue
      ("style", "overflow-y: auto; overflow-x: hidden; zoom: 1");

  tree_ = content->addWidget(cpp14::make_unique<WTree>());
  tree_->setMargin(3, Side::Top);
  tree_->resize(WLength(100, LengthUnit::Percentage), WLength::Auto);
}
コード例 #2
0
ファイル: WTreeTable.C プロジェクト: LifeGo/wt
WTreeTable::WTreeTable(WContainerWidget *parent)
  : WCompositeWidget(parent)
{
  setImplementation(impl_ = new WContainerWidget());

  setStyleClass("Wt-treetable");
  setPositionScheme(Relative);

  headers_ = new WContainerWidget(impl_);
  headers_->setStyleClass("Wt-header header");

  /*
   * spacer for when a scroll bar is visible
   */
  WContainerWidget *spacer = new WContainerWidget(headers_);
  spacer->setStyleClass("Wt-sbspacer");

  headerContainer_ = new WContainerWidget(headers_);
  headerContainer_->setFloatSide(Right);

  headers_->addWidget(new WText());
  columnWidths_.push_back(WLength::Auto);

  WContainerWidget *content = new WContainerWidget(impl_);
  content->setStyleClass("Wt-content");
  if (!wApp->environment().agentIsIE())
    content->setOverflow(WContainerWidget::OverflowAuto);
  else
    content->setAttributeValue
      ("style", "overflow-y: auto; overflow-x: hidden; zoom: 1");

  content->addWidget(tree_ = new WTree());

  tree_->setMargin(3, Top);
  tree_->resize(WLength(100, WLength::Percentage), WLength::Auto);
}