GUI * CreateTimeInputVA( int, ... );
Функция создает окно для ввода времени
Возвращает указатель на созданный GUI
#define TI_GET_HOUR(x) ((unsigned int)x&0xFF) #define TI_GET_MIN(x) (((unsigned int)x>>8)&0xFF) #define TI_GET_SEC(x) (((unsigned int)x>>16)&0xFF) void onTimeInputClose(BOOK * book, GUI *) { FreeBook(book); } void onTimeInputOK(BOOK * book, GUI * gui) { char buf[9]; unsigned int time = TimeInput_GetTimeInt(gui); sprintf(buf, "%02d:%02d:%02d", TI_GET_HOUR(time), TI_GET_MIN(time), TI_GET_SEC(time)); MessageBox(EMPTY_TEXTID, TextID_Create(buf, ENC_LAT1, TEXTID_ANY_LEN), NOIMAGE, 1, 5000, 0); } void CreateTimeInput(void) { DATETIME dt; char format; BOOK * TimeInput = new BOOK; CreateBook(TimeInput, 0, 0, "TimeInputTest", -1, 0); REQUEST_DATEANDTIME_GET(SYNC, &dt); REQUEST_TIMEFORMAT_GET(SYNC, &format); GUI * Time = CreateDateInputVA(0, VAR_BOOK(TimeInput), VAR_HEADER_TEXT(STR("Time")), VAR_TIMEINP_TIME_FORMAT((int)format), VAR_TIMEINP_TIMEFORMAT_SEC(1), VAR_TIMEINP_TIME(&dt.time), 0); GUIObject_SoftKeys_SetAction(Time, ACTION_ACCEPT, onTimeInputOK); GUIObject_SoftKeys_SetAction(Time, ACTION_BACK, onTimeInputClose); GUIObject_SoftKeys_SetAction(Time, ACTION_LONG_BACK, onTimeInputClose); }