-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCursors.cpp
85 lines (70 loc) · 1.55 KB
/
Cursors.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Cursors.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "DragCursor.res"
static const int crDragCursor = 1;
__fastcall TCursorSet::TCursorSet()
{
Screen->Cursors[crDragCursor] = LoadCursor(HInstance, TEXT("DRAGCURSOR"));
m_bWait = false;
m_bDrag = false;
m_bFinger = false;
}
__fastcall TCursorSet::~TCursorSet()
{
//TODO: Add your source code here
}
void __fastcall TCursorSet::SetWait(bool value)
{
if(value != m_bWait)
{
if(value)
{
m_cWaitSavedCursor = Screen->Cursor;
Screen->Cursor = crHourGlass;
}
else Screen->Cursor = m_cWaitSavedCursor;
m_bWait = value;
}
}
void __fastcall TCursorSet::SetDrag(bool value)
{
if(value != m_bDrag)
{
if(value)
{
m_cDragSavedCursor = Screen->Cursor;
Screen->Cursor = (TCursor)crDragCursor;
}
else Screen->Cursor = m_cDragSavedCursor;
m_bDrag = value;
}
}
void __fastcall TCursorSet::SetFinger(bool value)
{
if(value != m_bFinger)
{
if(value)
{
m_cFingerSavedCursor = Screen->Cursor;
Screen->Cursor = crHandPoint;
}
else Screen->Cursor = m_cFingerSavedCursor;
m_bFinger = value;
}
}
TCursor __fastcall TCursorSet::GetWaitCursor()
{
return crHourGlass;
}
TCursor __fastcall TCursorSet::GetDragCursor()
{
return (TCursor)crDragCursor;
}
TCursor __fastcall TCursorSet::GetFingerCursor()
{
return crHandPoint;
}