-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.spin
129 lines (111 loc) · 2.51 KB
/
menu.spin
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
CON
_clkmode=xtal1+pll16x
_xinfreq=5_000_000
clock = 0
nav = 1
timer = 2
cal = 3
comm=4
edit=5
obj
SC : "Screen"
TC : "trackBallEx"
GPMenu : "gpsMenu"
'CP : "ClockPage"
Sen : "Sensors"
Ed : "Edit"
TR : "timer"
CM : "CommMenu"
CL : "Calendar"
var
long currentItem
pub main: canExit
SC.Init
SC.On
SC.Clear
SC.TxtColor($FF,$E0)
SC.TxtBackColor($00,$00)
SC.Position(4,4)
SC.Print(string("Clock"))
SC.Position(4,14)
SC.Print(string("Nav"))
SC.Position(8,4)
SC.Print(string("Timer"))
SC.Position(8,14)
SC.Print(string("Calendar"))
SC.Position(12,4)
SC.print(string("Comm"))
SC.Position(12,14)
SC.print(string("Edit"))
Sen.StandBy
SC.DrawRec(70,45,25,25,$F8,$00)
currentItem:=clock
canExit:=false
'begin the polling
repeat until canExit==true
TC.Run
if TC.isRight ==true
SC.Click
ClearCurrent
case currentItem
clock: currentItem:=nav
timer: currentItem:=cal
comm: currentItem:=edit
'draw currentItem
DrawItem
if TC.isLeft == true
SC.Click
ClearCurrent
case currentItem
nav: currentItem:=clock
cal: currentItem:=timer
edit: currentItem:=comm
DrawItem
if TC.isDown ==true
SC.Click
ClearCurrent
case currentItem
clock: currentItem:=timer
timer: currentItem:=comm
nav: currentItem:=cal
cal: currentItem:=edit
'draw currentItem
DrawItem
if TC.isUp ==true
SC.Click
ClearCurrent
case currentItem
timer: currentItem:=clock
comm: currentItem:=timer
cal: currentItem:=nav
edit: currentItem:=cal
'draw currentItem
DrawItem
if TC.isPressed == true
canExit:=true
case currentItem
nav:GPMenu.main
clock:return 1
edit: Ed.main
timer: TR.main
comm: CM.main
cal: CL.ReadAll
return 1
'SC.FadeOut
'SC.Off 'the double tap
pri DrawItem
case currentItem
clock: SC.DrawRec(70,45,25,25,$F8,$00)
nav: SC.DrawRec(140,45,90,25,$F8,$00)
timer: SC.DrawRec(70,80,25,60,$F8,$00)
cal: SC.DrawRec(157,77,90,55,$F8,$00)
comm: SC.DrawRec(70,110,25,90,$F8,$00)
edit: SC.DrawRec(135,110,90,85,$F8,$00)
pri ClearCurrent
case currentItem
clock: SC.DrawRec(70,45,25,25,$00,$00)
nav: SC.DrawRec(140,45,90,25,$00,$00)
timer: SC.DrawRec(70,80,25,60,$00,$00)
cal: SC.DrawRec(157,77,90,55,$00,$00)
comm: SC.DrawRec(70,110,25,90,$00,$00)
edit: SC.DrawRec(135,110,90,85,$00,$00)