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
65
69
80
81
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
111
112
113
116
117
118
121
122
131
132
133
134
140
144
145
146
147
148
149
152
153
154
155
156
157
158
159
160
161
164
/* ... */
/* ... */
#include <stdlib.h>
#include "GUIDEMO.h"
#if (SHOW_GUIDEMO_VSCREEN)
/* ... */
/* ... */
static int _Loop(int y, int d, int n, int Delay) {
do {
y += d;
GUI_SetOrg(0, y);
GUI_Delay(Delay);
if (GUIDEMO_CheckCancel()) {
return 1;
}if (GUIDEMO_CheckCancel()) { ... }
...} while (--n);
return 0;
}{ ... }
/* ... */
static void _DemoVScreen(void) {
int xSize, ySize, j, n;
int _aDelay[] = { 20, 5};
GUI_RECT Rect;
xSize = LCD_GetXSize();
ySize = LCD_GetYSize();
GUI_SetFont(&GUI_FontComic24B_ASCII);
GUI_SetTextMode(GUI_TM_TRANS);
Rect.x0 = 0;
Rect.y0 = 0;
Rect.x1 = xSize - 1;
Rect.y1 = ySize - 1;
GUI_SetColor(GUI_WHITE);
GUI_DispStringInRect("Default screen", &Rect, GUI_TA_HCENTER | GUI_TA_VCENTER);
GUI_Delay(250);
Rect.y0 += ySize;
Rect.y1 += ySize;
GUI_DrawGradientV(Rect.x0, Rect.y0, Rect.x1, Rect.y1, 0xFFFFFF, 0x000000);
Rect.y1 -= ySize / 3;
GUI_SetColor(GUI_DARKGREEN);
GUI_DispStringInRect("Here is the\nvirtual screen", &Rect, GUI_TA_HCENTER | GUI_TA_VCENTER);
n = ySize / 5;
for (j = 0; j < GUI_COUNTOF(_aDelay); j++) {
if (_Loop(0, 5, n, _aDelay[j]) == 1) {
return;
}if (_Loop(0, 5, n, _aDelay[j]) == 1) { ... }
GUI_SetOrg(0, ySize);
GUI_Delay(250);
if (_Loop(ySize, -5, n, _aDelay[j]) == 1) {
return;
}if (_Loop(ySize, -5, n, _aDelay[j]) == 1) { ... }
GUI_SetOrg(0, 0);
GUI_Delay(250);
if (GUIDEMO_CheckCancel()) {
return;
}if (GUIDEMO_CheckCancel()) { ... }
}for (j = 0; j < GUI_COUNTOF(_aDelay); j++) { ... }
for (j = 0; j < 5; j++) {
GUI_SetOrg(0, ySize);
GUI_Delay(200);
GUI_SetOrg(0, 0);
GUI_Delay(200);
if (GUIDEMO_CheckCancel()) {
return;
}if (GUIDEMO_CheckCancel()) { ... }
}for (j = 0; j < 5; j++) { ... }
GUIDEMO_Delay(1000);
}{ ... }
/* ... */
/* ... */
void GUIDEMO_VScreen(void) {
int ySize, vySize;
ySize = LCD_GetYSize();
vySize = LCD_GetVYSize();
if (vySize < (ySize << 1)) {
return;
}if (vySize < (ySize << 1)) { ... }
GUIDEMO_ShowIntro("VScreen demo",
"Demonstrates how to use\n"
"virtual screens");
GUIDEMO_DrawBk(1);
_DemoVScreen();
GUI_SetOrg(0, 0);
}{ ... }
/* ... */#else
void GUIDEMO_VScreen(void) {}
/* ... */
#endif