123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- /*
- * Copyright (C) 2008 Emweb bvba
- *
- * See the LICENSE file for terms of use.
- */
- #include "DeferredWidget.h"
- #include "GraphicsWidgets.h"
- #include "TopicTemplate.h"
- #include <Wt/WAbstractItemModel>
- #include <Wt/WImage>
- #include <Wt/WStandardItem>
- #include <Wt/WStandardItemModel>
- GraphicsWidgets::GraphicsWidgets()
- : TopicWidget()
- {
- addText(tr("graphics-intro"), this);
- }
- 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("Axis slider widget",
- deferCreate(boost::bind
- (&GraphicsWidgets::axisSliderWidget, 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)));
- menu->addItem("3D numerical chart",
- deferCreate(boost::bind
- (&GraphicsWidgets::numCharts3d, this)));
- menu->addItem("3D category chart",
- deferCreate(boost::bind
- (&GraphicsWidgets::catCharts3d, this)));
- }
- #include "examples/PaintingEvent.cpp"
- #include "examples/PaintingShapes.cpp"
- #include "examples/PaintingTransformations.cpp"
- #include "examples/PaintingClipping.cpp"
- #include "examples/PaintingStyle.cpp"
- #include "examples/PaintingImages.cpp"
- #include "examples/PaintingInteractive.cpp"
- Wt::WWidget *GraphicsWidgets::painting2d()
- {
- Wt::WTemplate *result = new TopicTemplate("graphics-Painting2D");
- result->bindWidget("PaintingEvent", PaintingEvent());
- result->bindWidget("PaintingShapes", PaintingShapes());
- result->bindWidget("PaintingTransformations", PaintingTransformations());
- result->bindWidget("PaintingClipping", PaintingClipping());
- result->bindWidget("PaintingStyle", PaintingStyle());
- result->bindWidget("PaintingImages", PaintingImages());
- result->bindWidget("PaintingInteractive", PaintingInteractive());
- return result;
- }
- #include "examples/Paintbrush.cpp"
- Wt::WWidget *GraphicsWidgets::paintbrush()
- {
- Wt::WTemplate *result = new TopicTemplate("graphics-Paintbrush");
- result->bindWidget("Paintbrush", Paintbrush());
- return result;
- }
- #include "examples/CategoryChart.cpp"
- Wt::WWidget *GraphicsWidgets::categoryChart()
- {
- Wt::WTemplate *result = new TopicTemplate("graphics-CategoryChart");
- result->bindWidget("CategoryChart", CategoryChart());
- return result;
- }
- #include "examples/ScatterPlotData.cpp"
- #include "examples/ScatterPlotCurve.cpp"
- #include "examples/ScatterPlotInteractive.cpp"
- Wt::WWidget *GraphicsWidgets::scatterPlot()
- {
- Wt::WTemplate *result = new TopicTemplate("graphics-ScatterPlot");
- result->bindWidget("ScatterPlotData", ScatterPlotData());
- result->bindWidget("ScatterPlotCurve", ScatterPlotCurve());
- result->bindWidget("ScatterPlotInteractive", ScatterPlotInteractive());
- return result;
- }
- #include "examples/AxisSliderWidget.cpp"
- #include "examples/AxisSliderWidgetDifferentDataSeries.cpp"
- Wt::WWidget *GraphicsWidgets::axisSliderWidget()
- {
- Wt::WTemplate *result = new TopicTemplate("graphics-AxisSliderWidget");
- result->bindWidget("AxisSliderWidget", AxisSliderWidget());
- result->bindWidget("AxisSliderWidgetDifferentDataSeries", AxisSliderWidgetDifferentDataSeries());
- return result;
- }
- #include "examples/PieChart.cpp"
- Wt::WWidget *GraphicsWidgets::pieChart()
- {
- Wt::WTemplate *result = new TopicTemplate("graphics-PieChart");
- result->bindWidget("PieChart", PieChart());
- return result;
- }
- #include "examples/GoogleMap.cpp"
- Wt::WWidget *GraphicsWidgets::googleMap()
- {
- Wt::WTemplate *result = new TopicTemplate("graphics-GoogleMap");
- result->bindWidget("GoogleMap", GoogleMap());
- // Show the XML-template as text
- result->bindString("GoogleMap-controls",
- reindent(tr("graphics-GoogleMap-controls")),
- Wt::PlainText);
- return result;
- }
- #include "examples/Painting3D.cpp"
- Wt::WWidget *GraphicsWidgets::painting3d()
- {
- Wt::WTemplate *result = new TopicTemplate("graphics-Painting3D");
- result->bindWidget("Painting3D", Painting3D());
- return result;
- }
- #include "examples/NumericalCharts3D.cpp"
- Wt::WWidget *GraphicsWidgets::numCharts3d()
- {
- Wt::WTemplate *result = new TopicTemplate("graphics-NumCharts3D");
- result->bindWidget("NumericalCharts3D", NumChart3d());
-
- return result;
- }
- #include "examples/CategoryCharts3D.cpp"
- Wt::WWidget *GraphicsWidgets::catCharts3d()
- {
- Wt::WTemplate *result = new TopicTemplate("graphics-CatCharts3D");
- result->bindWidget("CategoryCharts3D", CatChart3d());
- return result;
- }
|