1 | #include "GWt_draggableImage.h" |
---|
2 | |
---|
3 | #include <Wt/WCssDecorationStyle> |
---|
4 | |
---|
5 | |
---|
6 | GWt_draggableImage::GWt_draggableImage( |
---|
7 | const WLink & imageLink, |
---|
8 | const WString & altText, |
---|
9 | WContainerWidget * parent): |
---|
10 | WImage(imageLink,altText,parent) |
---|
11 | { |
---|
12 | init(); |
---|
13 | } |
---|
14 | |
---|
15 | |
---|
16 | GWt_draggableImage::GWt_draggableImage( |
---|
17 | const WLink & imageLink, |
---|
18 | WContainerWidget * parent): |
---|
19 | WImage(imageLink,"Image PSPA",parent) |
---|
20 | { |
---|
21 | init(); |
---|
22 | } |
---|
23 | |
---|
24 | |
---|
25 | GWt_draggableImage::~GWt_draggableImage() |
---|
26 | { |
---|
27 | } |
---|
28 | |
---|
29 | |
---|
30 | void GWt_draggableImage::init(){ |
---|
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); |
---|
39 | } |
---|
40 | |
---|
41 | |
---|
42 | void GWt_draggableImage::setChangeCursorOnMouseOver(bool change){ |
---|
43 | changeCursorOnMouseOver_ = change; |
---|
44 | } |
---|
45 | |
---|
46 | |
---|
47 | void GWt_draggableImage::mouseOver(const WMouseEvent& e) |
---|
48 | { |
---|
49 | if (changeCursorOnMouseOver_) { |
---|
50 | decorationStyle().setCursor(OpenHandCursor); |
---|
51 | } else { |
---|
52 | decorationStyle().setCursor(ArrowCursor); |
---|
53 | } |
---|
54 | } |
---|
55 | |
---|
56 | void GWt_draggableImage::mouseOut(const WMouseEvent& e) |
---|
57 | { |
---|
58 | decorationStyle().setCursor(ArrowCursor); |
---|
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 | } |
---|