Wt examples 3.3.12
Functions
DragExample.C File Reference
#include "DragExample.h"
#include "Character.h"
#include <Wt/WEnvironment>
#include <Wt/WImage>
#include <Wt/WApplication>

Go to the source code of this file.

Functions

WImagecreateDragImage (const char *url, const char *smallurl, const char *mimeType, WContainerWidget *p)
 Create an image which can be dragged.
 

Function Documentation

◆ createDragImage()

WImage * createDragImage ( const char *  url,
const char *  smallurl,
const char *  mimeType,
WContainerWidget p 
)

Create an image which can be dragged.

The image to be displayed when dragging is given by smallurl, and configured with the given mime type

Definition at line 19 of file DragExample.C.

22{
23 WImage *result = new WImage(url, p);
24 WImage *dragImage = new WImage(smallurl, p);
25 dragImage->setMargin(-15, Left | Top);
26
27 /*
28 * Set the image to be draggable, showing the other image (dragImage)
29 * to be used as the widget that is visually dragged.
30 */
31 result->setDraggable(mimeType, dragImage, true);
32
33 return result;
34}
void setDraggable(const std::string &mimeType, WWidget *dragWidget=0, bool isDragWidgetOnly=false, WObject *sourceWidget=0)
virtual void setMargin(const WLength &margin, WFlags< Side > sides=All)

Generated on Fri May 17 2024 for the C++ Web Toolkit (Wt) by doxygen 1.9.8