static BOOL CALLBACK dialog_proc(int num, HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch (msg) { case WM_INITDIALOG: init_dialog(hwnd, num); return TRUE; case WM_COMMAND: switch (LOWORD(wparam)) { case IDC_SELECT_DRIVE_TYPE_NONE: resources_set_int_sprintf("Drive%dType", DRIVE_TYPE_NONE, num); enable_controls_for_drive_settings(hwnd, LOWORD(wparam)); break; case IDC_SELECT_DRIVE_TYPE_2031: resources_set_int_sprintf("Drive%dType", DRIVE_TYPE_2031, num); enable_controls_for_drive_settings(hwnd, LOWORD(wparam)); break; case IDC_SELECT_DRIVE_TYPE_2040: resources_set_int_sprintf("Drive%dType", DRIVE_TYPE_2040, num); enable_controls_for_drive_settings(hwnd, LOWORD(wparam)); break; case IDC_SELECT_DRIVE_TYPE_3040: resources_set_int_sprintf("Drive%dType", DRIVE_TYPE_3040, num); enable_controls_for_drive_settings(hwnd, LOWORD(wparam)); break; case IDC_SELECT_DRIVE_TYPE_4040: resources_set_int_sprintf("Drive%dType", DRIVE_TYPE_4040, num); enable_controls_for_drive_settings(hwnd, LOWORD(wparam)); break; case IDC_SELECT_DRIVE_TYPE_1001: resources_set_int_sprintf("Drive%dType", DRIVE_TYPE_1001, num); enable_controls_for_drive_settings(hwnd, LOWORD(wparam)); break; case IDC_SELECT_DRIVE_TYPE_8050: resources_set_int_sprintf("Drive%dType", DRIVE_TYPE_8050, num); enable_controls_for_drive_settings(hwnd, LOWORD(wparam)); break; case IDC_SELECT_DRIVE_TYPE_8250: resources_set_int_sprintf("Drive%dType", DRIVE_TYPE_8250, num); enable_controls_for_drive_settings(hwnd, LOWORD(wparam)); break; case IDC_SELECT_DRIVE_EXTEND_NEVER: resources_set_int_sprintf("Drive%dExtendImagePolicy", DRIVE_EXTEND_NEVER, num); break; case IDC_SELECT_DRIVE_EXTEND_ASK: resources_set_int_sprintf("Drive%dExtendImagePolicy", DRIVE_EXTEND_ASK, num); break; case IDC_SELECT_DRIVE_EXTEND_ACCESS: resources_set_int_sprintf("Drive%dExtendImagePolicy", DRIVE_EXTEND_ACCESS, num); break; default: return FALSE; } return TRUE; } return FALSE; }
void gui_enter() { int x = 1; DIALOG_PLAYER *dp; while (keypressed()) readkey(); while (key[KEY_F11]) rest(100); gui_update(); if (curtube != 3 && !mouse_amx) install_mouse(); set_color_depth(dcol); show_mouse(screen); bemgui[0].x = (windx / 2) - 36; bemgui[0].y = windy - 8; bemgui[0].fg = makecol(255,255,255); dp=init_dialog(bemgui, 0); while (x && !key[KEY_F11] && !key[KEY_ESC]) { x = update_dialog(dp); } shutdown_dialog(dp); show_mouse(NULL); set_color_depth(8); if (curtube != 3 && !mouse_amx) remove_mouse(); while (key[KEY_F11]) rest(100); video_clearscreen(); }
int main(int argc, char **argv) { int retval; unsigned char *tresult; init_dialog(); use_helpfile("ftree2.test"); use_helpline("Press Arrows, Tab, Enter or F1"); retval = dialog_ftree("ftree2.test", '\t', "ftree dialog box example", "xterm widget tree from preprocess editres(1) dump", -1, -1, 15, &tresult); dialog_update(); dialog_clear(); end_dialog(); if (!retval) { puts(tresult); free(tresult); } exit(retval); }
static int global_init(void) { int r; // TODO check all retcodes setlocale(LC_ALL, ""); initscr(); init_dialog(stdin, stdout); dialog_vars.item_help = 0; start_color(); init_my_colors(); noecho(); cbreak(); scrollok(stdscr, FALSE); keypad(stdscr, TRUE); clear_body(); // init libdevcheck r = dc_init(); assert(!r); RENDERER_REGISTER(sliding_window); RENDERER_REGISTER(whole_space); dc_log_set_callback(log_cb, NULL); r = atexit(global_fini); assert(r == 0); return 0; }
int simulation_init() { simulation_cleanup(); initialize_cells(); simulation.update = simulation.generations = 1; simulation.g_pred_breed = 15; simulation.g_pred_starve = 5; simulation.g_prey_breed = 5; if(Application->r_w % MAP_WIDTH != 0 || Application->r_h % MAP_HEIGHT != 0) { MessageBox(Application->hWnd, "Width or height do not divide evenly into resolution.\n", "Attention", MB_ICONEXCLAMATION); } simulation.gwidth = floor(Application->r_w / MAP_WIDTH); simulation.gheight = floor(Application->r_h / MAP_HEIGHT); init_dialog(); if(!simulation.Config) { fprintf(stderr, "Configuration dialog failed to load. GetLastError: %s \n", (char*)GetLastError()); return 0; } setStatus("Varibles set up successfully."); time_start(Gametimer); time_pause(Gametimer); simulation.generation = simulation.tickdelay = simulation.total_prey = simulation.total_pred = amount = 0; cleanup_cells(); return 1; }
int main(int ac, char **av) { char *mode; int res; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); conf_parse(av[1]); conf_read(NULL); mode = getenv("MENUCONFIG_MODE"); if (mode) { if (!strcasecmp(mode, "single_menu")) single_menu_mode = 1; } tcgetattr(1, &ios_org); atexit(conf_cleanup); init_wsize(); reset_dialog(); init_dialog(NULL); set_config_filename(conf_get_configname()); do { conf(&rootmenu); dialog_clear(); if (conf_get_changed()) res = dialog_yesno(NULL, _("Do you wish to save your " "new configuration?\n" "<ESC><ESC> to continue."), 6, 60); else res = -1; } while (res == KEY_ESC); end_dialog(); switch (res) { case 0: if (conf_write(filename)) { fprintf(stderr, _("\n\n" "Error during writing of the configuration.\n" "Your configuration changes were NOT saved." "\n\n")); return 1; } case -1: printf(_("\n\n" "*** End of configuration.\n" "\n\n")); break; default: fprintf(stderr, _("\n\n" "Your configuration changes were NOT saved." "\n\n")); } return 0; }
int main(int ac, char **av) { struct symbol *sym; char *mode; int res; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); conf_parse(av[1]); conf_read(NULL); sym = sym_lookup("KERNELVERSION", 0); sym_calc_value(sym); sprintf(menu_backtitle, _("Linux Kernel v%s Configuration"), sym_get_string_value(sym)); mode = getenv("MENUCONFIG_MODE"); if (mode) { if (!strcasecmp(mode, "single_menu")) single_menu_mode = 1; } tcgetattr(1, &ios_org); atexit(conf_cleanup); init_wsize(); reset_dialog(); init_dialog(menu_backtitle); do { conf(&rootmenu); dialog_clear(); res = dialog_yesno(NULL, _("Do you wish to save your " "new kernel configuration?\n" "<ESC><ESC> to continue."), 6, 60); } while (res == KEY_ESC); end_dialog(); if (res == 0) { if (conf_write(NULL)) { fprintf(stderr, _("\n\n" "Error during writing of the kernel configuration.\n" "Your kernel configuration changes were NOT saved." "\n\n")); return 1; } printf(_("\n\n" "*** End of Linux kernel configuration.\n" "*** Execute 'make' to build the kernel or try 'make help'." "\n\n")); } else { fprintf(stderr, _("\n\n" "Your kernel configuration changes were NOT saved." "\n\n")); } return 0; }
int main(int ac, char **av) { int stat; char *mode; struct symbol *sym; conf_parse(av[1]); conf_read(NULL); sym = sym_lookup("VERSION", 0); sym_calc_value(sym); snprintf(menu_backtitle, 128, "Core v%s Configuration", sym_get_string_value(sym)); mode = getenv("MENUCONFIG_MODE"); if (mode) { if (!strcasecmp(mode, "single_menu")) single_menu_mode = 1; } tcgetattr(1, &ios_org); atexit(conf_cleanup); init_wsize(); init_dialog(); signal(SIGWINCH, winch_handler); conf(&rootmenu); end_dialog(); /* Restart dialog to act more like when lxdialog was still separate */ init_dialog(); do { stat = dialog_yesno(NULL, "Do you wish to save your new Core configuration?", 5, 60); } while (stat < 0); end_dialog(); if (stat == 0) { conf_write(NULL); printf("\n\n" "*** End of Core configuration.\n" "*** Check the top-level Makefile for additional configuration options.\n\n"); } else printf("\n\nYour Core configuration changes were NOT saved.\n\n"); return 0; }
void MainWindow::reinitScreen() { /* FIXME: there must be a better way to do this */ end_dialog(); erase(); init_dialog(stdin, stdout); dlg_put_backtitle(); }
static int _menu1_fw_action(dialogMenuItem * self) { dialog_clear(); init_dialog(); main_fw_menu(); return DITEM_SUCCESS | DITEM_RESTORE | DITEM_CONTINUE; }
int main(int ac, char **av) { struct symbol *sym; char *mode; int stat; conf_parse(av[1]); conf_read(NULL); sym = sym_lookup("VERSION", 0); sym_calc_value(sym); snprintf(menu_backtitle, 128, "BusyBox v%s Configuration", sym_get_string_value(sym)); mode = getenv("MENUCONFIG_MODE"); if (mode) { if (!strcasecmp(mode, "single_menu")) single_menu_mode = 1; } tcgetattr(1, &ios_org); atexit(conf_cleanup); init_wsize(); init_dialog(); signal(SIGWINCH, winch_handler); conf(&rootmenu); end_dialog(); /* Restart dialog to act more like when lxdialog was still separate */ init_dialog(); do { stat = dialog_yesno(NULL, "Do you wish to save your new diagnostic program configuration?", 6, 60); } while (stat < 0); end_dialog(); if (stat == 0) { conf_write(NULL); printf("\n\n" "*** End of SQ diagnostic program configuration.\n"); printf("*** Execute 'make' to build the diagnostic program or try 'make help'.\n\n"); } else printf("\n\nYour diagnostic program configuration changes were NOT saved.\n\n"); return 0; }
int main(int argc, char *argv[]) { init_dialog(); _afm_menu(); end_dialog(); return 0; }
int main(int argc, char **argv) { int retval; unsigned char *tresult; char comstr[BUFSIZ]; init_dialog(); do { use_helpline("Press OK for listing directory"); retval = dialog_tree(names, sizeof(names)/sizeof(unsigned char *) - 1, '/', "tree dialog box example", "Typical find -x / -type d output", -1, -1, 15, &tresult); if (retval) break; use_helpline(NULL); (void)snprintf(comstr, sizeof(comstr), "ls -CF %s", tresult); retval = dialog_prgbox( comstr, comstr, 20, 60, TRUE, TRUE); dialog_clear(); retval = dialog_tree(names1, sizeof(names1)/sizeof(unsigned char *), ':', "tree dialog box example", "Other tree", -1, -1, 5, &tresult); if (!retval) { dialog_clear(); } } while (!retval); dialog_update(); dialog_clear(); end_dialog(); exit(retval); }
/* Kick it off, James! */ int main(int argc, char **argv) { int retval; init_dialog(); retval = dialog_dselect(".", "*"); dialog_clear(); fprintf(stderr, "returned value for dialog_dselect was %d\n", retval); end_dialog(); return 0; }
/* Kick it off, James! */ int main(int argc, unsigned char *argv[]) { int retval; init_dialog(); retval = dialog_textbox("This is dialog_textbox() in action with /etc/passwd", "/etc/passwd", 10, 60); dialog_clear(); fprintf(stderr, "returned value for dialog_textbox was %d\n", retval); end_dialog(); return 0; }
/* Kick it off, James! */ int main(int argc, char **argv) { int i; init_dialog(); for (i = 0; i <= 100; i++) { dialog_gauge("Gas tank", "When this gets 100% full, you'd better yank out the nozzle!", 10, 1, 7, 70, i); usleep(30000); } end_dialog(); return 0; }
/* Kick it off, James! */ int main(int argc, char **argv) { int retval; init_dialog(); retval = dialog_msgbox("This is dialog_msgbox() in action with pause on", "Hi there. Please press return now.", -1, -1, 1); dialog_clear(); fprintf(stderr, "returned value for dialog_msgbox was %d\n", retval); end_dialog(); return 0; }
/* Kick it off, James! */ int main(int argc, char **argv) { int retval; init_dialog(); retval = dialog_checklist("this is dialog_checklist() in action, test #2", "Same as before, but now we relabel the buttons and override the OK action.", -1, -1, 4, -4, menu3 + 2, (char *)TRUE); dialog_clear(); fprintf(stderr, "returned value for dialog_checklist was %d\n", retval); end_dialog(); return 0; }
int run(int argc, char **argv) { FILE *input = stdin; dialog_state.output = stderr; char *ptr; fwutil_i18ninit(__FILE__); init_dialog(input, dialog_state.output); fwdialog_backtitle(_("RAID configuration")); ptr = ask_mode(); free(ptr); if(argv!=NULL) end_dialog(); return(0); }
/* Kick it off, James! */ int main(int argc, char **argv) { char *retval; init_dialog(); retval = dialog_fselect(".", "*.[ch]"); dialog_clear(); if (retval) fprintf(stderr, "returned value for dialog_fselect was %s\n", retval); else fprintf(stderr, "returned value for dialog_fselect was NULL\n"); end_dialog(); return 0; }
/* Kick it off, James! */ int main(int argc, char **argv) { int retval; init_dialog(); retval = dialog_menu("this is dialog_menu() in action, test #1", "this simple menu shows off some of the straight-forward features\n" "of the new menu system's action dispatch hooks. Select Cancel to leave", -1, -1, 3, -3, menu1, NULL, NULL, NULL); dialog_clear(); fprintf(stderr, "returned value for dialog_menu was %d\n", retval); end_dialog(); return 0; }
/* Kick it off, James! */ int main(int argc, char **argv) { int retval; init_dialog(); retval = dialog_checklist("this is dialog_checklist() in action, test #3", "Now we show off some of the button 'styles' one can create.", -1, -1, 7, -7, menu4, NULL); dialog_clear(); fprintf(stderr, "spent $%d on %s%s%s books\n", spending, german_book ? " german" : "", italian_book ? " italian" : "", slang_book ? " slang" : ""); end_dialog(); return 0; }
/* Kick it off, James! */ int main(int argc, char **argv) { int retval; unsigned char result[128]; init_dialog(); strcpy(result, "not this!"); retval = dialog_inputbox("this is dialog_inputbox() in action, test #1", "Enter something really profound below, please.", -1, -1, result); dialog_clear(); fprintf(stderr, "returned value for dialog_inputbox was %d (%s)\n", retval, result); end_dialog(); return 0; }
/* Kick it off, James! */ int main(int argc, char **argv) { int retval; init_dialog(); retval = dialog_radiolist("this is dialog_radiolist() in action, test #2", "Welcome to \"The Love Blender!\" - America's favorite game show\n" "where YOU, the contestant, get to choose which of these two\n" "fine specimens of humanity will go home together, whether they\n" "like it or not!", -1, -1, 7, -7, menu6, NULL); dialog_clear(); fprintf(stderr, "I'm sure that %s and %s will be very happy together!\n", bachelor, bachelette); end_dialog(); return 0; }
static INT_PTR CALLBACK dialog_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { int type; switch (msg) { case WM_INITDIALOG: init_dialog(hwnd); return TRUE; case WM_COMMAND: type = LOWORD(wparam); switch (type) { case IDC_SELECT_CBMII_610: cbm2_set_model("610", NULL); break; case IDC_SELECT_CBMII_620: cbm2_set_model("620", NULL); break; case IDC_SELECT_CBMII_620P: cbm2_set_model("620+", NULL); break; case IDC_SELECT_CBMII_710: cbm2_set_model("710", NULL); break; case IDC_SELECT_CBMII_720: cbm2_set_model("720", NULL); break; case IDC_SELECT_CBMII_720P: cbm2_set_model("720+", NULL); break; case IDC_SELECT_CBMII_HW0: resources_set_int("ModelLine", 0); break; case IDC_SELECT_CBMII_HW1: resources_set_int("ModelLine", 1); break; case IDC_SELECT_CBMII_HW2: resources_set_int("ModelLine", 2); break; } return TRUE; } return FALSE; }
static BOOL CALLBACK dialog_proc(unsigned int num, HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch (msg) { case WM_INITDIALOG: init_dialog(hwnd, num); return TRUE; case WM_NOTIFY: { NMHDR *nmhdr = (NMHDR *)(lparam); switch (nmhdr->code) { case PSN_APPLY: SetWindowLongPtr(hwnd, DWLP_MSGRESULT, store_dialog_results(hwnd, num) ? PSNRET_NOERROR : PSNRET_INVALID); return TRUE; } break; } case WM_COMMAND: switch (LOWORD(wparam)) { case IDC_SELECTDIR: case IDC_SELECTDISK: case IDC_SELECTREAL: case IDC_SELECTNONE: enable_controls_for_disk_device_type(hwnd, LOWORD(wparam)); break; case IDC_TOGGLE_USEIECDEVICE: enable_controls(hwnd); break; case IDC_BROWSEDISK: browse_diskimage(hwnd); break; case IDC_AUTOSTART: autostart_diskimage(hwnd); break; case IDC_BROWSEDIR: browse_dir(hwnd); break; } return TRUE; } return FALSE; }
/* Kick it off, James! */ int main(int argc, char **argv) { int retval; init_dialog(); DialogX = 5; DialogY = 1; retval = dialog_menu("Do you have the GUTS?", "C'mon, macho man! Do you have what it takes to do something REALLY\n" "dangerous and stupid? WHAT ARE YOU WAITING FOR?!", -1, -1, 3, -3, doit + 2, (char *)TRUE, NULL, NULL); dialog_clear(); fprintf(stderr, "returned value for dialog_menu was %d\n", retval); end_dialog(); return 0; }
/* Kick it off, James! */ int main(int argc, unsigned char *argv[]) { int retval; unsigned char result[128]; init_dialog(); result[0]='\0'; DialogInputAttrs |= DITEM_NO_ECHO; retval = dialog_inputbox("this is dialog_inputbox() in action, test #2 (no echo)", "Enter something really secret below, please.", -1, -1, result); DialogInputAttrs &= DITEM_NO_ECHO; dialog_clear(); fprintf(stderr, "returned value for dialog_inputbox was %d (%s)\n", retval, result); end_dialog(); return 0; }
void TipButton::feel( int mouse ) { init_dialog( Tip, NULL, NULL ); ready_dialog( Tip, NULL, NULL, tip_feel, NULL, NULL, NULL ); center_dialog( Tip ); save_under_dialog( Tip ); draw_dialog( Tip ); //CRASH//debug( "Render icon" ); gfx_blit( kyle_icon_data, Tip[ICON].sx, Tip[ICON].sy, Tip[ICON].width, Tip[ICON].height, 15 ); _nTipOfTheDay = rand() % _nTips; drawTipText(); do_dialog( Tip, -1 ); restore_under_dialog(); dialog_done = 0; // override inside dialog box's setting }
/* Kick it off, James! */ int main(int argc, char **argv) { int retval; init_dialog(); DialogX = 5; DialogY = 1; retval = dialog_radiolist("this is dialog_radiolist() in action, test #3", "This radio menu shows off the ability to put dialog menus and other\n" "controls at different locations, as well as the `selected' hook which\n" "lets you follow the traversal of the selection bar as well as what's\n" "selected.", -1, -1, 3, -3, menu5, NULL); dialog_clear(); fprintf(stderr, "returned value for dialog_radiolist was %d (money set to %d)\n", retval, spending); end_dialog(); return 0; }