19 : WContainerWidget()
20{
23 text +=
"<h2>Paint example</h2>";
24
26 "<p>A simple example demonstrating cross-browser vector graphics."
27 "</p>"
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."
31 "</p>"
32 "<p>"
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 "
37 "emweb logo."
38 "</p>"
39 "<p>"
40 "To demonstrate the different rendering methods, a different backend is used for positive or negative "
41 "angles (SVG or HTML canvas)."
42 "</p>";
43
44 this->addWidget(std::make_unique<WText>(
text));
45
46 WContainerWidget *
emweb = this->addWidget(std::make_unique<WContainerWidget>());
47 emweb->setMargin(WLength::Auto, Side::Left | Side::Right);
48
49 auto layout = std::make_unique<WGridLayout>();
51
52 std::unique_ptr<WSlider>
scaleSlider(std::make_unique<WSlider>());
57 scaleSlider->setTickPosition(WSlider::TicksBothSides);
60
61 layout_->addWidget(std::move(
scaleSlider), 0, 1, AlignmentFlag::Center | AlignmentFlag::Middle);
62
63 auto rotateSlider = std::make_unique<WSlider>(Orientation::Vertical);
71
72 layout_->addWidget(std::move(
rotateSlider), 1, 0, AlignmentFlag::Center | AlignmentFlag::Middle);
73
74 auto shapes = std::make_unique<ShapesWidget>();
78 shapes_->setPreferredMethod(RenderMethod::HtmlCanvas);
79
80 layout_->addWidget(std::move(
shapes), 1, 1,
81 AlignmentFlag::Center | AlignmentFlag::Middle);
82}
Wt::Auth::Dbo::UserDatabase< AuthInfo > UserDatabase