Photon microGUI widgets library 0.6.0
Cursor.h
1#ifndef PHWIDGETS_CURSOR_H
2#define PHWIDGETS_CURSOR_H
3
4#include <photon/PhCursor.h>
5#include <photon/PhT.h>
6
7namespace PhWidgets
8{
10 struct Cursors
11 {
13 {
14 None = Ph_CURSOR_NONE,
15 Inherit = Ph_CURSOR_INHERIT,
16 Pointer = Ph_CURSOR_POINTER,
17 BigPointer = Ph_CURSOR_BIG_POINTER,
18 Move = Ph_CURSOR_MOVE,
19 Crosshair = Ph_CURSOR_CROSSHAIR,
20 Clock = Ph_CURSOR_CLOCK,
21 Wait = Ph_CURSOR_WAIT,
22 Noinput = Ph_CURSOR_NOINPUT,
23 Dont = Ph_CURSOR_DONT,
24 Finger = Ph_CURSOR_FINGER,
25 Insert = Ph_CURSOR_INSERT,
26 DragVertical = Ph_CURSOR_DRAG_VERTICAL,
27 DragTop = Ph_CURSOR_DRAG_TOP,
28 DragBottom = Ph_CURSOR_DRAG_BOTTOM,
29 DragHorizontal = Ph_CURSOR_DRAG_HORIZONTAL,
30 DragLeft = Ph_CURSOR_DRAG_LEFT,
31 DragRight = Ph_CURSOR_DRAG_RIGHT,
32 DragBackDiag = Ph_CURSOR_DRAG_BACKDIAG,
33 DragTL = Ph_CURSOR_DRAG_TL,
34 DragBR = Ph_CURSOR_DRAG_BR,
35 DragForeDiag = Ph_CURSOR_DRAG_FOREDIAG,
36 DragTR = Ph_CURSOR_DRAG_TR,
37 DragBL = Ph_CURSOR_DRAG_BL,
38 LongWait = Ph_CURSOR_LONG_WAIT,
39 QuestionPoint = Ph_CURSOR_QUESTION_POINT,
40 Paste = Ph_CURSOR_PASTE,
41
42 // Visual Studio styles:
43 AppStarting = LongWait, // The cursor that appears when an application starts.
44 Default = Ph_CURSOR_POINTER,
45 Arrow = Ph_CURSOR_POINTER,
51 No = Dont,
60 };
61 };
62
64 class Cursor
65 {
66 public:
67
69
71
76
78
82 Cursor(const PhCursorDef_t &def);
83
85
89 Cursor(const Cursor &other);
90
93
95
99 Cursor &operator=(const Cursor &other);
100
102
106 bool operator==(const Cursor &other) const;
107
109
113 bool operator!=(const Cursor &other) const;
114
116
120 bool operator<(const Cursor &other) const;
121
122 operator const PhCursorDef_t*() const;
123
124 private:
125 PhCursorDef_t *_def;
126 Cursors::eCursors _cursor;
127
128 friend class Widget;
129 };
130
131 bool operator==(const Cursors::eCursors &lhs, const Cursor &rhs);
132 bool operator!=(const Cursors::eCursors &lhs, const Cursor &rhs);
133 bool operator<(const Cursors::eCursors &lhs, const Cursor &rhs);
134} // namespace PhWidgets
135
136
137#endif // PHWIDGETS_CURSOR_H
Represents the image used to paint the mouse pointer.
Definition: Cursor.h:65
~Cursor()
(destructor)
Cursor(const PhCursorDef_t &def)
(constructor)
bool operator<(const Cursor &other) const
Compares Cursors.
Cursor(Cursors::eCursors cursor=Cursors::Default)
(constructor)
bool operator!=(const Cursor &other) const
Compares Cursors.
Cursor(const Cursor &other)
(copy constructor)
bool operator==(const Cursor &other) const
Compares Cursors.
Cursor & operator=(const Cursor &other)
Assigns value in Cursor.
Superclass for all widgets.
Definition: Widget.h:110
The main namespace for all widgets.
Definition: Basic.h:11
Provides a collection of standard cursors for use by a Photon microGUI application.
Definition: Cursor.h:11
eCursors
Definition: Cursor.h:13
@ SizeAll
The four-headed sizing cursor, which consists of four joined arrows that point north,...
Definition: Cursor.h:53
@ NoMove2D
The cursor that appears during wheel operations when the mouse is not moving, but the window can be s...
Definition: Cursor.h:52
@ QuestionPoint
The question mark cursor.
Definition: Cursor.h:39
@ Noinput
The cursor that indicates that the input is disabled.
Definition: Cursor.h:22
@ DragTL
The two-headed diagonal (northwest/southeast) sizing cursor.
Definition: Cursor.h:33
@ BigPointer
The big arrow cursor.
Definition: Cursor.h:17
@ Inherit
Inherit cursor not from the class hierarchy, but from the family hierarchy.
Definition: Cursor.h:15
@ DragForeDiag
The two-headed diagonal (northeast/southwest) sizing cursor.
Definition: Cursor.h:35
@ Default
The default cursor, which is usually an arrow cursor.
Definition: Cursor.h:44
@ DragVertical
The two-headed vertical (north/south) sizing cursor.
Definition: Cursor.h:26
@ SizeNESW
The two-headed diagonal (northeast/southwest) sizing cursor.
Definition: Cursor.h:54
@ DragBackDiag
The two-headed diagonal (northwest/southeast) sizing cursor.
Definition: Cursor.h:32
@ Finger
The finger cursor, typically used when hovering over a Web link.
Definition: Cursor.h:24
@ Move
The four-headed sizing cursor, which consists of four joined arrows that point north,...
Definition: Cursor.h:18
@ Crosshair
The crosshair cursor.
Definition: Cursor.h:19
@ Hand
The hand cursor, typically used when hovering over a Web link.
Definition: Cursor.h:47
@ IBeam
The I-beam cursor, which is used to show where the text cursor appears when the mouse is clicked.
Definition: Cursor.h:50
@ LongWait
The hour glass shaped cursor.
Definition: Cursor.h:38
@ Paste
The copy-paste cursor.
Definition: Cursor.h:40
@ None
No cursor at all.
Definition: Cursor.h:14
@ Split
The cursor that appears when the mouse is positioned over a horizontal splitter bar.
Definition: Cursor.h:49
@ Pointer
The arrow cursor.
Definition: Cursor.h:16
@ Cross
The crosshair cursor.
Definition: Cursor.h:46
@ DragBottom
The two-headed vertical (north/south) sizing cursor.
Definition: Cursor.h:28
@ DragTop
The two-headed vertical (north/south) sizing cursor.
Definition: Cursor.h:27
@ DragBL
The two-headed diagonal (northeast/southwest) sizing cursor.
Definition: Cursor.h:37
@ Clock
The clock cursor.
Definition: Cursor.h:20
@ Arrow
The arrow cursor.
Definition: Cursor.h:45
@ DragBR
The two-headed diagonal (northwest/southeast) sizing cursor.
Definition: Cursor.h:34
@ Wait
The wait cursor, typically an clock shape.
Definition: Cursor.h:21
@ WaitCursor
The wait cursor, typically an hourglass shape.
Definition: Cursor.h:59
@ VSplit
The cursor that appears when the mouse is positioned over a vertical splitter bar.
Definition: Cursor.h:58
@ DragTR
The two-headed diagonal (northeast/southwest) sizing cursor.
Definition: Cursor.h:36
@ SizeNWSE
The two-headed diagonal (northwest/southeast) sizing cursor.
Definition: Cursor.h:56
@ Help
The Help cursor, which is a question mark.
Definition: Cursor.h:48
@ DragLeft
The two-headed horizontal (west/east) sizing cursor.
Definition: Cursor.h:30
@ SizeNS
The two-headed vertical (north/south) sizing cursor.
Definition: Cursor.h:55
@ SizeWE
The two-headed horizontal (west/east) sizing cursor.
Definition: Cursor.h:57
@ Insert
The I-beam cursor, which is used to show where the text cursor appears when the mouse is clicked.
Definition: Cursor.h:25
@ DragHorizontal
The two-headed horizontal (west/east) sizing cursor.
Definition: Cursor.h:29
@ No
The cursor that indicates that a particular region is invalid for the current operation.
Definition: Cursor.h:51
@ DragRight
The two-headed horizontal (west/east) sizing cursor.
Definition: Cursor.h:31
@ Dont
The cursor that indicates that a particular region is invalid for the current operation.
Definition: Cursor.h:23