-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathHopscotchGestureDemo.ns
99 lines (95 loc) · 2.45 KB
/
HopscotchGestureDemo.ns
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
Newspeak3
'Root'
class HopscotchGestureDemo packageUsing: manifest = (
) (
class Demo usingPlatform: p = (|
Holder = p hopscotch ducts Holder.
Subject = p hopscotch Subject.
Presenter = p hopscotch Presenter.
Color = p graphics Color.
|) (
class DemoPresenter onSubject: s = Presenter onSubject: s (
|
borderWidth <Holder> = Holder with: 10.0.
|
) (
public definition = (
^column: {
(row: {
(label: 'Border:')
bold;
italic;
underline;
foregroundColor: Color gray.
slider: borderWidth
min: 0
max: 100.
}).
mediumBlank.
(row: {
rectangle
fill: Color green;
frame: 300 height: 300;
border: Color yellow width: borderWidth;
onClick: [:event |
'onClick' out.
];
onMouseDown: [:event |
'onMouseDown' out.
];
onMouseUp: [:event |
'onMouseUp' out.
];
onMouseEnter: [:event |
'onMouseEnter' out.
];
onMouseMove: [:event |
'onMouseMove' out.
];
onMouseOut: [:event |
'onMouseOut' out.
];
onWheel: [:event |
'onWheel' out.
];
onTouchStart: [:event |
'onTouchStart' out.
];
onTouchMove: [:event |
'onTouchMove' out.
];
onTouchEnd: [:event |
'onTouchEnd' out.
];
onTouchCancel: [:event |
'onTouchCancel' out.
].
}).
}
)
public isKindOfDemoPresenter ^ <Boolean> = (
^true
)
isMyKind: f <Fragment> ^ <Boolean> = (
^f isKindOfDemoPresenter
)
) : (
)
public class DemoSubject new = Subject onModel: nil (
) (
public createPresenter = (
^DemoPresenter onSubject: self
)
isMyKind: other ^ <Boolean> = (
^other isKindOfDemoPresenter
)
) : (
)
) : (
)
public main: platform args: args = (
| demo = Demo usingPlatform: platform. |
platform hopscotch core HopscotchWindow openSubject: demo DemoSubject new.
)
) : (
)