7 #include <Wt/WContainerWidget> 8 #include <Wt/WGridLayout> 22 text +=
"<h2>Paint example</h2>";
25 "<p>A simple example demonstrating cross-browser vector graphics." 27 "<p>The emweb logo below is painted using the Wt WPainter API from " 28 "bezier paths, and rendered to the browser using inline SVG, inline VML " 29 "or the HTML 5 <canvas> element." 32 "The example also demonstrates the horizontal and vertical " 33 "<a href=\"http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WSlider.html\" target=\"_blank\">" 34 "WSlider</a> widgets. Here," 35 "the events of the WSlider widgets are used to scale and rotate the " 39 "In non-IE browsers, a different backend is used for positive or negative " 40 "angles (SVG or HTML canvas)." 43 new WText(text,
this);
57 scaleSlider->
resize(300, 50);
60 layout->
addWidget(scaleSlider, 0, 1, AlignCenter | AlignMiddle);
68 rotateSlider->
resize(50, 400);
71 layout->
addWidget(rotateSlider, 1, 0, AlignCenter | AlignMiddle);
87 : WPaintedWidget::HtmlCanvas);
void setMinimum(int minimum)
void addWidget(std::unique_ptr< WWidget > widget, int row, int column, WFlags< AlignmentFlag > alignment)
Wt::Signals::connection connect(F function)
void setTickInterval(int tickInterval)
JSignal< int > & sliderMoved()
virtual void resize(const WLength &width, const WLength &height) override
PaintExample(WContainerWidget *root, bool showTitle=true)
void setMaximum(int maximum)
virtual void setValue(int value)
void setTickPosition(WFlags< TickPosition > tickPosition)