当前位置: 首页>>代码示例>>C++>>正文


C++ dialog_clear函数代码示例

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


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

示例1: 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:jiangxilong,项目名称:kiwi,代码行数:33,代码来源:mconf.c

示例2: 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:jiangxilong,项目名称:kiwi,代码行数:27,代码来源:mconf.c

示例3: 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:0ida,项目名称:coreboot,代码行数:25,代码来源:mconf.c

示例4: main

int
main(int argc, char **argv)
{
	int retval;
	unsigned char *tresult;

	init_dialog();
	use_helpfile("ftree2.test");
	use_helpline("Press Arrows, Tab, Enter or F1");
	retval = dialog_ftree("ftree2.test", '\t',
		"ftree dialog box example",
		"xterm widget tree from preprocess editres(1) dump", 
		-1, -1, 15,
                            &tresult);

	dialog_update();
	
	dialog_clear();
	
	end_dialog();

	if (!retval)
	{
 		puts(tresult);
  		free(tresult);
  	}
  	
	exit(retval);
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:29,代码来源:ftree2.c

示例5: init_dialog

/*
 * Do some initialization for dialog
 */
int init_dialog(const char *backtitle)
{
	int height, width;

	initscr();		/* Init curses */

	/* Get current cursor position for signal handler in mconf.c */
	getyx(stdscr, saved_y, saved_x);

	getmaxyx(stdscr, height, width);
	if (height < 19 || width < 80) {
		endwin();
		return -ERRDISPLAYTOOSMALL;
	}

	dlg.backtitle = backtitle;
	color_setup(getenv("MENUCONFIG_COLOR"));

	keypad(stdscr, TRUE);
	cbreak();
	noecho();
	dialog_clear();

	return 0;
}
开发者ID:whble,项目名称:trunk,代码行数:28,代码来源:util.c

示例6: 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:Voskrese,项目名称:mipsonqemu,代码行数:26,代码来源:mconf.c

示例7: main

int main(int ac, char **av)
{
	struct symbol *sym;
	char *mode;
	int res;

	setlocale(LC_ALL, "");
	bindtextdomain(PACKAGE, LOCALEDIR);
	textdomain(PACKAGE);

	conf_parse(av[1]);
	conf_read(NULL);

	sym = sym_lookup("KERNELVERSION", 0);
	sym_calc_value(sym);
	sprintf(menu_backtitle, _("Linux Kernel v%s Configuration"),
		sym_get_string_value(sym));

	mode = getenv("MENUCONFIG_MODE");
	if (mode) {
		if (!strcasecmp(mode, "single_menu"))
			single_menu_mode = 1;
	}

	tcgetattr(1, &ios_org);
	atexit(conf_cleanup);
	init_wsize();
	reset_dialog();
	init_dialog(menu_backtitle);
	do {
		conf(&rootmenu);
		dialog_clear();
		res = dialog_yesno(NULL,
				   _("Do you wish to save your "
				     "new kernel configuration?\n"
				     "<ESC><ESC> to continue."),
				   6, 60);
	} while (res == KEY_ESC);
	end_dialog();
	if (res == 0) {
		if (conf_write(NULL)) {
			fprintf(stderr, _("\n\n"
				"Error during writing of the kernel configuration.\n"
				"Your kernel configuration changes were NOT saved."
				"\n\n"));
			return 1;
		}
		printf(_("\n\n"
			"*** End of Linux kernel configuration.\n"
			"*** Execute 'make' to build the kernel or try 'make help'."
			"\n\n"));
	} else {
		fprintf(stderr, _("\n\n"
			"Your kernel configuration changes were NOT saved."
			"\n\n"));
	}

	return 0;
}
开发者ID:Voskrese,项目名称:mipsonqemu,代码行数:59,代码来源:mconf.c

示例8: _menu1_fw_action

static int 
_menu1_fw_action(dialogMenuItem * self)
{
	dialog_clear();
	init_dialog();
	main_fw_menu();
	return DITEM_SUCCESS | DITEM_RESTORE | DITEM_CONTINUE;
}
开发者ID:joshuabergeron,项目名称:ClosedBSD,代码行数:8,代码来源:menu.c

示例9: conf_choice

static void conf_choice(struct menu *menu)
{
	const char *prompt = _(menu_get_prompt(menu));
	struct menu *child;
	struct symbol *active;

	active = sym_get_choice_value(menu->sym);
	while (1) {
		int res;
		int selected;
		item_reset();

		current_menu = menu;
		for (child = menu->list; child; child = child->next) {
			if (!menu_is_visible(child))
				continue;
			if (child->sym)
				item_make("%s", _(menu_get_prompt(child)));
			else {
				item_make("*** %s ***", _(menu_get_prompt(child)));
				item_set_tag(':');
			}
			item_set_data(child);
			if (child->sym == active)
				item_set_selected(1);
			if (child->sym == sym_get_choice_value(menu->sym))
				item_set_tag('X');
		}
		dialog_clear();
		res = dialog_checklist(prompt ? _(prompt) : _("Main Menu"),
					_(radiolist_instructions),
					 15, 70, 6);
		selected = item_activate_selected();
		switch (res) {
		case 0:
			if (selected) {
				child = item_data();
				if (!child->sym)
					break;

				sym_set_tristate_value(child->sym, yes);
			}
			return;
		case 1:
			if (selected) {
				child = item_data();
				show_help(child);
				active = child->sym;
			} else
				show_help(menu);
			break;
		case KEY_ESC:
			return;
		case -ERRDISPLAYTOOSMALL:
			return;
		}
	}
}
开发者ID:Christopher83,项目名称:linaro_crosstool-ng,代码行数:58,代码来源:mconf.c

示例10: _menu1_re_action

static int 
_menu1_re_action(dialogMenuItem * self)
{
	dialog_clear();
	end_dialog();
	endwin();
	system("/sbin/reboot");
	exit(0);
}
开发者ID:joshuabergeron,项目名称:ClosedBSD,代码行数:9,代码来源:menu.c

示例11: _afm_flush

int _afm_flush(dialogMenuItem *self)
{
	dialog_clear();
	system("/sbin/ipfw -q flush");
	unlink("/etc/rules");

   dialog_msgbox("ClosedBSD", "Ruleset has been cleared.", -1, -1, 1); 
	return DITEM_SUCCESS | DITEM_RESTORE | DITEM_CONTINUE;
}
开发者ID:joshuabergeron,项目名称:ClosedBSD,代码行数:9,代码来源:main.c

示例12: main_menu

int 
main_menu()
{
	int retval;

	retval = dialog_menu("ClosedBSD Configuration Menu", "Please select the appropriate option:", -1, -1, 8, -8, menu1, NULL, NULL, NULL);

	dialog_clear();

	return 0;
}
开发者ID:joshuabergeron,项目名称:ClosedBSD,代码行数:11,代码来源:menu.c

示例13: init_dialog

/*
 * Do some initialization for dialog
 */
void init_dialog(void)
{
	initscr();		/* Init curses */
	keypad(stdscr, TRUE);
	cbreak();
	noecho();

	if (use_colors)		/* Set up colors */
		color_setup();

	dialog_clear();
}
开发者ID:4pao,项目名称:openwrt,代码行数:15,代码来源:util.c

示例14: main

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

  init_dialog();

  retval = dialog_textbox("This is dialog_textbox() in action with /etc/passwd", "/etc/passwd", 10, 60);
  dialog_clear();
  fprintf(stderr, "returned value for dialog_textbox was %d\n", retval);

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

示例15: main

/* Kick it off, James! */
int
main(int argc, char **argv)
{
  int retval;

  init_dialog();

  retval = dialog_dselect(".", "*");
  dialog_clear();
  fprintf(stderr, "returned value for dialog_dselect was %d\n", retval);

  end_dialog();
  return 0;
}
开发者ID:edgar-pek,项目名称:PerspicuOS,代码行数:15,代码来源:dselect.c


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