您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ui_update_menus函数代码示例

51自学网 2021-06-03 09:07:08
  C++
这篇教程C++ ui_update_menus函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中ui_update_menus函数的典型用法代码示例。如果您正苦于以下问题:C++ ui_update_menus函数的具体用法?C++ ui_update_menus怎么用?C++ ui_update_menus使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了ui_update_menus函数的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: UI_CALLBACK

static UI_CALLBACK(save_resources_file){    char *filename;    ui_button_t button;    int len = 1024;#ifndef HAVE_DIRNAME    char *tmp;#endif    uilib_file_filter_enum_t filter = UILIB_FILTER_ALL;    vsync_suspend_speed_eval();    filename = lib_malloc(len + 1);    strcpy(filename, "");    filename = ui_select_file(_("File to save settings to"), NULL, 0, resources_last_dir, &filter, 1, &button, 0, NULL, UI_FC_SAVE);        if (button == UI_BUTTON_OK && filename != NULL) {        if (resources_save(filename) < 0) {            ui_error(_("Cannot save settings."));        } else {            if (w != NULL) {                ui_message(_("Settings saved successfully."));            }        }        lib_free(resources_last_dir);        util_fname_split(filename, &resources_last_dir, NULL);    }    lib_free(filename);    ui_update_menus();}
开发者ID:bobsummerwill,项目名称:VICE,代码行数:34,


示例2: pet_select_keymap

static void pet_select_keymap(ui_window_t w, int check, char *name, int sympos){    char filename[0x20];    const char *resname;    int kindex;    const char *wd;    const char *maps[6] = {"x11_buks", "x11_bukp", "x11_bgrs", "x11_bgrp", "x11_bdes", "x11_bdep"};    resources_get_int("KeymapIndex", &kindex);    strcpy(filename, maps[kindex]);    strcat(filename, name);    kindex = (kindex & ~1) + sympos;    resname = machine_keymap_res_name_list[kindex];    if (name) {        if (!check) {            resources_set_string(resname, filename);            ui_update_menus();        } else {            resources_get_string(resname, &wd);            if (!strcmp(wd, filename)) {                ui_menu_set_tick(w, 1);            } else {                ui_menu_set_tick(w, 0);            }        }    }}
开发者ID:AreaScout,项目名称:vice,代码行数:28,


示例3: TUI_MENU_CALLBACK

static TUI_MENU_CALLBACK(radio_type_check_callback){    int drive = (int)param >> 16;    int type = (int)param & 0xffff;    int value;    int i;    int support = (is_fs(type) || drive_check_type(type, drive - 8));    if (!support) {        return "N/A";    }    if (been_activated) {        if (is_fs(type)) {            resources_set_int_sprintf("IECDevice%i", 1, drive);            resources_set_int_sprintf("FileSystemDevice%i", type, drive);        } else {            if (has_fs()) {                resources_set_int_sprintf("IECDevice%i", 0, drive);            }            resources_set_int_sprintf("Drive%iType", type, drive);        }        *become_default = 1;        ui_update_menus();    } else {        if (check_current_drive_type(type, drive)) {            *become_default = 1;        }    }}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:30,


示例4: load_snapshot_trap

static void load_snapshot_trap(WORD unused_addr, void *unused_data){    if (autostart_program_name && machine_read_snapshot((char *)autostart_program_name, 0) < 0)        ui_error(translate_text(IDGS_CANNOT_LOAD_SNAPSHOT_FILE));    ui_update_menus();}
开发者ID:twinaphex,项目名称:vice-next,代码行数:7,


示例5: autostart_prg

/* Autostart PRG file `file_name'.  The PRG file can either be a raw CBM file   or a P00 file */int autostart_prg(const char *file_name, unsigned int runmode){	fileio_info_t *finfo;	int result;	const char *boot_file_name;	int mode;	if (event_record_active() || event_playback_active())		return -1;	/* open prg file */	finfo = fileio_open(file_name, NULL, FILEIO_FORMAT_RAW | FILEIO_FORMAT_P00, FILEIO_COMMAND_READ | FILEIO_COMMAND_FSNAME, FILEIO_TYPE_PRG);	/* can't open file */	if (finfo == NULL) {		#ifdef CELL_DEBUG		printf("ERROR: Cannot open `%s'./n", file_name);		#endif		return -1;	}	/* determine how to load file */	switch(AutostartPrgMode)	{		case AUTOSTART_PRG_MODE_VFS:			//log_message(autostart_log, "Loading PRG file `%s' with virtual FS on unit #8.", file_name);			result = autostart_prg_with_virtual_fs(file_name, finfo);			mode = AUTOSTART_HASDISK;			boot_file_name = (const char *)finfo->name;			break;		case AUTOSTART_PRG_MODE_INJECT:			//log_message(autostart_log, "Loading PRG file `%s' with direct RAM injection.", file_name);			result = autostart_prg_with_ram_injection(file_name, finfo);			mode = AUTOSTART_INJECT;			boot_file_name = NULL;			break;		case AUTOSTART_PRG_MODE_DISK:			//log_message(autostart_log, "Loading PRG file `%s' with autostart disk image.", file_name);			result = autostart_prg_with_disk_image(file_name, finfo, AutostartPrgDiskImage);			mode = AUTOSTART_HASDISK;			boot_file_name = "*";			break;		default:			//log_error(autostart_log, "Invalid PRG autostart mode: %d", AutostartPrgMode);			result = -1;			break;	}	/* Now either proceed with disk image booting or prg injection after reset */	if (result >= 0)	{		ui_update_menus();		reboot_for_autostart(boot_file_name, mode, runmode);	}	/* close prg file */	fileio_close(finfo);	return result;}
开发者ID:twinaphex,项目名称:vice-next,代码行数:62,


示例6: UI_CALLBACK

static UI_CALLBACK(attach_cartridge){    int type = vice_ptr_to_int(UI_MENU_CB_PARAM);    char *filename;    ui_button_t button;    static char *last_dir;    uilib_file_filter_enum_t filter[] = { UILIB_FILTER_VIC20CART, UILIB_FILTER_ALL };    vsync_suspend_speed_eval();    filename = ui_select_file(_("Attach cartridge image"), NULL, 0, last_dir, filter, sizeof(filter) / sizeof(*filter), &button, 0, NULL, UI_FC_LOAD);    switch (button) {        case UI_BUTTON_OK:            if (cartridge_attach_image(type, filename) < 0) {                ui_error(_("Invalid cartridge image"));            }            lib_free(last_dir);            util_fname_split(filename, &last_dir, NULL);            ui_update_menus();            break;        default:            /* Do nothing special.  */            break;    }    lib_free(filename);}
开发者ID:AreaScout,项目名称:vice,代码行数:25,


示例7: TUI_MENU_CALLBACK

static TUI_MENU_CALLBACK(create_disk_image_callback){    if (been_activated) {        unsigned int drive;        drive = (unsigned int)param;        if (file_name == NULL) {            tui_error("Specify a disk image name.");            return NULL;        }        if (vdrive_internal_create_format_disk_image(file_name, format_name, image_type[file_type]) < 0) {            tui_error("Could not create disk image!");            return NULL;        }        if (drive > 0) {            if (file_system_attach_disk(drive, file_name) < 0) {                tui_error("Could not attach disk image!");                return NULL;            }        }        ui_update_menus();    }    return NULL;}
开发者ID:carriercomm,项目名称:VICE-Core,代码行数:29,


示例8: TUI_MENU_CALLBACK

static TUI_MENU_CALLBACK(attach_cartridge_callback){    const char *s;    int type = (int)param;    if (been_activated) {        char *default_item, *directory;        char *name;        s = cartridge_get_file_name(cartridge_type_to_address(type));        if (s == NULL) {            directory = default_item = NULL;        } else {            util_fname_split(s, &directory, &default_item);        }        name = tui_file_selector("Attach cartridge image", directory, "*", default_item, NULL, NULL, NULL);        if (name != NULL && (s == NULL || strcasecmp(name, s) != 0) && cartridge_attach_image(type, name) < 0) {            tui_error("Invalid cartridge image.");        }        ui_update_menus();        lib_free(name);    }    /* This is redundant if `been_activated' is nonzero, but let's stay on       the safe side.  */    s = cartridge_get_file_name(cartridge_type_to_address(type));    if (s == NULL || *s == '/0') {        return "(none)";    } else {        return s;    }}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:33,


示例9: TUI_MENU_CALLBACK

static TUI_MENU_CALLBACK(set_joy_device_callback){    int port = (int)param >> 8;    char *resource;    switch (port) {        case 1:        default:            resource = "JoyDevice1";            break;        case 2:            resource = "JoyDevice2";            break;        case 3:            resource = "JoyDevice3";            break;        case 4:            resource = "JoyDevice4";            break;    }    if (been_activated) {        resources_set_int(resource, ((int)param & 0xff));        ui_update_menus();    } else {        int value;        resources_get_int(resource, &value);        if (value == ((int)param & 0xff)) {            *become_default = 1;        }    }    return NULL;}
开发者ID:carriercomm,项目名称:VICE-Core,代码行数:35,


示例10: load_snapshot_trap

static void load_snapshot_trap(WORD unused_addr, void *data){    ui_button_t button;    char *filename;    vsync_suspend_speed_eval();    if (data) {        log_debug("Quickloading file %s.", (char *)data);        filename = (char *)data;    } else {        uilib_file_filter_enum_t filter[] = { UILIB_FILTER_SNAPSHOT, UILIB_FILTER_ALL };        filename = ui_select_file(_("Load snapshot image"), NULL, 0, load_snapshot_last_dir, filter, sizeof(filter) / sizeof(*filter), &button, 0, NULL, UI_FC_LOAD);        if (button != UI_BUTTON_OK) {            lib_free(filename);            return;        }    }    lib_free(load_snapshot_last_dir);    util_fname_split(filename, &load_snapshot_last_dir, NULL);    if (machine_read_snapshot(filename, 0) < 0) {        ui_error(_("Cannot load snapshot file/n`%s'"), filename);    }    ui_update_menus();    lib_free(filename);}
开发者ID:bobsummerwill,项目名称:VICE,代码行数:28,


示例11: ui_select_renderer

void ui_select_renderer(ui_window_t w, int check, int type, char *chip){    char r1[0x20], r2[0x20];    int renderer = 0, crt, have_scale2x, scale2x, doublesize;    strcpy(r1, chip);    strcpy(r2, chip);    strcat(r1, "Scale2x");    strcat(r2, "DoubleSize");    resources_get_int("PalEmulation", &crt);    if (resources_query_type(r1) == RES_INTEGER) {        resources_get_int(r1, &scale2x);        have_scale2x = 1;    } else {        scale2x = 0;        have_scale2x = 0;    }    resources_get_int(r2, &doublesize);    if (crt) {        renderer = 1;    } else if ((scale2x > 0) && (doublesize > 0)) {        renderer = 2;    }    if (!check) {        switch (type) {            case 0: /* unfiltered */                crt = 0;                scale2x = 0;                break;            case 1: /* CRT */                crt = 1;                scale2x = 0;                break;            case 2: /* scale 2x */                crt = 0;                scale2x = 1;                doublesize = 1;                break;        }        resources_set_int("PalEmulation", crt);        if (have_scale2x) {            resources_set_int(r1, scale2x);        }        resources_set_int(r2, doublesize);        ui_update_menus();    } else {        if (renderer == type) {            ui_menu_set_tick(w, 1);        } else {            ui_menu_set_tick(w, 0);        }    }}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:60,


示例12: UI_CALLBACK

static UI_CALLBACK(ui_netplay_set_port){    static char input_string[32];    char *msg_string;    ui_button_t button;    int i;    int current_port;    resources_get_int("NetworkServerPort", &current_port);    if (!*input_string) {        sprintf(input_string, "%d", current_port);    }    vsync_suspend_speed_eval();    msg_string = lib_stralloc(_("Enter port"));    button = ui_input_string(_("Netplay TCP port"), msg_string, input_string, 32);    lib_free(msg_string);    if (button == UI_BUTTON_OK) {        i = atoi(input_string);        if (i > 0 && i < 65536) {            resources_set_int("NetworkServerPort", i);            ui_update_menus();        } else {            ui_error(_("Invalid TCP port"));        }    }}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:29,


示例13: load_snapshot_trap

static void load_snapshot_trap(WORD unused_addr, void *data){    ui_button_t button;    char *filename;    vsync_suspend_speed_eval();    if (data) {        log_debug(_("Quickloading file %s."), (char *)data);        filename = (char *)data;    } else {        filename = ui_select_file(_("Load snapshot"), NULL, 0, 0,                                  load_snapshot_last_dir,                                  "*.vsf", &button, 0, NULL);        if (button != UI_BUTTON_OK) {            if (filename)                lib_free(filename);            return;        }    }    if (load_snapshot_last_dir)        lib_free(load_snapshot_last_dir);    util_fname_split(filename, &load_snapshot_last_dir, NULL);    if (machine_read_snapshot(filename, 0) < 0)        ui_error(_("Cannot load snapshot file/n`%s'"), filename);    ui_update_menus();    if (filename != NULL)        lib_free(filename);}
开发者ID:martinpiper,项目名称:VICE,代码行数:31,


示例14: mem_read_rom_snapshot_module

static int mem_read_rom_snapshot_module(snapshot_t *s){    BYTE major_version, minor_version;    snapshot_module_t *m;    int trapfl;    /* Main memory module.  */    m = snapshot_module_open(s, snap_rom_module_name,                             &major_version, &minor_version);    /* This module is optional.  */    if (m == NULL)        return 0;    /* disable traps before loading the ROM */    resources_get_int("VirtualDevices", &trapfl);    resources_set_int("VirtualDevices", 0);    if (major_version > SNAP_ROM_MAJOR || minor_version > SNAP_ROM_MINOR) {        log_error(c128_snapshot_log,                  "MEM: Snapshot module version (%d.%d) newer than %d.%d.",                  major_version, minor_version,                  SNAP_ROM_MAJOR, SNAP_ROM_MINOR);        goto fail;    }    if (0        || SMR_BA(m, c128memrom_kernal_rom, C128_KERNAL_ROM_SIZE) < 0        || SMR_BA(m, c128memrom_basic_rom, C128_BASIC_ROM_SIZE) < 0        || SMR_BA(m, c128memrom_basic_rom + C128_BASIC_ROM_SIZE,        C128_EDITOR_ROM_SIZE) < 0        || SMR_BA(m, mem_chargen_rom, C128_CHARGEN_ROM_SIZE) < 0)        goto fail;    log_warning(c128_snapshot_log,"Dumped Romset files and saved settings will "                "represent/nthe state before loading the snapshot!");    memcpy(c128memrom_kernal_trap_rom, c128memrom_kernal_rom,           C128_KERNAL_ROM_SIZE);    c128rom_basic_checksum();    c128rom_kernal_checksum();    /* enable traps again when necessary */    resources_set_int("VirtualDevices", trapfl);    /* to get all the checkmarks right */    ui_update_menus();    return 0; fail:    /* enable traps again when necessary */    resources_set_int("VirtualDevices", trapfl);    if (m != NULL)        snapshot_module_close(m);    return -1;}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:59,


示例15: load_snapshot_trap

static void load_snapshot_trap(WORD unused_addr, void *unused_data){    if (autostart_program_name        && machine_read_snapshot((char *)autostart_program_name, 0) < 0) {        snapshot_display_error();    }    ui_update_menus();}
开发者ID:aerdnar,项目名称:emu-ex-plus-alpha,代码行数:9,


示例16: TUI_MENU_CALLBACK

static TUI_MENU_CALLBACK(restore_default_settings_callback){    if (been_activated) {        resources_set_defaults();        tui_message("Default settings restored.");        ui_update_menus();    }    return NULL;}
开发者ID:bobsummerwill,项目名称:VICE,代码行数:10,


示例17: UI_CALLBACK

static UI_CALLBACK(radio_SidModel){    int engine, model, selected;    selected = vice_ptr_to_int(UI_MENU_CB_PARAM);    if (!CHECK_MENUS) {        engine = selected >> 8;        model = selected & 0xff;        sid_set_engine_model(engine, model);        ui_update_menus();    } else {
开发者ID:AreaScout,项目名称:vice,代码行数:11,


示例18: c128_snapshot_read_module

int c128_snapshot_read_module(snapshot_t *s){    BYTE major_version, minor_version;    snapshot_module_t *m;    WORD i;    BYTE byte;    /* Main memory module.  */    m = snapshot_module_open(s, snap_module_name,                             &major_version, &minor_version);    if (m == NULL)        return -1;    if (major_version > SNAP_MAJOR || minor_version > SNAP_MINOR) {        log_error(c128_snapshot_log,                  "MEM: Snapshot module version (%d.%d) newer than %d.%d.",                  major_version, minor_version,                  SNAP_MAJOR, SNAP_MINOR);        goto fail;    }    for (i = 0; i < 11; i++) {        if (SMR_B(m, &byte) < 0)            goto fail;        mmu_store(i, byte);     /* Assuming no side-effects */    }    if (0        || SMR_BA(m, mem_ram, C128_RAM_SIZE) < 0)        goto fail;    /* pla_config_changed(); */    if (snapshot_module_close(m) < 0)        goto fail;    m = NULL;    if (mem_read_rom_snapshot_module(s) < 0)        goto fail;    if (cartridge_snapshot_read_modules(s) < 0) {        goto fail;    }    ui_update_menus();    return 0;fail:    if (m != NULL)        snapshot_module_close(m);    return -1;}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:54,


示例19: TUI_MENU_CALLBACK

static TUI_MENU_CALLBACK(set_model_callback){    if (been_activated) {        pet_set_model(param, NULL);        ui_update_menus();    }    /* This way, the "Not Really!" item is always the default one.  */    *become_default = 0;    return NULL;}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:11,


示例20: load_snapshot_trap

static void load_snapshot_trap(WORD unused_addr, void *unused_data){    if (autostart_program_name        && machine_read_snapshot((char *)autostart_program_name, 0) < 0)#ifdef HAS_TRANSLATION        ui_error(translate_text(IDGS_CANNOT_LOAD_SNAPSHOT_FILE));#else        ui_error(_("Cannot load snapshot file."));#endif    ui_update_menus();}
开发者ID:martinpiper,项目名称:VICE,代码行数:11,


示例21: UI_CALLBACK

static UI_CALLBACK(set_joystick_device_4){    int tmp;    if (!CHECK_MENUS) {        resources_set_int("JoyDevice4", vice_ptr_to_int(UI_MENU_CB_PARAM));        ui_update_menus();    } else {        resources_get_int("JoyDevice4", &tmp);        ui_menu_set_tick(w, tmp == vice_ptr_to_int(UI_MENU_CB_PARAM));    }}
开发者ID:AreaScout,项目名称:vice,代码行数:12,


示例22: autostart_prg

/* Autostart PRG file `file_name'.  The PRG file can either be a raw CBM file   or a P00 file, and the FS-based drive emulation is set up so that its   directory becomes the current one on unit #8.  */int autostart_prg(const char *file_name, unsigned int runmode){    char *directory;    char *file;    fileio_info_t *finfo;    if (network_connected())        return -1;        finfo = fileio_open(file_name, NULL, FILEIO_FORMAT_RAW | FILEIO_FORMAT_P00,                        FILEIO_COMMAND_READ | FILEIO_COMMAND_FSNAME,                        FILEIO_TYPE_PRG);    if (finfo == NULL) {        log_error(autostart_log, "Cannot open `%s'.", file_name);        return -1;    }    /* Extract the directory path to allow FS-based drive emulation to       work.  */    util_fname_split(file_name, &directory, &file);    if (archdep_path_is_relative(directory)) {        char *tmp;        archdep_expand_path(&tmp, directory);        lib_free(directory);        directory = tmp;        /* FIXME: We should actually eat `.'s and `..'s from `directory'           instead.  */    }    /* Setup FS-based drive emulation.  */    fsdevice_set_directory(directory ? directory : ".", 8);    set_true_drive_emulation_mode(0);    orig_drive_true_emulation_state =0;    resources_set_int("VirtualDevices", 1);    resources_set_int("FSDevice8ConvertP00", 1);    file_system_detach_disk(8);    ui_update_menus();    /* Now it's the same as autostarting a disk image.  */    reboot_for_autostart((char *)(finfo->name), AUTOSTART_HASDISK, runmode);    lib_free(directory);    lib_free(file);    fileio_close(finfo);    log_message(autostart_log, "Preparing to load PRG file `%s'.",                file_name);    return 0;}
开发者ID:martinpiper,项目名称:VICE,代码行数:56,


示例23: UI_CALLBACK

static UI_CALLBACK(toggle_pause){    static int pause = 0;    if (!CHECK_MENUS) {        pause = !pause;        ui_update_menus();        ui_pause_emulation(pause);        return;    }    ui_menu_set_tick(w, pause);}
开发者ID:martinpiper,项目名称:VICE,代码行数:13,



注:本文中的ui_update_menus函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ uid函数代码示例
C++ ui_text_visible函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。