3 #include <Wt/WEnvironment.h> 5 #include <Wt/WApplication.h> 21 WImage *result = p->
addWidget(cpp14::make_unique<WImage>(url));
22 WImage *dragImage = p->
addWidget(cpp14::make_unique<WImage>(smallurl));
23 dragImage->setMargin(-15, Side::Left | Side::Top);
29 result->setDraggable(mimeType, dragImage,
true);
37 this->
addWidget(cpp14::make_unique<WText>(
"<p>Help these people with their decision by dragging one of " 40 if (!wApp->environment().javaScript()) {
41 this->
addWidget(cpp14::make_unique<WText>(
"<i>This examples requires that javascript support is " 49 "icons/blue-pill-small.png",
52 "icons/red-pill-small.png",
57 dropSites->
addWidget(cpp14::make_unique<Character>(
"Neo"));
58 dropSites->
addWidget(cpp14::make_unique<Character>(
"Morpheus"));
59 dropSites->
addWidget(cpp14::make_unique<Character>(
"Trinity"));
WImage * createDragImage(const char *url, const char *smallurl, const char *mimeType, WContainerWidget *p)
Create an image which can be dragged.