-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMDBSetHandCursor.j
More file actions
80 lines (59 loc) · 1.77 KB
/
MDBSetHandCursor.j
File metadata and controls
80 lines (59 loc) · 1.77 KB
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
/*
MDBButton_HandCursor.j
This file is part of FrACT10, a vision test battery.
© 2026 Michael Bach, bach@uni-freiburg.de, <https://michaelbach.de>
Created by Bach on 2026-02-10.
*/
/**
A category to give the following controls a "hand" cursor when hovering over:
• Buttons
• Segmented controls
• Color wells
It is possible to restore the former cursor shape, but not used here since reverting to arrow cursor works fine in the FrACT context.
*/
@import <AppKit/CPCursor.j>
@import <AppKit/CPButton.j>
@import <AppKit/CPSegmentedControl.j>
@import <AppKit/CPColorWell.j>
@implementation CPButton (MDBSetHandCursor) {
CPCursor formerCursor;
}
// Turn into hand when entering the control's tracking area
- (void) mouseEntered: (CPEvent) e {
//formerCursor = [CPCursor currentCursor];
[[CPCursor pointingHandCursor] set];
}
// On exit restore former cursor
- (void) mouseExited: (CPEvent) e {
//[formerCursor set];
[[CPCursor arrowCursor] set];
}
@end
@implementation CPSegmentedControl (MDBSetHandCursor) {
CPCursor formerCursor;
}
// Turn into hand when entering the control's tracking area
- (void) mouseEntered: (CPEvent) e {
//formerCursor = [CPCursor currentCursor];
[[CPCursor pointingHandCursor] set];
}
// On exit restore former cursor
- (void) mouseExited: (CPEvent) e {
//[formerCursor set];
[[CPCursor arrowCursor] set];
}
@end
@implementation CPColorWell (MDBSetHandCursor) {
CPCursor formerCursor;
}
// Turn into hand when entering the control's tracking area
- (void) mouseEntered: (CPEvent) e {
//formerCursor = [CPCursor currentCursor];
[[CPCursor pointingHandCursor] set];
}
// On exit restore former cursor
- (void) mouseExited: (CPEvent) e {
//[formerCursor set];
[[CPCursor arrowCursor] set];
}
@end