Пример #1
0
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);
}
Пример #2
0
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);
}
Пример #3
0
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);
}
Пример #4
0
static void init_machine_dialog(HWND hwnd)
{
    HWND machine_hwnd;
    int res_value;
    int res_value_loop;
    int xpos;

    /* translate all dialog items */
    uilib_localize_dialog(hwnd, machine_dialog_trans);

    /* adjust the size of the  machine type element */
    uilib_adjust_element_width(hwnd, IDC_MACHINE_TYPE);

    /* get the max x of the machine type element */
    uilib_get_element_max_x(hwnd, IDC_MACHINE_TYPE, &xpos);

    /* move the machine type indicator element */
    uilib_move_element(hwnd, IDC_C128_MACHINE_TYPE, xpos + 10);

    resources_get_int("MachineType", &res_value);
    machine_hwnd = GetDlgItem(hwnd, IDC_C128_MACHINE_TYPE);
    for (res_value_loop = 0; ui_machine[res_value_loop] != 0; res_value_loop++) {
        SendMessage(machine_hwnd, CB_ADDSTRING, 0, (LPARAM)translate_text(ui_machine[res_value_loop]));
    }
    SendMessage(machine_hwnd, CB_SETCURSEL, (WPARAM)res_value, 0);

    enable_machine_controls(hwnd);
}
Пример #5
0
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);
}
Пример #6
0
static void init_vicii_dialog(HWND hwnd)
{
    int n;

    uilib_localize_dialog(hwnd, vicii_dialog);

    resources_get_int("VICIIBorderMode", &n);
    switch (n) {
        default:
        case VICII_NORMAL_BORDERS:
            n = IDC_TOGGLE_VICII_NORMALBORDERS;
            break;
        case VICII_FULL_BORDERS:
            n = IDC_TOGGLE_VICII_FULLBORDERS;
            break;
        case VICII_DEBUG_BORDERS:
            n = IDC_TOGGLE_VICII_DEBUGBORDERS;
            break;
    }
    CheckRadioButton(hwnd, IDC_TOGGLE_VICII_NORMALBORDERS, IDC_TOGGLE_VICII_DEBUGBORDERS, n);

    resources_get_int("VICIICheckSsColl", &n);
    CheckDlgButton(hwnd, IDC_TOGGLE_VICII_SSC, n ? BST_CHECKED : BST_UNCHECKED);

    resources_get_int("VICIICheckSbColl", &n);
    CheckDlgButton(hwnd, IDC_TOGGLE_VICII_SBC, n ? BST_CHECKED : BST_UNCHECKED);

    resources_get_int("VICIINewLuminances", &n);
    CheckDlgButton(hwnd, IDC_TOGGLE_VICII_NEWLUM, n ? BST_CHECKED : BST_UNCHECKED);
}
Пример #7
0
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);
}
Пример #8
0
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);
}
Пример #9
0
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);
}
Пример #10
0
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);
}
Пример #11
0
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);
}
Пример #12
0
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);
}
Пример #13
0
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);
}
Пример #14
0
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);
}
Пример #15
0
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);
}
Пример #16
0
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);
}
Пример #17
0
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);
}
Пример #18
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);
}
Пример #19
0
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);
}
Пример #20
0
static void init_device_7_dialog(HWND hwnd)
{
    int res_value;

    /* translate the iec dialog item(s) */
    uilib_localize_dialog(hwnd, printer_iec_dialog_trans);

    if (iec_available_busses() & IEC_BUS_IEC) {
        resources_get_int("IECDevice7", &res_value);
        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);
    }
}
Пример #21
0
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);
}
Пример #22
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);
    }
}
Пример #23
0
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_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);
}
Пример #24
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);
}
Пример #25
0
static void init_plus60k_dialog(HWND hwnd)
{
    HWND temp_hwnd;
    int res_value;
    const char *plus60kfile;
    TCHAR *st_plus60kfile;
    int res_value_loop;
    int active_value;
    int xsize, ysize;

    uilib_localize_dialog(hwnd, plus60k_dialog);
    uilib_get_group_extent(hwnd, plus60k_leftgroup, &xsize, &ysize);
    uilib_adjust_group_width(hwnd, plus60k_leftgroup);
    uilib_move_group(hwnd, plus60k_rightgroup, xsize + 30);

    resources_get_int("PLUS60K", &res_value);
    CheckDlgButton(hwnd, IDC_PLUS60K_ENABLE, 
        res_value ? BST_CHECKED : BST_UNCHECKED);
    
    temp_hwnd = GetDlgItem(hwnd, IDC_PLUS60K_BASE);
    for (res_value_loop = 0; res_value_loop < NUM_OF_PLUS60K_BASE;
        res_value_loop++) {
        TCHAR st[10];
        _stprintf(st, "$%X", ui_plus60k_base[res_value_loop]);
        SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)st);
    }
    resources_get_int("PLUS60Kbase", &res_value);
    active_value = 0;
    for (res_value_loop = 0; res_value_loop < NUM_OF_PLUS60K_BASE;
        res_value_loop++) {
        if (ui_plus60k_base[res_value_loop] == res_value)
            active_value = res_value_loop;
    }
    SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)active_value, 0);

    resources_get_string("PLUS60Kfilename", &plus60kfile);
    st_plus60kfile = system_mbstowcs_alloc(plus60kfile);
    SetDlgItemText(hwnd, IDC_PLUS60K_FILE,
                   plus60kfile != NULL ? st_plus60kfile : TEXT(""));
    system_mbstowcs_free(st_plus60kfile);

    enable_plus60k_controls(hwnd);
}
Пример #26
0
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);
}
Пример #27
0
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);
}
Пример #28
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);
}
Пример #29
0
static void init_ted_dialog(HWND hwnd)
{
    int n;

    uilib_localize_dialog(hwnd, ted_dialog);

    resources_get_int("TEDBorderMode", &n);
    switch (n) {
        default:
        case TED_NORMAL_BORDERS:
            n = IDC_TOGGLE_TED_NORMALBORDERS;
            break;
        case TED_FULL_BORDERS:
            n = IDC_TOGGLE_TED_FULLBORDERS;
            break;
        case TED_DEBUG_BORDERS:
            n = IDC_TOGGLE_TED_DEBUGBORDERS;
            break;
        case TED_NO_BORDERS:
            n = IDC_TOGGLE_TED_NOBORDERS;
            break;
    }
    CheckRadioButton(hwnd, IDC_TOGGLE_TED_NORMALBORDERS, IDC_TOGGLE_TED_NOBORDERS, n);
}
Пример #30
0
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++;
    }
}