[223] | 1 | #include "GWt_draggableImage.h" |
---|
| 2 | |
---|
| 3 | #include <Wt/WCssDecorationStyle> |
---|
| 4 | |
---|
| 5 | |
---|
| 6 | GWt_draggableImage::GWt_draggableImage( |
---|
[272] | 7 | const WLink & imageLink, |
---|
| 8 | const WString & altText, |
---|
| 9 | WContainerWidget * parent): |
---|
| 10 | WImage(imageLink,altText,parent) |
---|
[223] | 11 | { |
---|
[272] | 12 | init(); |
---|
[223] | 13 | } |
---|
| 14 | |
---|
| 15 | |
---|
| 16 | GWt_draggableImage::GWt_draggableImage( |
---|
[272] | 17 | const WLink & imageLink, |
---|
| 18 | WContainerWidget * parent): |
---|
| 19 | WImage(imageLink,"Image PSPA",parent) |
---|
[223] | 20 | { |
---|
[272] | 21 | init(); |
---|
[223] | 22 | } |
---|
| 23 | |
---|
| 24 | |
---|
| 25 | GWt_draggableImage::~GWt_draggableImage() |
---|
| 26 | { |
---|
| 27 | } |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | void GWt_draggableImage::init(){ |
---|
[272] | 31 | changeCursorOnMouseOver_ = true; |
---|
| 32 | |
---|
| 33 | // setMouseOverDelay(100); |
---|
| 34 | mouseWentOver().connect(this, &GWt_draggableImage::mouseOver); |
---|
| 35 | mouseWentUp().connect(this, &GWt_draggableImage::mouseUp); |
---|
| 36 | mouseWentDown().connect(this, &GWt_draggableImage::mouseDown); |
---|
| 37 | mouseWentOut().connect(this, &GWt_draggableImage::mouseOut); |
---|
| 38 | mouseDragged().connect(this, &GWt_draggableImage::mouseIsDragged); |
---|
[223] | 39 | } |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | void GWt_draggableImage::setChangeCursorOnMouseOver(bool change){ |
---|
[272] | 43 | changeCursorOnMouseOver_ = change; |
---|
[223] | 44 | } |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | void GWt_draggableImage::mouseOver(const WMouseEvent& e) |
---|
| 48 | { |
---|
[272] | 49 | if (changeCursorOnMouseOver_) { |
---|
| 50 | decorationStyle().setCursor(OpenHandCursor); |
---|
| 51 | } else { |
---|
| 52 | decorationStyle().setCursor(ArrowCursor); |
---|
| 53 | } |
---|
[223] | 54 | } |
---|
| 55 | |
---|
| 56 | void GWt_draggableImage::mouseOut(const WMouseEvent& e) |
---|
| 57 | { |
---|
[272] | 58 | decorationStyle().setCursor(ArrowCursor); |
---|
[223] | 59 | } |
---|
| 60 | |
---|
| 61 | void GWt_draggableImage::mouseIsDragged(const WMouseEvent& e) |
---|
| 62 | { |
---|
| 63 | } |
---|
| 64 | |
---|
| 65 | void GWt_draggableImage::mouseUp(const WMouseEvent& e) |
---|
| 66 | { |
---|
| 67 | } |
---|
| 68 | |
---|
| 69 | void GWt_draggableImage::mouseDown(const WMouseEvent& e) |
---|
| 70 | { |
---|
| 71 | } |
---|