Wt examples  3.3.12
Public Member Functions | List of all members
DragExample Class Reference

Class demonstrating drag and drop in Wt. More...

#include <DragExample.h>

Inheritance diagram for DragExample:
Inheritance graph
[legend]

Public Member Functions

 DragExample (Wt::WContainerWidget *parent)
 

Detailed Description

Class demonstrating drag and drop in Wt.

Definition at line 13 of file DragExample.h.

Constructor & Destructor Documentation

◆ DragExample()

DragExample::DragExample ( Wt::WContainerWidget *  parent)

Definition at line 36 of file DragExample.C.

36  :
37  WContainerWidget(parent)
38 {
39  new WText("<p>Help these people with their decision by dragging one of "
40  "the pills.</p>", this);
41 
42  if (!wApp->environment().javaScript()) {
43  new WText("<i>This examples requires that javascript support is "
44  "enabled.</i>", this);
45  }
46 
47  WContainerWidget *pills = new WContainerWidget(this);
48  pills->setContentAlignment(AlignCenter);
49 
50  createDragImage("icons/blue-pill.jpg",
51  "icons/blue-pill-small.png",
52  "blue-pill", pills);
53  createDragImage("icons/red-pill.jpg",
54  "icons/red-pill-small.png",
55  "red-pill", pills);
56 
57  WContainerWidget *dropSites = new WContainerWidget(this);
58 
59  new Character("Neo", dropSites);
60  new Character("Morpheus", dropSites);
61  new Character("Trinity", dropSites);
62 
63 }

The documentation for this class was generated from the following files:
createDragImage
WImage * createDragImage(const char *url, const char *smallurl, const char *mimeType, WContainerWidget *p)
Create an image which can be dragged.
Definition: DragExample.C:19
Character
A Matrix character that takes red and/or blue pills.
Definition: Character.h:24

Generated on Fri Apr 24 2020 for the C++ Web Toolkit (Wt) by doxygen 1.8.17