• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dialog_inputbox函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: conf_save

static void conf_save(void)
{
	while (1) {
		int res;
		dialog_clear();
		res = dialog_inputbox(NULL, save_config_text,
				      11, 55, filename);
		switch(res) {
		case 0:
			if (!dialog_input_result[0])
				return;
			if (!conf_write(dialog_input_result)) {
				set_config_filename(dialog_input_result);
				return;
			}
			show_textbox(NULL, _("Can't create file!  Probably a nonexistent directory."), 5, 60);
			break;
		case 1:
			show_helptext(_("Save Alternate Configuration"), save_config_help);
			break;
		case KEY_ESC:
			return;
		}
	}
}
开发者ID:16rd,项目名称:rt-n56u,代码行数:25,代码来源:mconf.c


示例2: search_conf

static void search_conf(void)
{
	struct symbol **sym_arr;
	struct gstr res;
	int dres;
again:
	dialog_clear();
	dres = dialog_inputbox(_("Search Configuration Parameter"),
			      _("Enter CONFIG_ (sub)string to search for (omit CONFIG_)"),
			      10, 75, "");
	switch (dres) {
	case 0:
		break;
	case 1:
		show_helptext(_("Search Configuration"), search_help);
		goto again;
	default:
		return;
	}

	sym_arr = sym_re_search(dialog_input_result);
	res = get_relations_str(sym_arr);
	free(sym_arr);
	show_textbox(_("Search Results"), str_get(&res), 0, 0);
	str_free(&res);
}
开发者ID:BackupTheBerlios,项目名称:openslx-svn,代码行数:26,代码来源:mconf.c


示例3: conf_load

static void conf_load(void)
{

	while (1) {
		int res;
		dialog_clear();
		res = dialog_inputbox(NULL, load_config_text,
				      11, 55, filename);
		switch(res) {
		case 0:
			if (!dialog_input_result[0])
				return;
			if (!conf_read(dialog_input_result)) {
				set_config_filename(dialog_input_result);
				sym_set_change_count(1);
				return;
			}
			show_textbox(NULL, _("File does not exist!"), 5, 38);
			break;
		case 1:
			show_helptext(_("Load Alternate Configuration"), load_config_help);
			break;
		case KEY_ESC:
			return;
		}
	}
}
开发者ID:16rd,项目名称:rt-n56u,代码行数:27,代码来源:mconf.c


示例4: search_conf

static void search_conf(void)
{
	struct symbol **sym_arr;
	struct gstr res;
	char *dialog_input;
	int dres;
again:
	dialog_clear();
	dres = dialog_inputbox(_("Search Configuration Parameter"),
			      _("Enter CONFIG_ (sub)string to search for "
				"(with or without \"CONFIG\")"),
			      10, 75, "");
	switch (dres) {
	case 0:
		break;
	case 1:
		show_helptext(_("Search Configuration"), search_help);
		goto again;
	default:
		return;
	}

	/* strip CONFIG_ if necessary */
	dialog_input = dialog_input_result;
	if (strncasecmp(dialog_input_result, "CONFIG_", 7) == 0)
		dialog_input += 7;

	sym_arr = sym_re_search(dialog_input);
	res = get_relations_str(sym_arr);
	free(sym_arr);
	show_textbox(_("Search Results"), str_get(&res), 0, 0);
	str_free(&res);
}
开发者ID:16rd,项目名称:rt-n56u,代码行数:33,代码来源:mconf.c


示例5: j_passwordbox

static int
j_passwordbox(JUMPARGS)
{
    *offset_add = arg_rest(av);
    return show_result(dialog_inputbox(t,
				       av[1],
				       numeric_arg(av, 2),
				       numeric_arg(av, 3),
				       optional_str(av, 4, 0), 1));
}
开发者ID:BackupTheBerlios,项目名称:geoirc,代码行数:10,代码来源:dialog.c


示例6: _afi_manual

