void GUI_Info_HIG(const ADM_LOG_LEVEL level,const char *primary, const char *secondary_format, ...) { uint32_t msglvl=2; prefs->get(MESSAGE_LEVEL,&msglvl); boxStart(); boxAdd("Info"); boxAdd(primary); if(! secondary_format) { boxEnd(); return; } va_list ap; va_start(ap, secondary_format); char alertstring[1024]; vsnprintf(alertstring,1023,secondary_format, ap); va_end(ap); boxAdd(alertstring); boxEnd(); }
uint8_t GUI_getDoubleValue(double *valye, float min, float max, const char *title) { boxStart(); boxAdd("DOUBLEVALUE stub"); boxAdd(title); boxEnd(); return 0; }
int GUI_Alternate(char *title,char *choice1,char *choice2) { boxStart(); boxAdd("Choice"); boxAdd(title); boxEnd(); while(1) { printf("0->%s 1->%s :\n",choice1,choice2); int x=tolower(getchar()); if(x=='0') return 0; if(x=='1') return 1; } }
void GUI_Error_HIG(const char *primary, const char *secondary_format) { boxStart(); boxAdd("Error"); boxAdd(primary); if(!secondary_format) { boxEnd(); return; }else { boxAdd(secondary_format); boxEnd(); } }
int GUI_Question(const char *alertstring) { boxStart(); boxAdd("Question"); boxAdd(alertstring); boxEnd(); while(1) { printf("Yes or No (Y/y or N/n) :\n"); int x=tolower(getchar()); if(x=='y') return 1; if(x=='n') return 0; } }
int GUI_Confirmation_HIG(const char *button_confirm, const char *primary, const char *secondary_format, ...) { uint32_t msglvl=2; prefs->get(MESSAGE_LEVEL,&msglvl); boxStart(); boxAdd("Question"); boxAdd(button_confirm); if(! secondary_format) { boxEnd(); } else { va_list ap; va_start(ap, secondary_format); char alertstring[1024]; vsnprintf(alertstring,1023,secondary_format, ap); va_end(ap); boxAdd(alertstring); boxEnd(); } if (beQuiet) { boxAdd("--> First one\n"); return 0; } else { int x; while(1) { printf("Are you sure (Y/y or N/n ):\n"); x=tolower(getchar()); if(x=='y') return 1; if(x=='n') return 0; } } return 0; }
void GUI_Info_HIG(const ADM_LOG_LEVEL level,const char *primary, const char *secondary_format) { uint32_t msglvl=2; prefs->get(MESSAGE_LEVEL,&msglvl); boxStart(); boxAdd("Info"); boxAdd(primary); if(! secondary_format) { boxEnd(); return; } boxAdd(secondary_format); boxEnd(); }
void GUI_Error_HIG(const char *primary, const char *secondary_format, ...) { boxStart(); boxAdd("Error"); boxAdd(primary); if(!secondary_format) { boxEnd(); return; }else { va_list ap; va_start(ap, secondary_format); char alertstring[1024]; vsnprintf(alertstring,1023,secondary_format, ap); va_end(ap); boxAdd(alertstring); boxEnd(); } }
int GUI_Confirmation_HIG(const char *button_confirm, const char *primary, const char *secondary_format) { uint32_t msglvl=2; prefs->get(MESSAGE_LEVEL,&msglvl); boxStart(); boxAdd("Question"); boxAdd(button_confirm); if(! secondary_format) { boxEnd(); } else { boxAdd(secondary_format); boxEnd(); } if (beQuiet) { boxAdd("--> First one\n"); return 0; } else { int x; while(1) { printf("Are you sure (Y/y or N/n ):\n"); x=tolower(getchar()); if(x=='y') return 1; if(x=='n') return 0; } } return 0; }