23 text +=
"<h2>Paint example</h2>";
26 "<p>A simple example demonstrating cross-browser vector graphics."
28 "<p>The emweb logo below is painted using the Wt WPainter API from "
29 "bezier paths, and rendered to the browser using inline SVG, inline VML "
30 "or the HTML 5 <canvas> element."
33 "The example also demonstrates the horizontal and vertical "
34 "<a href=\"http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WSlider.html\" target=\"_blank\">"
35 "WSlider</a> widgets. Here, "
36 "the events of the WSlider widgets are used to scale and rotate the "
40 "To demonstrate the different rendering methods, a different backend is used for positive or negative "
41 "angles (SVG or HTML canvas)."
44 this->addWidget(std::make_unique<WText>(
text));
46 WContainerWidget *
emweb = this->addWidget(std::make_unique<WContainerWidget>());
47 emweb->setMargin(WLength::Auto, Side::Left | Side::Right);
49 auto layout = std::make_unique<WGridLayout>();
52 std::unique_ptr<WSlider>
scaleSlider(std::make_unique<WSlider>());
57 scaleSlider->setTickPosition(WSlider::TicksBothSides);
61 layout_->addWidget(std::move(
scaleSlider), 0, 1, AlignmentFlag::Center | AlignmentFlag::Middle);
63 auto rotateSlider = std::make_unique<WSlider>(Orientation::Vertical);
72 layout_->addWidget(std::move(
rotateSlider), 1, 0, AlignmentFlag::Center | AlignmentFlag::Middle);
74 auto shapes = std::make_unique<ShapesWidget>();
78 shapes_->setPreferredMethod(RenderMethod::HtmlCanvas);
80 layout_->addWidget(std::move(
shapes), 1, 1,
81 AlignmentFlag::Center | AlignmentFlag::Middle);