int _afi_manual(dialogMenuItem *self)
{
	char result[256];
	int ret;

	dialog_clear();
	bzero(result, sizeof(result));

	ret = dialog_inputbox("ClosedBSD: Manual IPFW rule addition", "Type in the rule manually.  These are some sample rules that illustrate the syntax\n\n 'add allow all from any to any'\n 'add deny tcp from echelon.gov'\n 'add deny all from evilcrackers.org'\n 'add allow all from 192.168.202.0 to any out'\n\n", -1, -1, result);

	if (ret == 0)
		raw_add_rule(result);

	return DITEM_SUCCESS | DITEM_RESTORE | DITEM_CONTINUE;
}
开发者ID:joshuabergeron,项目名称:ClosedBSD,代码行数:15,代码来源:main.c


示例7: ask_option_value

static int ask_option_value(DC_Procedure *act, DC_OptionSetting *setting, DC_ProcedureOption *option) {
    char *suggested_value = setting->value;
    char entered_value[200];
    const char *param_type_str;
    char *config_supplied_value;
    char *config_suggested_value;
    char config_search_command[200];
    snprintf(config_search_command, sizeof(config_search_command),
            "grep ^%s.%s= ~/.whddrc 2>/dev/null | awk -F= '{print $2}' | tr -d '\\n'", act->name, option->name);
    config_supplied_value = cmd_output(config_search_command);
    if (config_supplied_value) {
        setting->value = config_supplied_value;
        return 0;
    }

    snprintf(config_search_command, sizeof(config_search_command),
            "grep ^%s.%s.suggest= ~/.whddrc 2>/dev/null | awk -F= '{print $2}' | tr -d '\\n'", act->name, option->name);
    config_suggested_value = cmd_output(config_search_command);
    if (config_suggested_value)
        suggested_value = config_suggested_value;

    switch (option->type) {
        case DC_ProcedureOptionType_eInt64:
            param_type_str = "numeric";
            break;
        case DC_ProcedureOptionType_eString:
            param_type_str = "string";
            break;
    }
    char prompt[500];
    snprintf(prompt, sizeof(prompt), "Please enter %s parameter: %s (%s)",
            param_type_str, option->name, option->help);

    dialog_vars.default_button = -1;  // Workaround for surprisingly unfocused input field on old libdialog
    dialog_vars.input_result = NULL;
    int r = dialog_inputbox("Input box", prompt, 0, 0, suggested_value, 0);
    if (r != 0) {
        dialog_msgbox("Info", "Action cancelled", 0, 0, 1);
        return 1;
    }
    // Wow, libdialog is awesomely sane and brilliantly documented lib, i fuckin love it
    snprintf(entered_value, sizeof(entered_value), "%s", dialog_vars.input_result);
    if (entered_value[0] == '\0' || entered_value[0] == '\n')
        snprintf(entered_value, sizeof(entered_value), "%s", suggested_value);
    setting->value = strdup(entered_value);
    free(suggested_value);
    return 0;
}
开发者ID:fillods,项目名称:whdd,代码行数:48,代码来源:main.c


示例8: main

