-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathUI.cpp
153 lines (112 loc) · 4.18 KB
/
UI.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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#include "UI.h"
#define SET_BTN_PATH "System/appFiles/testApp/crossHr.bmp"
#define CLEAR_BTN_PATH "System/appFiles/testApp/globeCH.bmp"
#define MASK_PATH "System/icons/standard/mask32.bmp"
bmpMask icon32Mask;
clearAngleBtn* ourCAngleBtn;
setAngleBtn* ourSAngleBtn;
label* rotationAngleX;
label* rotationAngleY;
label* rotationAngleZ;
label* rotX;
label* rotY;
label* rotZ;
label* modelAngleX;
label* modelAngleY;
label* modelAngleZ;
label* modelX;
label* modelY;
label* modelZ;
void setupUI(void) {
icon32Mask.readFromBMP(MASK_PATH);
ourCAngleBtn = new clearAngleBtn(20,240,CLEAR_BTN_PATH);
ourCAngleBtn->setMask(&icon32Mask);
viewList.addObj(ourCAngleBtn);
ourSAngleBtn = new setAngleBtn(20,280,SET_BTN_PATH);
ourSAngleBtn->setMask(&icon32Mask);
viewList.addObj(ourSAngleBtn);
int TxtX = 160;
int rawTxty = 240;
int offset = 0;
int ySpace = 10;
rotationAngleX = new label(200,rawTxty+offset,40,18,"0.00",1);
rotationAngleX->setColors(&blue,&black);
rotationAngleX->setJustify(TEXT_RIGHT);
viewList.addObj(rotationAngleX);
rotX = new label(TxtX,rawTxty+offset,40,18,"Raw x:",1);
rotX->setColors(&blue,&black);
rotX->setJustify(TEXT_RIGHT);
viewList.addObj(rotX);
offset = offset + ySpace;
rotationAngleY = new label(200,rawTxty+offset,40,18,"0.00",1);
rotationAngleY->setColors(&blue,&black);
rotationAngleY->setJustify(TEXT_RIGHT);
viewList.addObj(rotationAngleY);
rotY = new label(TxtX,rawTxty+offset,40,18,"Raw y:",1);
rotY->setColors(&blue,&black);
rotY->setJustify(TEXT_RIGHT);
viewList.addObj(rotY);
offset = offset + ySpace;
rotationAngleZ = new label(200,rawTxty+offset,40,18,"0.00",1);
rotationAngleZ->setColors(&blue,&black);
rotationAngleZ->setJustify(TEXT_RIGHT);
viewList.addObj(rotationAngleZ);
rotZ = new label(TxtX,rawTxty+offset,40,18,"Raw z:",1);
rotZ->setColors(&blue,&black);
rotZ->setJustify(TEXT_RIGHT);
viewList.addObj(rotZ);
offset = offset + ySpace;
offset = offset + ySpace;
modelAngleX = new label(200,rawTxty+offset,40,18,"0.00",1);
modelAngleX->setColors(&blue,&black);
modelAngleX->setJustify(TEXT_RIGHT);
viewList.addObj(modelAngleX);
modelX = new label(TxtX,rawTxty+offset,40,18,"Mod x:",1);
modelX->setColors(&blue,&black);
modelX->setJustify(TEXT_RIGHT);
viewList.addObj(modelX);
offset = offset + ySpace;
modelAngleY = new label(200,rawTxty+offset,40,18,"0.00",1);
modelAngleY->setColors(&blue,&black);
modelAngleY->setJustify(TEXT_RIGHT);
viewList.addObj(modelAngleY);
modelY = new label(TxtX,rawTxty+offset,40,18,"Mod y:",1);
modelY->setColors(&blue,&black);
modelY->setJustify(TEXT_RIGHT);
viewList.addObj(modelY);
offset = offset + ySpace;
modelAngleZ = new label(200,rawTxty+offset,40,18,"0.00",1);
modelAngleZ->setColors(&blue,&black);
modelAngleZ->setJustify(TEXT_RIGHT);
viewList.addObj(modelAngleZ);
modelZ = new label(TxtX,rawTxty+offset,40,18,"Mod z:",1);
modelZ->setColors(&blue,&black);
modelZ->setJustify(TEXT_RIGHT);
viewList.addObj(modelZ);
}
//****************************************************************************************
// setAngleBtn:
//
// The thing the user touches to set "this" angle as zero.
//****************************************************************************************
setAngleBtn::setAngleBtn(int xLoc,int yLoc,const char* path)
:iconButton(xLoc,yLoc,path) { }
setAngleBtn::~setAngleBtn(void) { }
void setAngleBtn::doAction(void) {
if (callback) {
callback();
}
}
//****************************************************************************************
// clearAngleBtn:
//
// The thing the user touches to set ground angle back to zero.
//****************************************************************************************
clearAngleBtn::clearAngleBtn(int xLoc,int yLoc,const char* path)
:iconButton(xLoc,yLoc,path) { }
clearAngleBtn::~clearAngleBtn(void) { }
void clearAngleBtn::doAction(void) {
if (callback) {
callback();
}
}