Class demonstrating drag and drop in Wt.
More...
#include <DragExample.h>
Class demonstrating drag and drop in Wt.
Definition at line 15 of file DragExample.h.
◆ DragExample()
DragExample::DragExample |
( |
| ) |
|
Definition at line 34 of file DragExample.C.
34 :
35 WContainerWidget()
36{
37 this->addWidget(std::make_unique<WText>("<p>Help these people with their decision by dragging one of "
38 "the pills.</p>"));
39
40 if (!
wApp->environment().javaScript()) {
41 this->addWidget(std::make_unique<WText>("<i>This examples requires that javascript support is "
42 "enabled.</i>"));
43 }
44
45 WContainerWidget *
pills = this->addWidget(std::make_unique<WContainerWidget>());
46 pills->setContentAlignment(AlignmentFlag::Center);
47
49 "icons/blue-pill-small.png",
52 "icons/red-pill-small.png",
54
55 WContainerWidget *
dropSites = this->addWidget(std::make_unique<WContainerWidget>());
56
57 dropSites->addWidget(std::make_unique<Character>(
"Neo"));
58 dropSites->addWidget(std::make_unique<Character>(
"Morpheus"));
59 dropSites->addWidget(std::make_unique<Character>(
"Trinity"));
60
61}
WImage * createDragImage(const char *url, const char *smallurl, const char *mimeType, WContainerWidget *p)
Create an image which can be dragged.
Wt::Auth::Dbo::UserDatabase< AuthInfo > UserDatabase
The documentation for this class was generated from the following files: