3 #include <Wt/WEnvironment> 5 #include <Wt/WApplication> 23 WImage *result =
new WImage(url, p);
24 WImage *dragImage =
new WImage(smallurl, p);
25 dragImage->setMargin(-15, Left | Top);
31 result->setDraggable(mimeType, dragImage,
true);
37 WContainerWidget(parent)
39 new WText(
"<p>Help these people with their decision by dragging one of " 40 "the pills.</p>",
this);
42 if (!wApp->environment().javaScript()) {
43 new WText(
"<i>This examples requires that javascript support is " 44 "enabled.</i>",
this);
47 WContainerWidget *pills =
new WContainerWidget(
this);
48 pills->setContentAlignment(AlignCenter);
51 "icons/blue-pill-small.png",
54 "icons/red-pill-small.png",
57 WContainerWidget *dropSites =
new WContainerWidget(
this);
DragExample(Wt::WContainerWidget *parent)
A Matrix character that takes red and/or blue pills.
WImage * createDragImage(const char *url, const char *smallurl, const char *mimeType, WContainerWidget *p)
Create an image which can be dragged.