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

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

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 }

Generated on Mon Sep 5 2022 for the C++ Web Toolkit (Wt) by doxygen 1.8.17