static void init_c64burstmod_dialog(HWND hwnd) { HWND temp_hwnd; int res_value; int xsize, ysize; uilib_localize_dialog(hwnd, c64burstmod_dialog); uilib_adjust_group_width(hwnd, c64burstmod_left_total_group); uilib_get_group_extent(hwnd, c64burstmod_leftgroup, &xsize, &ysize); uilib_adjust_group_width(hwnd, c64burstmod_leftgroup); uilib_move_group(hwnd, c64burstmod_rightgroup, xsize + 30); resources_get_int("BurstMod", &res_value); CheckDlgButton(hwnd, IDC_C64BURSTMOD_ENABLE, res_value ? BST_CHECKED : BST_UNCHECKED); temp_hwnd = GetDlgItem(hwnd, IDC_C64BURSTMOD_CIA); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"CIA-1"); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"CIA-2"); if (res_value) { SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)res_value - 1, 0); } else { SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)0, 0); } enable_c64burstmod_controls(hwnd); }
static void init_plus256k_dialog(HWND hwnd) { int res_value; const char *plus256kfile; TCHAR *st_plus256kfile; int xsize, ysize; uilib_localize_dialog(hwnd, plus256k_dialog); uilib_adjust_group_width(hwnd, plus256k_group1); uilib_get_group_extent(hwnd, plus256k_leftgroup, &xsize, &ysize); uilib_adjust_group_width(hwnd, plus256k_leftgroup); uilib_move_group(hwnd, plus256k_rightgroup, xsize + 30); resources_get_int("PLUS256K", &res_value); CheckDlgButton(hwnd, IDC_PLUS256K_ENABLE, res_value ? BST_CHECKED : BST_UNCHECKED); resources_get_string("PLUS256Kfilename", &plus256kfile); st_plus256kfile = system_mbstowcs_alloc(plus256kfile); SetDlgItemText(hwnd, IDC_PLUS256K_FILE, plus256kfile != NULL ? st_plus256kfile : TEXT("")); system_mbstowcs_free(st_plus256kfile); enable_plus256k_controls(hwnd); }
static void init_mapping_dialog(HWND hwnd) { int idc_index, i; int xpos; RECT rect; /* translate all dialog items */ uilib_localize_dialog(hwnd, mapping_dialog_trans); /* translate ok and cancel items */ uilib_localize_dialog(hwnd, ok_cancel_trans); /* adjust the size of the elements in the buttons group */ uilib_adjust_group_width(hwnd, mapping_buttons_group); /* adjust the size of the elements in the left group */ uilib_adjust_group_width(hwnd, mapping_left_group); /* get the max x of the left group */ uilib_get_group_max_x(hwnd, mapping_left_group, &xpos); /* move the middle group to the correct position */ uilib_move_group(hwnd, mapping_middle_group, xpos + 10); /* get the max x of the middle group */ uilib_get_group_max_x(hwnd, mapping_middle_group, &xpos); /* move the right group to the correct position */ uilib_move_group(hwnd, mapping_right_group, xpos + 10); /* get the max x of the right group */ uilib_get_group_max_x(hwnd, mapping_right_group, &xpos); /* set the width of the dialog to 'surround' all the elements */ GetWindowRect(hwnd, &rect); MoveWindow(hwnd, rect.left, rect.top, xpos + 10, rect.bottom - rect.top, TRUE); /* recenter the buttons in the newly resized dialog window */ uilib_center_buttons(hwnd, mapping_move_buttons_group, 0); /* recenter the ok and cancel buttons in the newly resized dialog window */ uilib_center_buttons(hwnd, ok_cancel_move_group, 0); idc_index = mapping_index_get(); CheckRadioButton(hwnd, mapping_entry[0].idc_select, mapping_entry[uikeyboard_mapping_num - 1].idc_select, idc_index); for (i = 0; i < uikeyboard_mapping_num; i++) { const char *fname; TCHAR *st_fname; resources_get_string(mapping_entry[i].res_filename, &fname); st_fname = system_mbstowcs_alloc(fname); SetDlgItemText(hwnd, mapping_entry[i].idc_filename, fname != NULL ? st_fname : TEXT("")); system_mbstowcs_free(st_fname); } enable_mapping_controls(hwnd, idc_index); }
static void init_autostart_dialog(HWND hwnd) { HWND temp_hwnd; int res_value; const char *autostartfile; TCHAR *st_autostartfile; int xsize, ysize; int xsize2; RECT rect; uilib_localize_dialog(hwnd, autostart_dialog); uilib_get_group_extent(hwnd, autostart_leftgroup1, &xsize, &ysize); uilib_adjust_group_width(hwnd, autostart_leftgroup1); uilib_move_and_adjust_group_width(hwnd, autostart_rightgroup1, xsize + 30); uilib_get_group_extent(hwnd, autostart_leftgroup2, &xsize2, &ysize); uilib_adjust_group_width(hwnd, autostart_leftgroup2); uilib_move_group(hwnd, autostart_rightgroup2, xsize2 + 30); /* get the max x of the rightgroup3 elements */ uilib_get_group_max_x(hwnd, autostart_rightgroup3, &xsize); /* resize the text fill-in box */ uilib_move_and_set_element_width(hwnd, IDC_AUTOSTART_DISK_IMAGE_FILE, 9, xsize - 9); /* set the width of the dialog to 'surround' all the elements */ GetWindowRect(hwnd, &rect); MoveWindow(hwnd, rect.left, rect.top, xsize + 20, rect.bottom - rect.top, TRUE); /* recenter the buttons in the newly resized dialog window */ uilib_center_buttons(hwnd, move_buttons_group, 0); resources_get_int("AutostartWarp", &res_value); CheckDlgButton(hwnd, IDC_AUTOSTART_WARP, res_value ? BST_CHECKED : BST_UNCHECKED); resources_get_int("AutostartRunWithColon", &res_value); CheckDlgButton(hwnd, IDC_AUTOSTART_USE_COLON_WITH_RUN, res_value ? BST_CHECKED : BST_UNCHECKED); resources_get_int("AutostartBasicLoad", &res_value); CheckDlgButton(hwnd, IDC_AUTOSTART_LOAD_TO_BASIC, res_value ? BST_CHECKED : BST_UNCHECKED); resources_get_int("AutostartDelayRandom", &res_value); CheckDlgButton(hwnd, IDC_AUTOSTART_RANDOM_DELAY, res_value ? BST_CHECKED : BST_UNCHECKED); resources_get_int("AutostartHandleTrueDriveEmulation", &res_value); CheckDlgButton(hwnd, IDC_AUTOSTART_HANDLE_TRUE_DRIVE_EMULATION, res_value ? BST_CHECKED : BST_UNCHECKED); temp_hwnd = GetDlgItem(hwnd, IDC_AUTOSTART_PRG_MODE); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)translate_text(IDS_AUTOSTART_VIRTUAL_FS)); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)translate_text(IDS_AUTOSTART_INJECT)); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)translate_text(IDS_AUTOSTART_DISK)); resources_get_int("AutostartPrgMode", &res_value); SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)res_value, 0); resources_get_string("AutostartPrgDiskImage", &autostartfile); st_autostartfile = system_mbstowcs_alloc(autostartfile); SetDlgItemText(hwnd, IDC_AUTOSTART_DISK_IMAGE_FILE, autostartfile != NULL ? st_autostartfile : TEXT("")); system_mbstowcs_free(st_autostartfile); }
static void init_ramcart_dialog(HWND hwnd) { HWND temp_hwnd; int res_value; const char *ramcartfile; TCHAR *st_ramcartfile; int res_value_loop; int active_value; int xsize, ysize; int xsize2; uilib_localize_dialog(hwnd, ramcart_dialog); uilib_get_group_extent(hwnd, ramcart_leftgroup1, &xsize, &ysize); uilib_adjust_group_width(hwnd, ramcart_maingroup); uilib_adjust_group_width(hwnd, ramcart_leftgroup1); uilib_move_and_adjust_group_width(hwnd, ramcart_rightgroup1, xsize + 30); uilib_get_group_extent(hwnd, ramcart_leftgroup2, &xsize2, &ysize); uilib_adjust_group_width(hwnd, ramcart_leftgroup2); uilib_move_group(hwnd, ramcart_rightgroup2, xsize2 + 30); resources_get_int("RAMCART", &res_value); CheckDlgButton(hwnd, IDC_RAMCART_ENABLE, res_value ? BST_CHECKED : BST_UNCHECKED); resources_get_int("RAMCARTImageWrite", &res_value); CheckDlgButton(hwnd, IDC_RAMCART_WRITE_ENABLE, res_value ? BST_CHECKED : BST_UNCHECKED); resources_get_int("RAMCART_RO", &res_value); CheckDlgButton(hwnd, IDC_RAMCART_RO, res_value ? BST_CHECKED : BST_UNCHECKED); temp_hwnd = GetDlgItem(hwnd, IDC_RAMCART_SIZE); for (res_value_loop = 0; ui_ramcart_size[res_value_loop] != 0; res_value_loop++) { TCHAR st[10]; _itot(ui_ramcart_size[res_value_loop], st, 10); _tcscat(st, translate_text(IDS_SPACE_KB)); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)st); } resources_get_int("RAMCARTsize", &res_value); active_value = 0; for (res_value_loop = 0; ui_ramcart_size[res_value_loop] != 0; res_value_loop++) { if (ui_ramcart_size[res_value_loop] == res_value) { active_value = res_value_loop; } } SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)active_value, 0); resources_get_string("RAMCARTfilename", &ramcartfile); st_ramcartfile = system_mbstowcs_alloc(ramcartfile); SetDlgItemText(hwnd, IDC_RAMCART_FILE, ramcartfile != NULL ? st_ramcartfile : TEXT("")); system_mbstowcs_free(st_ramcartfile); enable_ramcart_controls(hwnd); }
static void init_ds12c887rtc_dialog(HWND hwnd) { HWND temp_hwnd; int res_value; int res_value_loop; int active_value; int xsize, ysize; int *ui_ds12c887rtc_base; if (machine_class == VICE_MACHINE_VIC20) { ui_ds12c887rtc_base = ui_vic20_ds12c887rtc_base; } else if (machine_class == VICE_MACHINE_C128) { ui_ds12c887rtc_base = ui_c128_ds12c887rtc_base; } else { ui_ds12c887rtc_base = ui_c64_ds12c887rtc_base; } uilib_localize_dialog(hwnd, ds12c887rtc_dialog); uilib_adjust_group_width(hwnd, ds12c887rtc_left_total_group); uilib_get_group_extent(hwnd, ds12c887rtc_leftgroup, &xsize, &ysize); uilib_adjust_group_width(hwnd, ds12c887rtc_leftgroup); uilib_move_group(hwnd, ds12c887rtc_rightgroup, xsize + 30); resources_get_int("DS12C887RTC", &res_value); CheckDlgButton(hwnd, IDC_DS12C887RTC_ENABLE, res_value ? BST_CHECKED : BST_UNCHECKED); resources_get_int("DS12C887RTCRunMode", &res_value); CheckDlgButton(hwnd, IDC_DS12C887RTC_RUNMODE, res_value ? BST_CHECKED : BST_UNCHECKED); resources_get_int("DS12C887RTCSave", &res_value); CheckDlgButton(hwnd, IDC_DS12C887RTC_SAVE, res_value ? BST_CHECKED : BST_UNCHECKED); temp_hwnd = GetDlgItem(hwnd, IDC_DS12C887RTC_BASE); for (res_value_loop = 0; ui_ds12c887rtc_base[res_value_loop] != -1; res_value_loop++) { TCHAR st[40]; _stprintf(st, "$%X", ui_ds12c887rtc_base[res_value_loop]); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)st); } resources_get_int("DS12C887RTCbase", &res_value); active_value = 0; for (res_value_loop = 0; ui_ds12c887rtc_base[res_value_loop] != -1; res_value_loop++) { if (ui_ds12c887rtc_base[res_value_loop] == res_value) { active_value = res_value_loop; } } SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)active_value, 0); enable_ds12c887rtc_controls(hwnd); }
static void init_romset_dialog(HWND hwnd) { int res_value, idc_active; const char *name; TCHAR *st_name; /* translate all dialog items */ uilib_localize_dialog(hwnd, romset_dialog_trans); /* adjust the size of the elements in the main group */ uilib_adjust_group_width(hwnd, romset_main_group); resources_get_int("RomsetSourceFile", &res_value); idc_active = IDC_ROMSET_SELECT_ARCHIVE + res_value; update_romset_dialog(hwnd, idc_active); resources_get_string("RomsetArchiveName", &name); st_name = system_mbstowcs_alloc(name); SetDlgItemText(hwnd, IDC_ROMSET_ARCHIVE_NAME, name != NULL ? st_name : TEXT("")); system_mbstowcs_free(st_name); resources_get_string("RomsetFileName", &name); st_name = system_mbstowcs_alloc(name); SetDlgItemText(hwnd, IDC_ROMSET_FILE_NAME, name != NULL ? st_name : TEXT("")); system_mbstowcs_free(st_name); }
static void init_pet8296_dialog(HWND hwnd) { int n; int xstart; int xpos; HWND parent_hwnd; parent_hwnd = GetParent(hwnd); /* translate all dialog items */ uilib_localize_dialog(hwnd, pet8296_dialog_trans); /* translate all dialog items of the parent */ uilib_localize_dialog(parent_hwnd, parent_dialog_trans); /* adjust the size of the elements in the main group */ uilib_adjust_group_width(hwnd, pet8296_main_group); /* get the min x of the ram 9 element */ uilib_get_element_min_x(hwnd, IDC_TOGGLE_PET_8296_RAM9, &xstart); /* get the max x of the main group */ uilib_get_group_max_x(hwnd, pet8296_main_group, &xpos); /* resize and move the group box to the correct position */ uilib_move_and_set_element_width(hwnd, IDC_PET_RAM_SETTINGS, xstart - 10, xpos - xstart + 20); resources_get_int("Ram9", &n); CheckDlgButton(hwnd, IDC_TOGGLE_PET_8296_RAM9, n ? BST_CHECKED : BST_UNCHECKED); resources_get_int("RamA", &n); CheckDlgButton(hwnd, IDC_TOGGLE_PET_8296_RAMA, n ? BST_CHECKED : BST_UNCHECKED); }
static void init_easyflash_dialog(HWND hwnd) { int res_value; int xpos; RECT rect; /* translate all dialog items */ uilib_localize_dialog(hwnd, easyflash_dialog_trans); /* adjust the size of the elements in the main group */ uilib_adjust_group_width(hwnd, easyflash_group); /* get the max x of the main group */ uilib_get_group_max_x(hwnd, easyflash_group, &xpos); /* set the width of the dialog to 'surround' all the elements */ GetWindowRect(hwnd, &rect); MoveWindow(hwnd, rect.left, rect.top, xpos + 10, rect.bottom - rect.top, TRUE); /* recenter the buttons in the newly resized dialog window */ uilib_center_buttons(hwnd, move_buttons_group, 0); resources_get_int("EasyFlashJumper", &res_value); CheckDlgButton(hwnd, IDC_EASYFLASH_JUMPER, res_value ? BST_CHECKED : BST_UNCHECKED); resources_get_int("EasyFlashWriteCRT", &res_value); CheckDlgButton(hwnd, IDC_EASYFLASH_AUTOSAVE, res_value ? BST_CHECKED : BST_UNCHECKED); }
static void init_sound_record_dialog(HWND hwnd) { HWND temp_hwnd; const char *sound_record_file; TCHAR *st_sound_record_file; int xpos; RECT rect; /* translate all dialog items */ uilib_localize_dialog(hwnd, sound_record_dialog_trans); /* adjust the size of the elements in the datasette_sub_group */ uilib_adjust_group_width(hwnd, sound_record_group); /* get the max x of the sound record format element */ uilib_get_element_max_x(hwnd, IDC_SOUND_RECORD_FORMAT_LABEL, &xpos); /* move the sound record format indicator element to the correct position */ uilib_move_element(hwnd, IDC_SOUND_RECORD_FORMAT, xpos + 10); /* get the max x of the sound record file element */ uilib_get_element_max_x(hwnd, IDC_SOUND_RECORD_FILE_LABEL, &xpos); /* move the browse button to the correct position */ uilib_move_element(hwnd, IDC_SOUND_RECORD_BROWSE, xpos + 10); /* get the max x of the right group */ uilib_get_group_max_x(hwnd, sound_record_right_group, &xpos); /* set the width of the dialog to 'surround' all the elements */ GetWindowRect(hwnd, &rect); MoveWindow(hwnd, rect.left, rect.top, xpos + 20, rect.bottom - rect.top, TRUE); /* recenter the buttons in the newly resized dialog window */ uilib_center_buttons(hwnd, move_buttons_group, 0); temp_hwnd = GetDlgItem(hwnd, IDC_SOUND_RECORD_FORMAT); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"AIFF"); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"IFF"); #ifdef USE_LAMEMP3 SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"MP3"); #endif SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"VOC"); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"WAV"); #ifdef USE_LAMEMP3 SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)4, 0); #else SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)3, 0); #endif resources_get_string("SoundRecordDeviceArg", &sound_record_file); st_sound_record_file = system_mbstowcs_alloc(sound_record_file); SetDlgItemText(hwnd, IDC_SOUND_RECORD_FILE, sound_record_file != NULL ? st_sound_record_file : TEXT("")); system_mbstowcs_free(st_sound_record_file); enable_sound_record_controls(hwnd); }
static void init_rs232user_dialog(HWND hwnd) { HWND temp_hwnd; RECT rect; int res_value; int res_value_loop; int active_value; int xsize, ysize; uilib_localize_dialog(hwnd, rs232user_dialog); uilib_get_group_extent(hwnd, rs232user_leftgroup, &xsize, &ysize); uilib_adjust_group_width(hwnd, rs232user_leftgroup); uilib_move_group(hwnd, rs232user_rightgroup, xsize + 30); GetWindowRect(hwnd, &rect); MoveWindow(hwnd, rect.left, rect.top, xsize + 160, rect.bottom - rect.top, TRUE); resources_get_int("RsUserEnable", &res_value); CheckDlgButton(hwnd, IDC_RS232USER_ENABLE, res_value ? BST_CHECKED : BST_UNCHECKED); temp_hwnd = GetDlgItem(hwnd, IDC_RS232USER_DEVICE); for (res_value_loop = 0; res_value_loop < MAXRS232; res_value_loop++) { TCHAR st[20]; _stprintf(st, translate_text(IDS_RS232_DEVICE_I), res_value_loop + 1); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)st); } SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)res_value, 0); resources_get_int("RsUserDev", &res_value); active_value = 0; for (res_value_loop = 0; res_value_loop < MAXRS232; res_value_loop++) { if (res_value_loop == res_value) active_value = res_value_loop; } SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)active_value, 0); temp_hwnd = GetDlgItem(hwnd, IDC_RS232USER_BAUDRATE); for (res_value_loop = 0; res_value_loop < NUM_OF_BAUDRATES; res_value_loop++) { TCHAR st[10]; _itot(baudrates[res_value_loop], st, 10); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)st); } resources_get_int("RsUserBaud", &res_value); active_value = 0; for (res_value_loop = 0; res_value_loop < MAXRS232; res_value_loop++) { if (baudrates[res_value_loop] == res_value) active_value = res_value_loop; } SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)active_value, 0); enable_rs232user_controls(hwnd); }
static void init_model_dialog(HWND hwnd) { int n, res; HWND parent_hwnd; HWND element; int xstart, xpos; parent_hwnd = GetParent(hwnd); /* translate all dialog items */ uilib_localize_dialog(hwnd, model_dialog_trans); /* translate all dialog items of the parent */ uilib_localize_dialog(parent_hwnd, parent_dialog_trans); /* translate all generic items */ for (n = 0; generic_items[n].text != NULL; n++) { element = GetDlgItem(hwnd, generic_items[n].idm); SetWindowText(element, generic_items[n].text); } /* adjust the size of the elements in the main group */ uilib_adjust_group_width(hwnd, model_main_group); /* get the min x of the right group */ uilib_get_group_min_x(hwnd, model_right_group, &xstart); /* get the max x of the right group */ uilib_get_group_max_x(hwnd, model_right_group, &xpos); /* resize and move the group box to the correct position */ uilib_move_and_set_element_width(hwnd, IDC_PET_MEMORY, xstart - 10, xpos - xstart + 20); resources_get_int("RamSize", &res); switch (res) { case 4: n = IDC_SELECT_PET_MEM4K; break; case 8: n = IDC_SELECT_PET_MEM8K; break; case 16: n = IDC_SELECT_PET_MEM16K; break; case 32: n = IDC_SELECT_PET_MEM32K; break; case 96: n = IDC_SELECT_PET_MEM96K; break; case 128: n = IDC_SELECT_PET_MEM128K; break; } CheckRadioButton(hwnd, IDC_SELECT_PET_MEM4K, IDC_SELECT_PET_MEM128K, n); }
static void init_petreu_dialog(HWND hwnd) { HWND temp_hwnd; int res_value; const char *petreufile; TCHAR *st_petreufile; int res_value_loop; int active_value; int xsize, ysize; uilib_localize_dialog(hwnd, petreu_dialog); uilib_adjust_group_width(hwnd, petreu_left_total_group); uilib_get_group_extent(hwnd, petreu_leftgroup, &xsize, &ysize); uilib_adjust_group_width(hwnd, petreu_leftgroup); uilib_move_group(hwnd, petreu_rightgroup, xsize + 30); resources_get_int("PETREU", &res_value); CheckDlgButton(hwnd, IDC_PETREU_ENABLE, res_value ? BST_CHECKED : BST_UNCHECKED); temp_hwnd = GetDlgItem(hwnd, IDC_PETREU_SIZE); for (res_value_loop = 0; res_value_loop < NUM_OF_PETREU_SIZE; res_value_loop++) { TCHAR st[10]; _itot(ui_petreu_size[res_value_loop], st, 10); _tcscat(st, translate_text(IDS_SPACE_KB)); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)st); } resources_get_int("PETREUsize", &res_value); active_value = 0; for (res_value_loop = 0; res_value_loop < NUM_OF_PETREU_SIZE; res_value_loop++) { if (ui_petreu_size[res_value_loop] == res_value) { active_value = res_value_loop; } } SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)active_value, 0); resources_get_string("PETREUfilename", &petreufile); st_petreufile = system_mbstowcs_alloc(petreufile); SetDlgItemText(hwnd, IDC_PETREU_FILE, petreufile != NULL ? st_petreufile : TEXT("")); system_mbstowcs_free(st_petreufile); enable_petreu_controls(hwnd); }
static void init_c64_256k_dialog(HWND hwnd) { HWND temp_hwnd; int res_value; const char *c64_256kfile; TCHAR *st_c64_256kfile; int res_value_loop; int active_value; int xsize, ysize; uilib_localize_dialog(hwnd, c64_256k_dialog); uilib_adjust_group_width(hwnd, c64_256k_left_total_group); uilib_get_group_extent(hwnd, c64_256k_leftgroup, &xsize, &ysize); uilib_adjust_group_width(hwnd, c64_256k_leftgroup); uilib_move_group(hwnd, c64_256k_rightgroup, xsize + 30); resources_get_int("C64_256K", &res_value); CheckDlgButton(hwnd, IDC_C64_256K_ENABLE, res_value ? BST_CHECKED : BST_UNCHECKED); temp_hwnd = GetDlgItem(hwnd, IDC_C64_256K_BASE); for (res_value_loop = 0; res_value_loop < NUM_OF_C64_256K_BASE; res_value_loop++) { TCHAR st[10]; _stprintf(st, "$%X", ui_c64_256k_base[res_value_loop]); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)st); } resources_get_int("C64_256Kbase", &res_value); active_value = 0; for (res_value_loop = 0; res_value_loop < NUM_OF_C64_256K_BASE; res_value_loop++) { if (ui_c64_256k_base[res_value_loop] == res_value) { active_value = res_value_loop; } } SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)active_value, 0); resources_get_string("C64_256Kfilename", &c64_256kfile); st_c64_256kfile = system_mbstowcs_alloc(c64_256kfile); SetDlgItemText(hwnd, IDC_C64_256K_FILE, c64_256kfile != NULL ? st_c64_256kfile : TEXT("")); system_mbstowcs_free(st_c64_256kfile); enable_c64_256k_controls(hwnd); }
static void init_rambanks_dialog(HWND hwnd) { int res_value; /* translate all dialog items */ uilib_localize_dialog(hwnd, rambanks_dialog_trans); /* adjust the size of the elements in the datasette_sub_group */ uilib_adjust_group_width(hwnd, rambanks_group); resources_get_int("C128FullBanks", &res_value); CheckDlgButton(hwnd, IDC_C128_FULL_BANKS, res_value ? BST_CHECKED : BST_UNCHECKED); }
static void init_mouse_dialog(HWND hwnd) { HWND temp_hwnd; int res_value; int xpos; RECT rect; /* translate all dialog items */ uilib_localize_dialog(hwnd, mouse_dialog_trans); /* adjust the size of the elements in the left group */ uilib_adjust_group_width(hwnd, mouse_left_group); /* get the max x of the left group */ uilib_get_group_max_x(hwnd, mouse_left_group, &xpos); /* move the right group to the correct position */ uilib_move_group(hwnd, mouse_right_group, xpos + 10); /* get the max x of the right group */ uilib_get_group_max_x(hwnd, mouse_right_group, &xpos); /* set the width of the dialog to 'surround' all the elements */ GetWindowRect(hwnd, &rect); MoveWindow(hwnd, rect.left, rect.top, xpos + 20, rect.bottom - rect.top, TRUE); /* recenter the buttons in the newly resized dialog window */ uilib_center_buttons(hwnd, move_buttons_group, 0); temp_hwnd = GetDlgItem(hwnd, IDC_MOUSE_TYPE); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"1351"); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"NEOS"); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"AMIGA"); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"Paddle"); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"Atari CX-22"); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"Atari ST"); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"Smart"); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"MicroMys"); resources_get_int("Mousetype", &res_value); SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)res_value, 0); temp_hwnd = GetDlgItem(hwnd, IDC_MOUSE_PORT); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"Joy1"); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"Joy2"); resources_get_int("Mouseport", &res_value); res_value--; SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)res_value, 0); enable_mouse_controls(hwnd); }
static void init_v364speech_dialog(HWND hwnd) { int res_value; const char *v364speechfile; TCHAR *st_v364speechfile; int xsize, ysize; uilib_localize_dialog(hwnd, v364speech_dialog); uilib_adjust_group_width(hwnd, v364speech_group1); uilib_get_group_extent(hwnd, v364speech_leftgroup, &xsize, &ysize); uilib_adjust_group_width(hwnd, v364speech_leftgroup); uilib_move_group(hwnd, v364speech_rightgroup, xsize + 30); resources_get_int("SpeechEnabled", &res_value); CheckDlgButton(hwnd, IDC_V364SPEECH_ENABLE, res_value ? BST_CHECKED : BST_UNCHECKED); resources_get_string("SpeechImage", &v364speechfile); st_v364speechfile = system_mbstowcs_alloc(v364speechfile); SetDlgItemText(hwnd, IDC_V364SPEECH_FILE, v364speechfile != NULL ? st_v364speechfile : TEXT("")); system_mbstowcs_free(st_v364speechfile); enable_v364speech_controls(hwnd); }
static void init_magicvoice_dialog(HWND hwnd) { int res_value; const char *magicvoicefile; TCHAR *st_magicvoicefile; int xsize, ysize; uilib_localize_dialog(hwnd, magicvoice_dialog); uilib_adjust_group_width(hwnd, magicvoice_group1); uilib_get_group_extent(hwnd, magicvoice_leftgroup, &xsize, &ysize); uilib_adjust_group_width(hwnd, magicvoice_leftgroup); uilib_move_group(hwnd, magicvoice_rightgroup, xsize + 30); resources_get_int("MagicVoiceCartridgeEnabled", &res_value); CheckDlgButton(hwnd, IDC_MAGICVOICE_ENABLE, res_value ? BST_CHECKED : BST_UNCHECKED); resources_get_string("MagicVoiceImage", &magicvoicefile); st_magicvoicefile = system_mbstowcs_alloc(magicvoicefile); SetDlgItemText(hwnd, IDC_MAGICVOICE_FILE, magicvoicefile != NULL ? st_magicvoicefile : TEXT("")); system_mbstowcs_free(st_magicvoicefile); enable_magicvoice_controls(hwnd); }
static void init_rs232_dialog(HWND hwnd) { const char *device; TCHAR *st_device; int xpos; RECT rect; /* translate all dialog items */ uilib_localize_dialog(hwnd, rs232_dialog_trans); /* adjust the size of the elements in the left group */ uilib_adjust_group_width(hwnd, left_group); /* get the max x of the left group */ uilib_get_group_max_x(hwnd, left_group, &xpos); /* move the right group to the correct position */ uilib_move_group(hwnd, right_group, xpos + 10); /* get the max x of the right group */ uilib_get_group_max_x(hwnd, right_group, &xpos); /* set the width of the dialog to 'surround' all the elements */ GetWindowRect(hwnd, &rect); MoveWindow(hwnd, rect.left, rect.top, xpos + 20, rect.bottom - rect.top, TRUE); /* recenter the buttons in the newly resized dialog window */ uilib_center_buttons(hwnd, move_buttons_group, 0); resources_get_string("RsDevice1", &device); st_device = system_mbstowcs_alloc(device); SetDlgItemText(hwnd, IDC_RS232_DEVICE1, device != NULL ? st_device : TEXT("")); system_mbstowcs_free(st_device); resources_get_string("RsDevice2", &device); st_device = system_mbstowcs_alloc(device); SetDlgItemText(hwnd, IDC_RS232_DEVICE2, device != NULL ? st_device : TEXT("")); system_mbstowcs_free(st_device); resources_get_string("RsDevice3", &device); st_device = system_mbstowcs_alloc(device); SetDlgItemText(hwnd, IDC_RS232_DEVICE3, device != NULL ? st_device : TEXT("")); system_mbstowcs_free(st_device); resources_get_string("RsDevice4", &device); st_device = system_mbstowcs_alloc(device); SetDlgItemText(hwnd, IDC_RS232_DEVICE4, device != NULL ? st_device : TEXT("")); system_mbstowcs_free(st_device); }
static void init_userport_rtc_dialog(HWND hwnd) { int res_value; uilib_localize_dialog(hwnd, userport_rtc_dialog); uilib_adjust_group_width(hwnd, userport_rtc_left_total_group); resources_get_int("UserportRTC", &res_value); CheckDlgButton(hwnd, IDC_USERPORT_RTC_ENABLE, res_value ? BST_CHECKED : BST_UNCHECKED); resources_get_int("UserportRTCSave", &res_value); CheckDlgButton(hwnd, IDC_USERPORT_RTC_SAVE, res_value ? BST_CHECKED : BST_UNCHECKED); enable_userport_rtc_controls(hwnd); }
static void init_plus4model_dialog(HWND hwnd) { HWND temp_hwnd; int res_value; int xpos; RECT rect; EnableWindow(GetDlgItem(hwnd, IDC_PLUS4MODEL_LIST), 1); /* translate all dialog items */ uilib_localize_dialog(hwnd, plus4model_dialog_trans); /* adjust the size of the elements in the left group */ uilib_adjust_group_width(hwnd, plus4model_left_group); /* get the max x of the left group */ uilib_get_group_max_x(hwnd, plus4model_left_group, &xpos); /* move the right group to the correct position */ uilib_move_group(hwnd, plus4model_right_group, xpos + 10); /* get the max x of the right group */ uilib_get_group_max_x(hwnd, plus4model_right_group, &xpos); /* set the width of the dialog to 'surround' all the elements */ GetWindowRect(hwnd, &rect); MoveWindow(hwnd, rect.left, rect.top, xpos + 20, rect.bottom - rect.top, TRUE); /* recenter the buttons in the newly resized dialog window */ uilib_center_buttons(hwnd, move_buttons_group, 0); temp_hwnd = GetDlgItem(hwnd, IDC_PLUS4MODEL_LIST); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"C16 PAL"); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"C16 NTSC"); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"Plus4 PAL"); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"Plus4 NTSC"); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"V364 NTSC"); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"C232 NTSC"); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)translate_text(IDS_UNKNOWN)); res_value = plus4model_get(); if (res_value > 6) { res_value = 6; } SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)res_value, 0); }
static void init_cia_dialog(HWND hwnd) { HWND temp_hwnd; int res_value; int xpos; RECT rect; uilib_dialog_group *left_group = (amount == 2) ? cia2_left_group : cia1_left_group; uilib_dialog_group *right_group = (amount == 2) ? cia2_right_group : cia1_right_group; uilib_localize_dialog_param *dialog_trans = (amount == 2) ? cia2_dialog_trans : cia1_dialog_trans ; /* translate all dialog items */ uilib_localize_dialog(hwnd, dialog_trans); /* adjust the size of the elements in the main group */ uilib_adjust_group_width(hwnd, left_group); /* get the max x of the left group */ uilib_get_group_max_x(hwnd, left_group, &xpos); /* move the right group to the correct position */ uilib_move_group(hwnd, right_group, xpos + 10); /* get the max x of the right group */ uilib_get_group_max_x(hwnd, right_group, &xpos); /* set the width of the dialog to 'surround' all the elements */ GetWindowRect(hwnd, &rect); MoveWindow(hwnd, rect.left, rect.top, xpos + 20, rect.bottom - rect.top, TRUE); /* recenter the buttons in the newly resized dialog window */ uilib_center_buttons(hwnd, move_buttons_group, 0); resources_get_int("CIA1Model", &res_value); temp_hwnd = GetDlgItem(hwnd, IDC_C64CIA1_LIST); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)translate_text(IDS_6526_OLD)); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)translate_text(IDS_6526A_NEW)); SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)res_value, 0); if (amount == 2) { resources_get_int("CIA2Model", &res_value); temp_hwnd = GetDlgItem(hwnd, IDC_C64CIA2_LIST); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)translate_text(IDS_6526_OLD)); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)translate_text(IDS_6526A_NEW)); SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)res_value, 0); } }
static void init_rr_dialog(HWND hwnd) { HWND temp_hwnd; int res_value; int xpos; RECT rect; /* translate all dialog items */ uilib_localize_dialog(hwnd, rr_dialog_trans); /* adjust the size of the elements in the main group */ uilib_adjust_group_width(hwnd, rr_main_group); /* get the max x of the left group */ uilib_get_group_max_x(hwnd, rr_left_group, &xpos); /* move the right group to the correct location */ uilib_move_group(hwnd, rr_right_group, xpos + 10); /* get the max x of the window group */ uilib_get_group_max_x(hwnd, rr_window_group, &xpos); /* set the width of the dialog to 'surround' all the elements */ GetWindowRect(hwnd, &rect); MoveWindow(hwnd, rect.left, rect.top, xpos + 20, rect.bottom - rect.top, TRUE); /* recenter the buttons in the newly resized dialog window */ uilib_center_buttons(hwnd, move_buttons_group, 0); resources_get_int("RRFlashJumper", &res_value); CheckDlgButton(hwnd, IDC_RR_FLASH_JUMPER, res_value ? BST_CHECKED : BST_UNCHECKED); resources_get_int("RRBankJumper", &res_value); CheckDlgButton(hwnd, IDC_RR_BANK_JUMPER, res_value ? BST_CHECKED : BST_UNCHECKED); resources_get_int("RRBiosWrite", &res_value); CheckDlgButton(hwnd, IDC_RR_SAVE_WHEN_CHANGED, res_value ? BST_CHECKED : BST_UNCHECKED); temp_hwnd = GetDlgItem(hwnd, IDC_RR_REVISION); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)CARTRIDGE_NAME_RETRO_REPLAY); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)CARTRIDGE_NAME_NORDIC_REPLAY); resources_get_int("RRrevision", &res_value); SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)res_value, 0); }
static void init_vsid_dialog(HWND hwnd) { HWND temp_hwnd; int xpos; int i; TCHAR st[10]; RECT rect; /* translate all dialog items */ uilib_localize_dialog(hwnd, vsid_dialog_trans); /* adjust the size of the elements in the left group */ uilib_adjust_group_width(hwnd, vsid_left_group); /* get the max x of the left group */ uilib_get_group_max_x(hwnd, vsid_left_group, &xpos); /* move the right group to the correct position */ uilib_move_group(hwnd, vsid_right_group, xpos + 10); /* get the max x of the right group */ uilib_get_group_max_x(hwnd, vsid_right_group, &xpos); /* set the width of the dialog to 'surround' all the elements */ GetWindowRect(hwnd, &rect); MoveWindow(hwnd, rect.left, rect.top, xpos + 20, rect.bottom - rect.top, TRUE); /* recenter the buttons in the newly resized dialog window */ uilib_center_buttons(hwnd, move_buttons_group, 0); temp_hwnd = GetDlgItem(hwnd, IDC_VSID_TUNE); for (i = 0; i < songs; i++) { _stprintf(st, TEXT("%d"), i + 1); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)st); } SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)current_song - 1, 0); }
static void init_soundexpander_dialog(HWND hwnd) { HWND temp_hwnd; int res_value; int xsize, ysize; uilib_localize_dialog(hwnd, soundexpander_dialog); if (machine_class == VICE_MACHINE_VIC20) { uilib_localize_dialog(hwnd, soundexpander_mascuerade_dialog); } uilib_get_group_extent(hwnd, soundexpander_leftgroup, &xsize, &ysize); uilib_adjust_group_width(hwnd, soundexpander_left_total_group); uilib_move_group(hwnd, soundexpander_rightgroup, xsize + 30); resources_get_int("SFXSoundExpander", &res_value); CheckDlgButton(hwnd, IDC_SFX_SOUNDEXPANDER_ENABLE, res_value ? BST_CHECKED : BST_UNCHECKED); if (machine_class == VICE_MACHINE_VIC20) { resources_get_int("SFXSoundExpanderIOSwap", &res_value); CheckDlgButton(hwnd, IDC_SFX_SOUNDEXPANDER_IO_SWAP, res_value ? BST_CHECKED : BST_UNCHECKED); } temp_hwnd = GetDlgItem(hwnd, IDC_SFX_SOUNDEXPANDER_TYPE); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"3526"); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"3812"); resources_get_int("SFXSoundExpanderChip", &res_value); if (res_value == 3526) { SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)0, 0); } else { SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)1, 0); } enable_soundexpander_controls(hwnd); }
static void init_rom_dialog(HWND hwnd, unsigned int type) { unsigned int n = 0; int xpos; int i; HWND element; if (type == UIROM_TYPE_MAIN) { /* translate all dialog items */ uilib_localize_dialog(hwnd, main_trans); /* adjust the size of the elements in the main left group */ uilib_adjust_group_width(hwnd, main_left_group); /* get the max x of the main left group */ uilib_get_group_max_x(hwnd, main_left_group, &xpos); /* move the main middle group to the correct position */ uilib_move_group(hwnd, main_middle_group, xpos + 10); /* get the max x of the main middle group */ uilib_get_group_max_x(hwnd, main_middle_group, &xpos); /* move the main right group to the correct position */ uilib_move_group(hwnd, main_right_group, xpos + 10); } else if (type == UIROM_TYPE_DRIVE) { /* translate all dialog items */ uilib_localize_dialog(hwnd, drive_trans); /* translate generic items */ for (i = 0; generic_trans[i].text != NULL; i++) { element = GetDlgItem(hwnd, generic_trans[i].idm); SetWindowText(element, generic_trans[i].text); } /* adjust the size of the elements in the drive left group */ uilib_adjust_group_width(hwnd, drive_left_group); /* get the max x of the drive left group */ uilib_get_group_max_x(hwnd, drive_left_group, &xpos); /* move the drive middle group to the correct position */ uilib_move_group(hwnd, drive_middle_group, xpos + 10); /* get the max x of the drive middle group */ uilib_get_group_max_x(hwnd, drive_middle_group, &xpos); /* move the drive right group to the correct position */ uilib_move_group(hwnd, drive_right_group, xpos + 10); } while (settings[n].realname != NULL) { if (settings[n].type == type) { const char *filename; TCHAR *st_filename; resources_get_string(settings[n].resname, &filename); st_filename = system_mbstowcs_alloc(filename); SetDlgItemText(hwnd, settings[n].idc_filename, st_filename != NULL ? st_filename : TEXT("")); system_mbstowcs_free(st_filename); } n++; } }
static void init_dialog(HWND hwnd, int num) { int drive_type, drive_extend_image_policy, drive_idle_method, n; int drive_true_emulation, iecdevice, enabled; int xpos; int xstart; HWND parent_hwnd; HWND element; parent_hwnd = GetParent(hwnd); /* translate all dialog items */ uilib_localize_dialog(hwnd, drive_dialog_trans); /* translate the parent window items */ uilib_localize_dialog(parent_hwnd, parent_dialog_trans); /* translate the generic items */ for (n = 0; generic_items[n].text != NULL; n++) { element = GetDlgItem(hwnd, generic_items[n].idm); SetWindowText(element, generic_items[n].text); } /* adjust the size of the elements in the main group */ uilib_adjust_group_width(hwnd, drive_main_group); /* get the max x of the elements in the left group */ uilib_get_group_max_x(hwnd, drive_left_group, &xpos); /* get the min x of the none element of the left group */ uilib_get_element_min_x(hwnd, IDC_SELECT_DRIVE_TYPE_NONE, &xstart); /* resize and move the left group element to the correct position */ uilib_move_and_set_element_width(hwnd, IDC_DRIVE_TYPE, xstart - 10, xpos - xstart + 20); /* get the max x of the left group element */ uilib_get_element_max_x(hwnd, IDC_DRIVE_TYPE, &xpos); /* move the middle group elements to the correct position */ uilib_move_group(hwnd, drive_middle_move_group, xpos + 20); uilib_move_element(hwnd, IDC_40_TRACK_HANDLING, xpos + 10); uilib_move_element(hwnd, IDC_DRIVE_EXPANSION, xpos + 10); xstart = xpos + 20; /* get the max x of the middle group */ uilib_get_group_max_x(hwnd, drive_middle_group, &xpos); /* resize and move the middle group boxes to the correct position */ uilib_move_and_set_element_width(hwnd, IDC_40_TRACK_HANDLING, xstart - 10, xpos - xstart + 20); uilib_move_and_set_element_width(hwnd, IDC_DRIVE_EXPANSION, xstart - 10, xpos - xstart + 20); /* get the max x of the middle group element */ uilib_get_element_max_x(hwnd, IDC_DRIVE_EXPANSION, &xpos); /* move the right group elements to the correct position */ uilib_move_group(hwnd, drive_right_move_group, xpos + 20); uilib_move_element(hwnd, IDC_IDLE_METHOD, xpos + 10); xstart = xpos + 20; /* get the max x of the right group */ uilib_get_group_max_x(hwnd, drive_right_group, &xpos); /* resize and move the right group element to the correct position */ uilib_move_and_set_element_width(hwnd, IDC_IDLE_METHOD, xstart - 10, xpos - xstart + 20); /* recenter the buttons in the newly resized dialog window */ uilib_center_buttons(parent_hwnd, move_buttons_group, 0); resources_get_int_sprintf("IECDevice%i", &iecdevice, num); resources_get_int("DriveTrueEmulation", &drive_true_emulation); enabled = drive_true_emulation && !iecdevice; EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_TYPE_1540), enabled && drive_check_type(DRIVE_TYPE_1540, num - 8)); EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_TYPE_1541), enabled && drive_check_type(DRIVE_TYPE_1541, num - 8)); EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_TYPE_1541II), enabled && drive_check_type(DRIVE_TYPE_1541II, num - 8)); EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_TYPE_1570), enabled && drive_check_type(DRIVE_TYPE_1570, num - 8)); EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_TYPE_1571), enabled && drive_check_type(DRIVE_TYPE_1571, num - 8)); EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_TYPE_1581), enabled && drive_check_type(DRIVE_TYPE_1581, num - 8)); EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_TYPE_2000), enabled && drive_check_type(DRIVE_TYPE_2000, num - 8)); EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_TYPE_4000), enabled && drive_check_type(DRIVE_TYPE_4000, num - 8)); EnableWindow(GetDlgItem(hwnd, IDC_SELECT_DRIVE_TYPE_NONE), enabled); resources_get_int_sprintf("Drive%dType", &drive_type, num); resources_get_int_sprintf("Drive%dExtendImagePolicy", &drive_extend_image_policy, num); resources_get_int_sprintf("Drive%dIdleMethod", &drive_idle_method, num); dialog_drive_type[num - 8] = drive_type; switch (drive_type) { case DRIVE_TYPE_NONE: n = IDC_SELECT_DRIVE_TYPE_NONE; break; case DRIVE_TYPE_1540: n = IDC_SELECT_DRIVE_TYPE_1540; break; case DRIVE_TYPE_1541: n = IDC_SELECT_DRIVE_TYPE_1541; break; case DRIVE_TYPE_1541II: n = IDC_SELECT_DRIVE_TYPE_1541II; break; case DRIVE_TYPE_1570: n = IDC_SELECT_DRIVE_TYPE_1570; break; case DRIVE_TYPE_1571: n = IDC_SELECT_DRIVE_TYPE_1571; break; case DRIVE_TYPE_1581: n = IDC_SELECT_DRIVE_TYPE_1581; break; case DRIVE_TYPE_2000: n = IDC_SELECT_DRIVE_TYPE_2000; break; case DRIVE_TYPE_4000: n = IDC_SELECT_DRIVE_TYPE_4000; break; } if (!enabled) { n = IDC_SELECT_DRIVE_TYPE_NONE; } CheckRadioButton(hwnd, IDC_SELECT_DRIVE_TYPE_1541, IDC_SELECT_DRIVE_TYPE_NONE, n); enable_controls_for_drive_settings(hwnd, n); dialog_drive_extend[num - 8] = drive_extend_image_policy; switch (drive_extend_image_policy) { case DRIVE_EXTEND_NEVER: n = IDC_SELECT_DRIVE_EXTEND_NEVER; break; case DRIVE_EXTEND_ASK: n = IDC_SELECT_DRIVE_EXTEND_ASK; break; case DRIVE_EXTEND_ACCESS: n = IDC_SELECT_DRIVE_EXTEND_ACCESS; break; } CheckRadioButton(hwnd, IDC_SELECT_DRIVE_EXTEND_NEVER, IDC_SELECT_DRIVE_EXTEND_ACCESS, n); dialog_drive_idle[num - 8] = drive_idle_method; switch (drive_idle_method) { case DRIVE_IDLE_NO_IDLE: n = IDC_SELECT_DRIVE_IDLE_NO_IDLE; break; case DRIVE_IDLE_TRAP_IDLE: n = IDC_SELECT_DRIVE_IDLE_TRAP_IDLE; break; case DRIVE_IDLE_SKIP_CYCLES: n = IDC_SELECT_DRIVE_IDLE_SKIP_CYCLES; break; } CheckRadioButton(hwnd, IDC_SELECT_DRIVE_IDLE_NO_IDLE, IDC_SELECT_DRIVE_IDLE_SKIP_CYCLES, n); resources_get_int_sprintf("Drive%dRAM2000", &n, num); CheckDlgButton(hwnd, IDC_TOGGLE_DRIVE_EXPANSION_2000, n ? BST_CHECKED : BST_UNCHECKED); resources_get_int_sprintf("Drive%dRAM4000", &n, num); CheckDlgButton(hwnd, IDC_TOGGLE_DRIVE_EXPANSION_4000, n ? BST_CHECKED : BST_UNCHECKED); resources_get_int_sprintf("Drive%dRAM6000", &n, num); CheckDlgButton(hwnd, IDC_TOGGLE_DRIVE_EXPANSION_6000, n ? BST_CHECKED : BST_UNCHECKED); resources_get_int_sprintf("Drive%dRAM8000", &n, num); CheckDlgButton(hwnd, IDC_TOGGLE_DRIVE_EXPANSION_8000, n ? BST_CHECKED : BST_UNCHECKED); resources_get_int_sprintf("Drive%dRAMA000", &n, num); CheckDlgButton(hwnd, IDC_TOGGLE_DRIVE_EXPANSION_A000, n ? BST_CHECKED : BST_UNCHECKED); resources_get_int_sprintf("Drive%dRTCSave", &n, num); CheckDlgButton(hwnd, IDC_TOGGLE_DRIVE_RTC_SAVE, n ? BST_CHECKED : BST_UNCHECKED); }
static void init_midi_dialog(HWND hwnd) { HWND temp_hwnd; MMRESULT ret; MIDIINCAPS mic; MIDIOUTCAPS moc; int num, i; int res_value; int number; int xpos; RECT rect; /* translate all dialog items */ uilib_localize_dialog(hwnd, midi_dialog_trans); /* adjust the size of the elements in the left group */ uilib_adjust_group_width(hwnd, midi_left_group); /* get the max x of the left group */ uilib_get_group_max_x(hwnd, midi_left_group, &xpos); /* move the right group to the correct position */ uilib_move_group(hwnd, midi_right_group, xpos + 10); /* get the max x of the window group */ uilib_get_group_max_x(hwnd, midi_window_group, &xpos); /* set the width of the dialog to 'surround' all the elements */ GetWindowRect(hwnd, &rect); MoveWindow(hwnd, rect.left, rect.top, xpos + 10, rect.bottom - rect.top, TRUE); /* recenter the buttons in the newly resized dialog window */ uilib_center_buttons(hwnd, move_buttons_group, 0); resources_get_int("MIDIEnable", &res_value); CheckDlgButton(hwnd, IDC_MIDI_ENABLE, res_value ? BST_CHECKED : BST_UNCHECKED); temp_hwnd = GetDlgItem(hwnd, IDC_MIDI_TYPE); for (i = 0; midi_interface[i].name != NULL; i++) { SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)midi_interface[i].name); } resources_get_int("MIDIMode", &res_value); SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)res_value, 0); temp_hwnd = GetDlgItem(hwnd, IDC_MIDI_IN_DEVICE); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)translate_text(IDS_NONE)); num = midiInGetNumDevs(); if (num != 0) { for (i = 0; i < num; i++) { ret = midiInGetDevCaps(i, &mic, sizeof(MIDIINCAPS)); if (ret == MMSYSERR_NOERROR) { SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)mic.szPname); } else { SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"Error getting name"); } } resources_get_int("MIDIInDev", &number); SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)(number + 1), 0); } else { SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)0, 0); } temp_hwnd = GetDlgItem(hwnd, IDC_MIDI_OUT_DEVICE); SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)translate_text(IDS_NONE)); num = midiOutGetNumDevs(); if (num != 0) { for (i = 0; i < num; i++) { ret = midiOutGetDevCaps(i, &moc, sizeof(MIDIOUTCAPS)); if (ret == MMSYSERR_NOERROR) { SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)moc.szPname); } else { SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"Error getting name"); } } resources_get_int("MIDIOutDev", &number); SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)(number + 1), 0); } else { SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)0, 0); } enable_midi_controls(hwnd); }
static void init_dialog(HWND hwnd, unsigned int num) { const char *disk_image, *dir; TCHAR *st_disk_image, *st_dir; int devtype, n; int xpos, xpos1, xpos2, xpos3; int distance1, distance2; RECT rect; uilib_localize_dialog_param *diskdevice_dialog = #ifdef HAVE_OPENCBM (opencbmlib_is_available()) ? diskdevice_opencbm_dialog : #endif diskdevice_normal_dialog; if (num >= 8 && num <= 11) { /* translate all dialog items */ uilib_localize_dialog(hwnd, diskdevice_dialog); /* adjust the size of the elements in the diskdevice_left_group */ uilib_adjust_group_width(hwnd, diskdevice_left_group); /* adjust the size of the 'read-only' element */ uilib_adjust_group_width(hwnd, diskdevice_read_only); /* get the min x of the read only element */ uilib_get_element_min_x(hwnd, IDC_TOGGLE_ATTACH_READONLY, &xpos3); /* get the min x of the autostart element */ uilib_get_element_min_x(hwnd, IDC_AUTOSTART, &xpos2); /* get the max x of the first browse element */ uilib_get_element_max_x(hwnd, IDC_BROWSEDISK, &xpos1); /* calculate the distance between the browse button and the autostart button */ distance1 = xpos2 - xpos1; /* get the max x of the autostart element */ uilib_get_element_max_x(hwnd, IDC_AUTOSTART, &xpos2); /* calculate the distance between the browse button and the read only element */ distance2 = xpos3 - xpos2; /* get the max x of the disk_device_left_group items */ uilib_get_group_max_x(hwnd, diskdevice_left_group, &xpos); /* move the filename elements and browse buttons to the right position */ uilib_move_group(hwnd, diskdevice_middle_group, xpos + 10); /* get the max x of the first browse element */ uilib_get_element_max_x(hwnd, IDC_BROWSEDISK, &xpos); /* move the autostart element to the right position */ uilib_move_element(hwnd, IDC_AUTOSTART, xpos + distance1); /* resize the autostart element */ uilib_adjust_element_width(hwnd, IDC_AUTOSTART); /* get the max x of the autostart element */ uilib_get_element_max_x(hwnd, IDC_AUTOSTART, &xpos); /* move the read only element to the right position */ uilib_move_element(hwnd, IDC_TOGGLE_ATTACH_READONLY, xpos + distance2); #ifdef HAVE_OPENCBM if (opencbmlib_is_available()) { /* adjust the size of the real iec element */ uilib_adjust_element_width(hwnd, IDC_SELECTREAL); /* get the max x of the real iec element */ uilib_get_element_max_x(hwnd, IDC_SELECTREAL, &xpos1); } else { xpos1 = 0; } #else xpos1 = 0; #endif /* get the max x of the second browse button */ uilib_get_element_max_x(hwnd, IDC_BROWSEDIR, &xpos2); if (xpos2 > xpos1) { xpos = xpos2 + 20; } else { xpos = xpos1 + 20; } /* move the diskdevice_right_group to the right position */ uilib_move_group(hwnd, diskdevice_right_group, xpos); /* move the p00 group element to the right position */ uilib_move_element(hwnd, IDC_DISKDEVICE_OPTIONS, xpos - 5); /* adjust the diskdevice_right_group elements size */ uilib_adjust_group_width(hwnd, diskdevice_right_group); /* adjust the p00 group element size */ uilib_adjust_element_width(hwnd, IDC_DISKDEVICE_OPTIONS); /* get the width of the disk_device_right_group items */ uilib_get_group_width(hwnd, diskdevice_right_group, &xpos1); /* get the width of the p00 group element */ uilib_get_element_width(hwnd, IDC_DISKDEVICE_OPTIONS, &xpos2); if (xpos2 + 5 > xpos1) { xpos = xpos2 + 15; } else { xpos = xpos1 + 10; } /* set the width of the p00 group element */ uilib_set_element_width(hwnd, IDC_DISKDEVICE_OPTIONS, xpos); /* adjust the none element size */ uilib_adjust_element_width(hwnd, IDC_SELECTNONE); /* adjust the size of the use iec device element */ uilib_adjust_element_width(hwnd, IDC_TOGGLE_USEIECDEVICE); /* get the max x of the window filling elements */ uilib_get_group_max_x(hwnd, diskdevice_filling_group, &xpos); /* set the width of the dialog to 'surround' all the elements */ GetWindowRect(hwnd, &rect); MoveWindow(hwnd, rect.left, rect.top, xpos + 10, rect.bottom - rect.top, TRUE); disk_image = file_system_get_disk_name(num); st_disk_image = system_mbstowcs_alloc(disk_image); SetDlgItemText(hwnd, IDC_DISKIMAGE, st_disk_image != NULL ? st_disk_image : TEXT("")); system_mbstowcs_free(st_disk_image); resources_get_string_sprintf("FSDevice%dDir", &dir, num); st_dir = system_mbstowcs_alloc(dir); SetDlgItemText(hwnd, IDC_DIR, st_dir != NULL ? st_dir : TEXT("")); system_mbstowcs_free(st_dir); resources_get_int_sprintf("FSDevice%dConvertP00", &n, num); CheckDlgButton(hwnd, IDC_TOGGLE_READP00, n ? BST_CHECKED : BST_UNCHECKED); resources_get_int_sprintf("FSDevice%dSaveP00", &n, num); CheckDlgButton(hwnd, IDC_TOGGLE_WRITEP00, n ? BST_CHECKED : BST_UNCHECKED); resources_get_int_sprintf("FSDevice%dHideCBMFiles", &n, num); CheckDlgButton(hwnd, IDC_TOGGLE_HIDENONP00, n ? BST_CHECKED : BST_UNCHECKED); resources_get_int_sprintf("AttachDevice%dReadonly", &n, num); CheckDlgButton(hwnd, IDC_TOGGLE_ATTACH_READONLY, n ? BST_CHECKED : BST_UNCHECKED); resources_get_int_sprintf("FileSystemDevice%d", &devtype, num); switch (devtype) { case ATTACH_DEVICE_FS: if (disk_image != NULL) { n = IDC_SELECTDISK; } else { n = IDC_SELECTDIR; } break; #ifdef HAVE_OPENCBM case ATTACH_DEVICE_REAL: n = IDC_SELECTREAL; break; #endif default: n = IDC_SELECTNONE; } #ifdef HAVE_OPENCBM if (opencbmlib_is_available()) { CheckRadioButton(hwnd, IDC_SELECTDISK, IDC_SELECTREAL, n); } else { CheckRadioButton(hwnd, IDC_SELECTDISK, IDC_SELECTDIR, n); } #else CheckRadioButton(hwnd, IDC_SELECTDISK, IDC_SELECTDIR, n); #endif enable_controls_for_disk_device_type(hwnd, n); if (iec_available_busses() & IEC_BUS_IEC) { resources_get_int_sprintf("IECDevice%d", &n, num); CheckDlgButton(hwnd, IDC_TOGGLE_USEIECDEVICE, n ? BST_CHECKED : BST_UNCHECKED); } else { CheckDlgButton(hwnd, IDC_TOGGLE_USEIECDEVICE, BST_UNCHECKED); ShowWindow(GetDlgItem(hwnd, IDC_TOGGLE_USEIECDEVICE), FALSE); } enable_controls(hwnd); } }
static void init_printer_dialog(unsigned int num, HWND hwnd) { HWND printer_hwnd; int i, res_value, res_value_loop; char printer_name[30]; const char *res_string; int current = 0; int xmax; int xpos; int size; const int *ui_printer = #ifdef HAVE_OPENCBM (opencbmlib_is_available()) ? ui_printer_opencbm : #endif ui_printer_normal; /* translate all dialog items */ uilib_localize_dialog(hwnd, printer_dialog_trans); if (num != 0) { /* translate the iec dialog item(s) */ uilib_localize_dialog(hwnd, printer_iec_dialog_trans); } /* adjust the size of the elements in the left group */ uilib_adjust_group_width(hwnd, printer_left_group); /* get the max x of the bottom right group */ uilib_get_group_max_x(hwnd, printer_bottom_right_group, &xmax); /* get the size of one of the elements of the bottom right group */ uilib_get_element_size(hwnd, IDC_PRINTER_OUTPUT_FILE3_NAME, &size); /* get the max x of the left group */ uilib_get_group_max_x(hwnd, printer_left_group, &xpos); /* move the top right group to the correct position */ uilib_move_group(hwnd, printer_top_right_group, xpos + 10); /* move the bottom right group to the correct position */ uilib_move_group(hwnd, printer_bottom_right_group, xpos + 10); /* get the max x of the bottom right group */ uilib_get_group_max_x(hwnd, printer_bottom_right_group, &xpos); /* set the size of the bottom right group */ uilib_set_group_width(hwnd, printer_bottom_right_group, size + xpos - xmax); /* get the max x of the printer emulation drop down element */ uilib_get_element_max_x(hwnd, IDC_PRINTER_TYPE, &xpos); /* adjust the size of the elements in formfeed group */ uilib_adjust_group_width(hwnd, formfeed_group); /* move the send formfeed button */ uilib_move_element(hwnd, IDC_PRINTER_FORMFEED, xpos + 10); if (num == 0) { sprintf(printer_name, "PrinterUserport"); } else { sprintf(printer_name, "Printer%d", num); } resources_get_int(printer_name, &res_value); printer_hwnd = GetDlgItem(hwnd, IDC_PRINTER_TYPE); for (res_value_loop = 0; ui_printer[res_value_loop]; res_value_loop++) { SendMessage(printer_hwnd, CB_ADDSTRING, 0, (LPARAM)translate_text(ui_printer[res_value_loop])); } SendMessage(printer_hwnd, CB_SETCURSEL, (WPARAM)res_value, 0); resources_get_string_sprintf("%sDriver", &res_string, printer_name); printer_hwnd = GetDlgItem(hwnd, IDC_PRINTER_DRIVER); if (num == 6) { for (res_value_loop = 0; ui_plotter_driver[res_value_loop]; res_value_loop++) { SendMessage(printer_hwnd, CB_ADDSTRING, 0, (LPARAM)ui_plotter_driver[res_value_loop]); if (!strcmp(ui_plotter_driver_1520[res_value_loop], res_string)) { current = res_value_loop; } } } else { if (num == 0) { for (res_value_loop = 0; ui_userprinter_driver[res_value_loop]; res_value_loop++) { SendMessage(printer_hwnd, CB_ADDSTRING, 0, (LPARAM)ui_userprinter_driver[res_value_loop]); if (!strcmp(ui_userprinter_driver_ascii[res_value_loop], res_string)) { current = res_value_loop; } } } else { for (res_value_loop = 0; ui_printer_driver[res_value_loop]; res_value_loop++) { SendMessage(printer_hwnd, CB_ADDSTRING, 0, (LPARAM)ui_printer_driver[res_value_loop]); if (!strcmp(ui_printer_driver_ascii[res_value_loop], res_string)) { current = res_value_loop; } } } } SendMessage(printer_hwnd, CB_SETCURSEL, (WPARAM)current, 0); resources_get_string_sprintf("%sOutput", &res_string, printer_name); printer_hwnd = GetDlgItem(hwnd, IDC_PRINTER_OUTPUT); for (res_value_loop = 0; ui_printer_output[res_value_loop]; res_value_loop++) { SendMessage(printer_hwnd, CB_ADDSTRING, 0, (LPARAM)ui_printer_output[res_value_loop]); if (!strcmp(ui_printer_output_ascii[res_value_loop], res_string)) { current = res_value_loop; } } SendMessage(printer_hwnd, CB_SETCURSEL, (WPARAM)current, 0); resources_get_int_sprintf("%sTextDevice", &res_value, printer_name); printer_hwnd = GetDlgItem(hwnd, IDC_PRINTER_TEXTOUT); for (res_value_loop = 0; ui_printer_text_device[res_value_loop]; res_value_loop++) { SendMessage(printer_hwnd, CB_ADDSTRING, 0, (LPARAM)ui_printer_text_device[res_value_loop]); } SendMessage(printer_hwnd, CB_SETCURSEL, (WPARAM)res_value, 0); if (num > 0 && (iec_available_busses() & IEC_BUS_IEC)) { resources_get_int_sprintf("IECDevice%d", &res_value, num); CheckDlgButton(hwnd, IDC_PRINTER_USEIECDEVICE, res_value ? BST_CHECKED : BST_UNCHECKED); } else { ShowWindow(GetDlgItem(hwnd, IDC_PRINTER_USEIECDEVICE), FALSE); CheckDlgButton(hwnd, IDC_PRINTER_USEIECDEVICE, BST_UNCHECKED); } for (i = 0; i < 3; i++) { resources_get_string_sprintf("PrinterTextDevice%d", &res_string, i + 1); if (res_string) { strncpy(printertextdevice[i], res_string, MAX_PATH); } } enable_printer_controls(num, hwnd); }