298 | | |
299 | | }}} |
300 | | |
| 298 | EVENT(TimeShow) |
| 299 | { |
| 300 | ClearLCD(); |
| 301 | SetCurColor(COLOR_ATTENTION); |
| 302 | PrintLCD("Set Time"); |
| 303 | return 0; |
| 304 | } |
| 305 | |
| 306 | int SetTime(void) |
| 307 | { |
| 308 | int n; |
| 309 | FORM_INIT(Time, EventTimeShow, NULL, NULL, NULL, nFormFlgShowHelp); |
| 310 | FORM_ADD_INPUT(Time, Hour, FONT_WIDTH * 0, FONT_HEIGHT * 3, "Hour: ", 2, 0, 23, NULL, &g_datetime.hour, FORM_UINT8, NULL, "Enter the hour in 24 hour time\r3 p.m. = 15"); |
| 311 | FORM_ADD_INPUT(Time, Minute, FONT_WIDTH * 0, FONT_HEIGHT * 5, "Minute: ", 2, 0, 59, NULL, &g_datetime.minute, FORM_UINT8, NULL, "Enter the minutes"); |
| 312 | FORM_ADD_INPUT(Time, Second, FONT_WIDTH * 0, FONT_HEIGHT * 7, "Second: ", 2, 0, 59, NULL, &g_datetime.second, FORM_UINT8, NULL, "Enter the seconds"); |
| 313 | |
| 314 | FORM_SHOW(Time); |
| 315 | n = FORM_RUN(Time); |
| 316 | FORM_HIDE(Time); |
| 317 | if(n) { |
| 318 | // Set the time |
| 319 | // ... |
| 320 | } |
| 321 | return n; |
| 322 | } |
| 323 | }}} |
| 324 | |