本文整理汇总了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);
}
示例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;
}
}
}
示例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;
}
}
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
}
}
示例10: _menu1_re_action
static int
_menu1_re_action(dialogMenuItem * self)
{
dialog_clear();
end_dialog();
endwin();
system("/sbin/reboot");
exit(0);
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}