-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlock1.h
387 lines (353 loc) · 14.3 KB
/
Block1.h
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Block1
BlockObjectList Block1Objects = { {
//Zero terminated list of form objects
(BlockObject*)&Block2,
(BlockObject*)&Block3,
(BlockObject*)0
} };
BlockBlock Block1 = {
"Block1", //Object Name
BlockType, //Object type
0, //Top Note: Top and left should be zero for main panel
0, //Left
HSIZE, //width
VSIZE, //height
0, //user data
0, //status: Lowest bit of status is invisible flag, Second lowest bit is disabled flag
DeepFir, //Border color
Kimberly, //fill color
28, //font #
OPT_CENTERX, //font options
"This is the main Block", //title bar text
Yellow, //color of title bar text
14, //y offset for title
(HSIZE)/2, //x offset for title
OPT_CENTERX, //options for drawing title text
NULL, //pointer to parent form (or 0 if this is top form) //Note: Must type cast this one as can't make it a BlockBlock*
&Block1Objects, //pointer to NULL terminated list of form objects
NULL, //OnBlockOpen function
NULL, //OnBlockClose function
NULL, //Function to call when idle
NULL //on click default
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Block2
BlockButton Block2Button1 = {//button1
"Button1", //name
ButtonType, //Object type
49, //Top
50, //Left
100, //Width
30, //Height
0, //user data
0, //status: Lowest bit of status is invisible flag, Second lowest bit is disabled flag
White, //Text foreground color
Red, //Button color
27, //font #
0, //font options
"Click Me!", //Button text
NULL, //OnClick function
false //Is the mouse down on this button?
};
BlockToggle Block2Toggle1={
"Toggle1", //Button Name
ToggleType, //Object type
100, //Top
50, //Left
60, //Width
25, //Height
0, //user data
0, //status: Lowest bit of status is invisible flag, Second lowest bit is disabled flag
0, //0 is off, -1 is on
White, //Text foreground color
Blue, //Bar color
Red, //Knob color
Gallery, //Text foreground color
Silver, //Bar color
BahamaBlue, //Knob color
27, //font#
0, //font options
"Off\xffOn", //Toggle text
NULL //Function to call when toggled
};
BlockSlider Block2Slider1 = {
"Slider1", //Slider Name
SliderType, //Object type
200, //Top
50, //Left
200, //Width
30, //Height
0, //user data
0, //status: Lowest bit of status is invisible flag, Second lowest bit is disabled flag
Black, //left color
Yellow, //right color
Blue, //Knob color
0, //options
128, //value
255, //range
NULL //Function to call when button clicked
};
BlockSlider Block2Slider2 = {
"Slider2", //Slider Name
SliderType, //Object type
100, //Top
300, //Left
30, //Width
200, //Height
0, //user data
0, //status: Lowest bit of status is invisible flag, Second lowest bit is disabled flag
Cyan, //left color
Blue, //right color
Red, //Knob color
0, //options
128, //value
255, //range
NULL //Function to call when changed
};
BlockSlider Block2Dial1 = {
"Dial #1", //Dial Name
DialType, //Object type
300, //Top
80, //Left
80, //Width //sets radius
80, //Height //set to same as width
0, //user data
0, //status: Lowest bit of status is invisible flag, Second lowest bit is disabled flag
PeachOrange, //Knob color
Black, //tic color
0, //options
20000, //value, max is 65535
10000, //min limit
55535, //max limit
NULL //Function to call when changed
};
BlockText Block2Text1 =
{
"Text 1", //Text Name
TextType, //Object type
140, //Top
50, //Left
0, //Width //This is automatically calculated at run time
0, //Height //This is automatically calculated at run time
0, //user data
0, //status: Lowest bit of status is invisible flag, Second lowest bit is disabled flag
Magenta, //Text foreground color
25, //font#
0, //font options
"Just Text." //text
};
BlockLed Block2Led1 =
{
"Led 1", //Text Name
LedType, //Object type
400, //Top
50, //Left
0, //Width //This is automatically calculated at run time
0, //Height //This is automatically calculated at run time
0, //user data
0, //status: Lowest bit of status is invisible flag, Second lowest bit is disabled flag
Yellow, //Text foreground color
25, //font#
0, //font options
"LED #1", //text
BlueBell, //LED on Color
MineShaft, //LED off Color
true //is LED on? true or false
};
BlockObjectList Block2Objects = { {
//Zero terminated list of form objects
(BlockObject*)&Block2Button1,
(BlockObject*)&Block2Toggle1,
(BlockObject*)&Block2Slider1,
(BlockObject*)&Block2Slider2,
(BlockObject*)&Block2Text1,
(BlockObject*)&Block2Dial1,
(BlockObject*)&Block2Led1,
(BlockObject*)0 //end of list, null terminated
} };
BlockBlock Block2 = {
"Block2", //Object Name
BlockType, //Object type form==0
100, //Top Note: Top and left should be zero for main panel
100, //Left
400, //width
500, //height
0, //user data
0, //status: Lowest bit of status is invisible flag, Second lowest bit is disabled flag
DeepFir, //Border color
DeepFir, //fill color
28, //font #
OPT_CENTERX, //font options
"This is a Sub-Block", //title bar text
White, //color of title bar text
7, //y offset for title
200, //x offset for title
OPT_CENTERX, //options for drawing title text
(BlockObject*) &Block1, //pointer to parent form (or 0 if this is top form) //Note: Must type cast this one as can't make it a BlockBlock*
&Block2Objects, //pointer to NULL terminated list of form objects
NULL, //OnBlockOpen function
NULL, //OnBlockClose function
NULL, //Function to call when idle
NULL //on click default
};
BlockGauge Block3Gauge1={
"Gauge 1", //Dial Name
GaugeType, //Object type
60, //Top
50, //Left
100, //Width //sets radius
100, //Height //set to same as width
0, //user data
0, //status: Lowest bit of status is invisible flag, Second lowest bit is disabled flag
MineShaft2, //dial color
White, //tic and needle color
0, //options
6, //#major ticks
3, //#minor ticks
1000, //value, max is 65535
3000, //max value
NULL //Function to call when clicked
};
BlockProgress Block3Progress1={
"Progress 1", //Slider Name
ProgressType, //Object type
200, //Top
50, //Left
200, //Width
10, //Height
0, //user data
0, //status: Lowest bit of status is invisible flag, Second lowest bit is disabled flag
Christalle, //background color
Sunglow, //progress color
0, //options
700, //value
1000, //range
NULL //Function to call when clicked
};
BlockScrollBar Block3ScrollBar1={
"Scroll Bar 1", //Slider Name
ScrollBarType, //Object type
50, //Top
350, //Left
10, //Width //Note: drawn vertical if this is less than height
200, //Height
0, //user data
0, //status: Lowest bit of status is invisible flag, Second lowest bit is disabled flag
ElectricLime, //outer color
Lipstick, //inner color
0, //options
50, //value
100, //size
1000, //range
NULL //Function to call when clicked
};
BlockScrollBar Block3ScrollBar2 = {
"Scroll Bar 2", //Slider Name
ScrollBarType, //Object type
250, //Top
50, //Left
200, //Width //Note: drawn vertical if this is less than height
30, //Height
0, //user data
0, //status: Lowest bit of status is invisible flag, Second lowest bit is disabled flag
Apple, //outer color
Lilac, //inner color
0, //options
50, //value
10, //size
1000, //range
NULL //Function to call when clicked
};
BlockNumber Block3Number1= {//Number
"Number 1", //Text Name
NumberType, //Object type
290, //Top
50, //Left
0, //Width //normally unused
0, //Height //normally unused
0, //user data
0, //status: Lowest bit of status is invisible flag, Second lowest bit is disabled flag
LaserLemon, //Text foreground color
25, //font#
0, //font options, including OPT_SIGNED to treat as signed
10, //base, one of 2..36, set to 10 for decimal
365764109 //number
};
BlockKeys Block3Keys1={//Keys
"Keys1", //Text Name
KeysType, //Object type
350, //Top
50, //Left
0, //Width //This is automatically calculated at run time based on "keywidth" below
30, //Height //Height of keys
0, //user data
0, //status: Lowest bit of status is invisible flag, Second lowest bit is disabled flag
White, //Text foreground color
CostaDelSol, //color of keys when up
Blue, //color of keys when down
23, //font#
0, //font options
30, //width of keys
"QWERTYUIOP", //text
NULL //function to call when key clicked
};
BlockClock Block3Clock1={//Clock
"Clock1", //Dial Name
ClockType, //Object type
410, //Top
50, //Left
80, //Width //sets radius
80, //Height //set to same as width
0, //user data
0, //status: Lowest bit of status is invisible flag, Second lowest bit is disabled flag
White, //back color
RedBerry, //tic color
0, //options
2, //hours
31, //minutes
15, //seconds
3 //milliseconds
};
BlockObjectList Block3Objects = { {
//Zero terminated list of form objects
(BlockObject*)&Block3Gauge1,
(BlockObject*)&Block3Progress1,
(BlockObject*)&Block3ScrollBar1,
(BlockObject*)&Block3ScrollBar2,
(BlockObject*)&Block3Number1,
(BlockObject*)&Block3Keys1,
(BlockObject*)&Block3Clock1,
(BlockObject*)0 //end of list, null terminated
} };
BlockBlock Block3 = {
"Block 3", //Object Name
BlockType, //Object type form==0
100, //Top Note: Top and left should be zero for main panel
600, //Left
400, //width
500, //height
0, //user data
0, //status: Lowest bit of status is invisible flag, Second lowest bit is disabled flag
MidnightBlue, //Border color
MidnightBlue, //fill color
28, //font #
OPT_CENTERX, //font options
"This is another Sub-Block", //title bar text
Cyan, //color of title bar text
7, //y offset for title
200, //x offset for title
OPT_CENTERX, //options for drawing title text
(BlockObject*)&Block1, //pointer to parent form (or 0 if this is top form) //Note: Must type cast this one as can't make it a BlockBlock*
&Block3Objects, //pointer to NULL terminated list of form objects
NULL, //OnBlockOpen function
NULL, //OnBlockClose function
NULL, //Function to call when idle
NULL //on click default
};
/////////////////////////////////////////////////////////////////////////////////////////////////////////
//Block Objects
/////////////////////////////////////////////////////////////////////////////////////////////////////////
//Block Constants and Variables
/////////////////////////////////////////////////////////////////////////////////////////////////////////
//Block Methods