Ejemplo n.º 1
0
void Navigation::populateSubMenu(Wt::WMenu *menu)
{
  menu->addItem("Internal paths", internalPaths())->setPathComponent("");
  menu->addItem("Anchor", 
		deferCreate(boost::bind
			    (&Navigation::anchor, this)));
  menu->addItem("Stacked widget", 
		deferCreate(boost::bind
			    (&Navigation::stackedWidget, this)));
  menu->addItem("Menu", 
		deferCreate(boost::bind
			    (&Navigation::menuWidget, this)));
  menu->addItem("Tab widget", 
		deferCreate(boost::bind
			    (&Navigation::tabWidget, this)));
  menu->addItem("Navigation bar", 
		deferCreate(boost::bind
			    (&Navigation::navigationBar, this)));
  menu->addItem("Popup menu", 
		deferCreate(boost::bind
			    (&Navigation::popupMenu, this)));
  menu->addItem("Split button", 
		deferCreate(boost::bind
			    (&Navigation::splitButton, this)));
  menu->addItem("Toolbar", 
		deferCreate(boost::bind
			    (&Navigation::toolBar, this)));
}
Ejemplo n.º 2
0
void TreesTables::populateSubMenu(Wt::WMenu *menu)
{
  menu->setInternalBasePath("/trees-tables");

  menu->addItem("Tables", tables())->setPathComponent("");
  menu->addItem("Trees",
		deferCreate(boost::bind
			    (&TreesTables::trees, this)));
  menu->addItem("Tree Tables",
		deferCreate(boost::bind
			    (&TreesTables::treeTables, this)));
  menu->addItem("MVC Table Views",
		deferCreate(boost::bind
			    (&TreesTables::tableViews, this)));
  menu->addItem("MVC Tree Views",
		deferCreate(boost::bind
			    (&TreesTables::treeViews, this)));
  menu->addItem("MVC Item models",
		deferCreate(boost::bind
			    (&TreesTables::itemModels, this)));
  // menu->addItem("Proxy item models", proxyModels());
}
Ejemplo n.º 3
0
void GraphicsWidgets::populateSubMenu(Wt::WMenu *menu)
{
  menu->setInternalBasePath("/graphics-charts");

  menu->addItem("2D painting", painting2d())->setPathComponent("");
  menu->addItem("Paintbrush", 
		deferCreate(boost::bind
			    (&GraphicsWidgets::paintbrush, this)));
  menu->addItem("Category chart", 
		deferCreate(boost::bind
			    (&GraphicsWidgets::categoryChart, this)));
  menu->addItem("Scatter plot", 
		deferCreate(boost::bind
			    (&GraphicsWidgets::scatterPlot, this)));
  menu->addItem("Pie chart", 
		deferCreate(boost::bind
			    (&GraphicsWidgets::pieChart, this)));
  menu->addItem("Maps",
                deferCreate(boost::bind
			    (&GraphicsWidgets::googleMap, this)));
  menu->addItem("3D painting", 
		deferCreate(boost::bind
			    (&GraphicsWidgets::painting3d, this)));
}
Ejemplo n.º 4
0
Archivo: Home.C Proyecto: GuLinux/wt
void Home::createHome()
{
  WTemplate *result = new WTemplate(tr("template"), root());
  homePage_ = result;

  WContainerWidget *languagesDiv = new WContainerWidget();
  languagesDiv->setId("top_languages");

  for (unsigned i = 0; i < languages.size(); ++i) {
    if (i != 0)
      new WText("- ", languagesDiv);

    const Lang& l = languages[i];

    new WAnchor(WLink(WLink::InternalPath, l.path_),
		WString::fromUTF8(l.longDescription_), languagesDiv);
  }

  WStackedWidget *contents = new WStackedWidget();
  WAnimation fade(WAnimation::Fade, WAnimation::Linear, 250);
  contents->setTransitionAnimation(fade);
  contents->setId("main_page");

  mainMenu_ = new WMenu(contents, Vertical);

  mainMenu_->addItem
    (tr("introduction"), introduction())->setPathComponent("");

  mainMenu_->addItem
    (tr("blog"), deferCreate(boost::bind(&Home::blog, this)));

  mainMenu_->addItem
    (tr("features"), wrapView(&Home::features), WMenuItem::PreLoading);

  mainMenu_->addItem
    (tr("documentation"), wrapView(&Home::documentation),
     WMenuItem::PreLoading);

  mainMenu_->addItem
    (tr("examples"), examples(),
     WMenuItem::PreLoading)->setPathComponent("examples/");

  mainMenu_->addItem
    (tr("download"), deferCreate(boost::bind(&Home::download, this)),
     WMenuItem::PreLoading);

  mainMenu_->addItem
    (tr("community"), wrapView(&Home::community), WMenuItem::PreLoading);

  mainMenu_->addItem
    (tr("other-language"), wrapView(&Home::otherLanguage),
     WMenuItem::PreLoading);

  mainMenu_->itemSelectRendered().connect(this, &Home::updateTitle);

  mainMenu_->itemSelected().connect(this, &Home::googleAnalyticsLogger);

  // Make the menu be internal-path aware.
  mainMenu_->setInternalPathEnabled("/");

  sideBarContent_ = new WContainerWidget();

  result->bindWidget("languages", languagesDiv);
  result->bindWidget("menu", mainMenu_);
  result->bindWidget("contents", contents);
  result->bindWidget("sidebar", sideBarContent_);
}
Ejemplo n.º 5
0
void FormWidgets::populateSubMenu(Wt::WMenu *menu)
{
  menu->addItem("Introduction", introduction())->setPathComponent("");
  menu->addItem("Line/Text editor",
		deferCreate(boost::bind
			    (&FormWidgets::textEditors, this)));
  menu->addItem("Check boxes", 
		deferCreate(boost::bind
			    (&FormWidgets::checkBox, this)));
  menu->addItem("Radio buttons", 
		deferCreate(boost::bind
			    (&FormWidgets::radioButton, this)));
  menu->addItem("Combo box", 
		deferCreate(boost::bind
			    (&FormWidgets::comboBox, this)));
  menu->addItem("Selection box", 
		deferCreate(boost::bind
			    (&FormWidgets::selectionBox, this)));
  menu->addItem("Autocomplete", 
		deferCreate(boost::bind
			    (&FormWidgets::autoComplete, this)));
  menu->addItem("Date entry", 
		deferCreate(boost::bind
			    (&FormWidgets::dateEntry, this)));
  menu->addItem("In-place edit", 
		deferCreate(boost::bind
			    (&FormWidgets::inPlaceEdit, this)));
  menu->addItem("Slider", 
		deferCreate(boost::bind
			    (&FormWidgets::slider, this)));
  menu->addItem("Progress bar", 
		deferCreate(boost::bind
			    (&FormWidgets::progressBar, this)));
  menu->addItem("File upload", 
		deferCreate(boost::bind
			    (&FormWidgets::fileUpload, this)));
  menu->addItem("Push button", 
		deferCreate(boost::bind
			    (&FormWidgets::pushButton, this)));
  menu->addItem("Validation", 
		deferCreate(boost::bind
			    (&FormWidgets::validation, this)));
  menu->addItem("Integration example", 
		deferCreate(boost::bind
			    (&FormWidgets::example, this)));
}