/* Kick it off, James! */
int
main(int argc, char **argv)
{
  int retval;
  unsigned char result[128];

  init_dialog();

  strcpy(result, "not this!");
  retval = dialog_inputbox("this is dialog_inputbox() in action, test #1",
		       "Enter something really profound below, please.",
		       -1, -1, result);
  dialog_clear();
  fprintf(stderr, "returned value for dialog_inputbox was %d (%s)\n", retval, result);

  end_dialog();
  return 0;
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:19,代码来源:input1.c


示例9: conf_save

static void conf_save(void)
{
	while (1) {
		switch (dialog_inputbox(NULL, save_config_text, 11, 55,
					filename)) {
		case 0:
			if (!dialog_input_result[0])
				return;
			if (!conf_write(dialog_input_result))
				return;
			show_textbox(NULL, "Can't create file!  Probably a nonexistent directory.", 5, 60);
			break;
		case 1:
			show_helptext("Save Alternate Configuration", save_config_help);
			break;
		case 255:
			return;
		}
	}
}
开发者ID:0919061,项目名称:PX4NuttX,代码行数:20,代码来源:mconf.c


示例10: conf_load

static void conf_load(void)
{
	while (1) {
		switch (dialog_inputbox(NULL, load_config_text, 11, 55,
					filename)) {
		case 0:
			if (!dialog_input_result[0])
				return;
			if (!conf_read(dialog_input_result))
				return;
			show_textbox(NULL, "File does not exist!", 5, 38);
			break;
		case 1:
			show_helptext("Load Alternate Configuration", load_config_help);
			break;
		case 255:
			return;
		}
	}
}
开发者ID:0919061,项目名称:PX4NuttX,代码行数:20,代码来源:mconf.c


示例11: main

/* Kick it off, James! */
int
main(int argc, unsigned char *argv[])
{
  int retval;
  unsigned char result[128];

  init_dialog();

  result[0]='\0';
  DialogInputAttrs |= DITEM_NO_ECHO;
  retval = dialog_inputbox("this is dialog_inputbox() in action, test #2 (no echo)",
		       "Enter something really secret below, please.",
		       -1, -1, result);
  DialogInputAttrs &= DITEM_NO_ECHO;
  dialog_clear();
  fprintf(stderr, "returned value for dialog_inputbox was %d (%s)\n", retval, result);

  end_dialog();
  return 0;
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:21,代码来源:input2.c


示例12: conf_string

static void conf_string(struct menu *menu)
{
	const char *prompt = menu_get_prompt(menu);

	while (1) {
		int res;
		const char *heading;

		switch (sym_get_type(menu->sym)) {
		case S_INT:
			heading = _(inputbox_instructions_int);
			break;
		case S_HEX:
			heading = _(inputbox_instructions_hex);
			break;
		case S_STRING:
			heading = _(inputbox_instructions_string);
			break;
		default:
			heading = _("Internal mconf error!");
		}
		dialog_clear();
		res = dialog_inputbox(prompt ? _(prompt) : _("Main Menu"),
				      heading, 10, 75,
				      sym_get_string_value(menu->sym));
		switch (res) {
		case 0:
			if (sym_set_string_value(menu->sym, dialog_input_result))
				return;
			show_textbox(NULL, _("You have made an invalid entry."), 5, 43);
			break;
		case 1:
			show_help(menu);
			break;
		case KEY_ESC:
			return;
		}
	}
}
开发者ID:16rd,项目名称:rt-n56u,代码行数:39,代码来源:mconf.c


示例13: conf_string

static void conf_string(struct menu *menu)
{
	const char *prompt = menu_get_prompt(menu);

	while (1) {
		char *heading;

		switch (sym_get_type(menu->sym)) {
		case S_INT:
			heading = (char *) inputbox_instructions_int;
			break;
		case S_HEX:
			heading = (char *) inputbox_instructions_hex;
			break;
		case S_STRING:
			heading = (char *) inputbox_instructions_string;
			break;
		default:
			heading = "Internal mconf error!";
			/* panic? */;
		}

		switch (dialog_inputbox(prompt ? prompt : "Main Menu",
					heading, 10, 75,
					sym_get_string_value(menu->sym))) {
		case 0:
			if (sym_set_string_value(menu->sym, dialog_input_result))
				return;
			show_textbox(NULL, "You have made an invalid entry.", 5, 43);
			break;
		case 1:
			show_help(menu);
			break;
		case 255:
			return;
		}
	}
}
开发者ID:0919061,项目名称:PX4NuttX,代码行数:38,代码来源:mconf.c


示例14: search_conf

static void search_conf(void)
{
	struct symbol **sym_arr;
	struct gstr res;

again:
	switch (dialog_inputbox("Search Configuration Parameter",
				"Enter Keyword", 10, 75,
				NULL)) {
	case 0:
		break;
	case 1:
		show_helptext("Search Configuration", search_help);
		goto again;
	default:
		return;
	}

	sym_arr = sym_re_search(dialog_input_result);
	res = get_relations_str(sym_arr);
	free(sym_arr);
	show_textbox("Search Results", str_get(&res), 0, 0);
	str_free(&res);
}
开发者ID:0919061,项目名称:PX4NuttX,代码行数:24,代码来源:mconf.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dice函数代码示例发布时间:2022-05-30
下一篇:
C++ dialog_clear函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap