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

C++ destroy_dlg函数代码示例

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

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



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

示例1: configure_box

void configure_box (void)
{
    int result, i;
    
    init_configure ();
    run_dlg (conf_dlg);

    result = conf_dlg->ret_value;
    if (result == B_ENTER || result == B_EXIT){
	for (i = 0; check_options [i].text; i++)
	    if (check_options [i].widget->state & C_CHANGE){
		if (check_options [i].toggle_function)
		    (*check_options [i].toggle_function)();
		else
		    *check_options [i].variable =
			!(*check_options [i].variable);
	    }
	pause_after_run = pause_radio->sel;
    }

    /* If they pressed the save button */
    if (result == B_EXIT){
	save_configure ();
	sync_profiles ();
    }

    destroy_dlg (conf_dlg);
}
开发者ID:OS2World,项目名称:UTIL-SHELL-Midnight_Commander,代码行数:28,代码来源:option.c


示例2: history_cmd

void
history_cmd (void)
{
    Listbox *listbox;
    GList *current;

    if (cmdline->need_push) {
	if (push_history (cmdline, cmdline->buffer) == 2)
	    cmdline->need_push = 0;
    }
    if (!cmdline->history) {
	message (1, MSG_ERROR, _(" The command history is empty "));
	return;
    }
    current = g_list_first (cmdline->history);
    listbox = create_listbox_window (60, 10, _(" Command history "),
				     "[Command Menu]");
    while (current) {
	LISTBOX_APPEND_TEXT (listbox, 0, (char *) current->data, current);
	current = g_list_next(current);
    }
    run_dlg (listbox->dlg);
    if (listbox->dlg->ret_value == B_CANCEL)
	current = NULL;
    else
	current = listbox->list->current->data;
    destroy_dlg (listbox->dlg);
    g_free (listbox);

    if (!current)
	return;
    cmdline->history = current;
    assign_text (cmdline, (char *) current->data);
    update_input (cmdline, 1);
}
开发者ID:GalaxyTab4,项目名称:workbench,代码行数:35,代码来源:cmd.c


示例3: dlg_clean_run

/**
 * clean old unconfirmed dialogs
 *
 */
int dlg_clean_run(ticks_t ti)
{
	unsigned int i;
	unsigned int tm;
	dlg_cell_t *dlg;
	dlg_cell_t *tdlg;

	tm = (unsigned int)time(NULL);
	for(i=0; i<d_table->size; i++)
	{
		lock_set_get(d_table->locks, d_table->entries[i].lock_idx);
		dlg = d_table->entries[i].first;
		while (dlg) {
			tdlg = dlg;
			dlg = dlg->next;
			if(tdlg->state==DLG_STATE_UNCONFIRMED && tdlg->init_ts<tm-300) {
				/* dialog in early state older than 5min */
				LM_NOTICE("dialog in early state is too old (%p ref %d)\n",
						tdlg, tdlg->ref);
				unlink_unsafe_dlg(&d_table->entries[i], tdlg);
				destroy_dlg(tdlg);
			}
		}
		lock_set_release(d_table->locks, d_table->entries[i].lock_idx);
	}
	return 0;
}
开发者ID:badwtg1111,项目名称:kamailio,代码行数:31,代码来源:dlg_hash.c


示例4: display_bits_box

void
display_bits_box (void)
{
    Dlg_head *dbits_dlg;
    new_display_codepage = display_codepage;

    application_keypad_mode ();
    dbits_dlg = init_disp_bits_box ();

    run_dlg (dbits_dlg);

    if (dbits_dlg->ret_value == B_ENTER) {
	const char *errmsg;
	display_codepage = new_display_codepage;
	errmsg =
	    init_translation_table (source_codepage, display_codepage);
	if (errmsg)
	    message (1, MSG_ERROR, "%s", errmsg);
#ifndef HAVE_SLANG
	meta (stdscr, display_codepage != 0);
#else
	SLsmg_Display_Eight_Bit = (display_codepage != 0
				   && display_codepage != 1) ? 128 : 160;
#endif
	use_8th_bit_as_meta = !(inpcheck->state & C_BOOL);
    }
    destroy_dlg (dbits_dlg);
    repaint_screen ();
}
开发者ID:GalaxyTab4,项目名称:workbench,代码行数:29,代码来源:boxes.c


示例5: editcmd_dialog_raw_key_query

int
editcmd_dialog_raw_key_query (const char *heading, const char *query, gboolean cancel)
{
    int w, wq;
    int y = 2;
    WDialog *raw_dlg;

    w = str_term_width1 (heading) + 6;
    wq = str_term_width1 (query);
    w = max (w, wq + 3 * 2 + 1 + 2);

    raw_dlg =
        create_dlg (TRUE, 0, 0, cancel ? 7 : 5, w, dialog_colors, editcmd_dialog_raw_key_query_cb,
                    NULL, NULL, heading, DLG_CENTER | DLG_TRYUP | DLG_WANT_TAB);

    add_widget (raw_dlg, label_new (y, 3, query));
    add_widget (raw_dlg, input_new (y++, 3 + wq + 1, input_get_default_colors (),
                                    w - (6 + wq + 1), "", 0, INPUT_COMPLETE_NONE));
    if (cancel)
    {
        add_widget (raw_dlg, hline_new (y++, -1, -1));
        /* Button w/o hotkey to allow use any key as raw or macro one */
        add_widget_autopos (raw_dlg, button_new (y, 1, B_CANCEL, NORMAL_BUTTON, _("Cancel"), NULL),
                            WPOS_KEEP_TOP | WPOS_CENTER_HORZ, NULL);
    }

    w = run_dlg (raw_dlg);
    destroy_dlg (raw_dlg);

    return (cancel && (w == ESC_CHAR || w == B_CANCEL)) ? 0 : w;
}
开发者ID:Wizzardich,项目名称:mc,代码行数:31,代码来源:editcmd_dialogs.c


示例6: layout_cmd

void layout_cmd (void)
{
    int result;
    int i;

    init_layout ();
    run_dlg (layout_dlg);
    result = layout_dlg->ret_value;

    if (result == B_ENTER || result == B_EXIT){
	for (i = 0; check_options [i].text; i++)
	    if (check_options [i].widget)
		*check_options [i].variable = check_options [i].widget->state & C_BOOL;
#ifndef HAVE_X		
	horizontal_split = radio_widget->sel;
	first_panel_size = _first_panel_size;
	output_lines = _output_lines;
	layout_do_change = 1;
#endif	
    }
    if (result == B_EXIT){
	save_layout ();
	sync_profiles ();
    }

    destroy_dlg (layout_dlg);
    if (layout_do_change)
	layout_change ();
}
开发者ID:malikcjm,项目名称:mc-nt,代码行数:29,代码来源:layout.c


示例7: tree

char *
tree (char *current_dir)
{
    WTree    *mytree;
    Dlg_head *dlg;
    char     *val;
    WButtonBar *bar;

    tree_colors [3] = dialog_colors [0];
    tree_colors [1] = dialog_colors [1];
    
    /* Create the components */
    dlg = create_dlg (0, 0, TREE_Y, TREE_X, tree_colors,
		      tree_callback, "[Directory Tree]", "tree", DLG_CENTER);
    mytree = tree_new (0, 2, 2, TREE_Y - 6, TREE_X - 5);
    add_widget (dlg, mytree);
    bar = buttonbar_new(1);
    add_widget (dlg, bar);
    bar->widget.x = 0;
    bar->widget.y = LINES - 1;
    
    run_dlg (dlg);
    if (dlg->ret_value == B_ENTER)
	val = strdup (mytree->selected_ptr->name);
    else
	val = 0;
    
    destroy_dlg (dlg);
    return val;
}
开发者ID:OS2World,项目名称:UTIL-SHELL-Midnight_Commander,代码行数:30,代码来源:boxes.c


示例8: dlg_clean_run

/**
 * clean old unconfirmed dialogs
 *
 */
int dlg_clean_run(ticks_t ti)
{
	unsigned int i;
	unsigned int tm;
	dlg_cell_t *dlg;
	dlg_cell_t *tdlg;

	tm = (unsigned int)time(NULL);
	for(i=0; i<d_table->size; i++)
	{
		lock_set_get(d_table->locks, d_table->entries[i].lock_idx);
		dlg = d_table->entries[i].first;
		while (dlg) {
			tdlg = dlg;
			dlg = dlg->next;
			if(tdlg->state==DLG_STATE_UNCONFIRMED && tdlg->init_ts<tm-300) {
				/* dialog in early state older than 5min */
				LM_NOTICE("dialog in early state is too old (%p ref %d)\n",
						tdlg, tdlg->ref);
				unlink_unsafe_dlg(&d_table->entries[i], tdlg);
				destroy_dlg(tdlg);
			}
			if(tdlg->state==DLG_STATE_CONFIRMED_NA && tdlg->start_ts<tm-60) {
				if(update_dlg_timer(&tdlg->tl, 10)<0) {
					LM_ERR("failed to update dialog lifetime in long non-ack state\n");
				}
				tdlg->lifetime = 10;
				tdlg->dflags |= DLG_FLAG_CHANGED;
			}
		}
		lock_set_release(d_table->locks, d_table->entries[i].lock_idx);
	}
	return 0;
}
开发者ID:AlessioCasco,项目名称:kamailio,代码行数:38,代码来源:dlg_hash.c


示例9: destroy_dlg_table

/*!
 * \brief Destroy the global dialog table
 */
void destroy_dlg_table(void)
{
	struct dlg_cell *dlg, *l_dlg;
	unsigned int i;

	if (d_table==0)
		return;

	if (d_table->locks) {
		lock_set_destroy(d_table->locks);
		lock_set_dealloc(d_table->locks);
	}

	for( i=0 ; i<d_table->size; i++ ) {
		dlg = d_table->entries[i].first;
		while (dlg) {
			l_dlg = dlg;
			dlg = dlg->next;
			destroy_dlg(l_dlg);
		}

	}

	shm_free(d_table);
	d_table = 0;

	return;
}
开发者ID:AlessioCasco,项目名称:kamailio,代码行数:31,代码来源:dlg_hash.c


示例10: listmode_done

static void listmode_done (void)
{
    destroy_dlg (listmode_dlg);
    if (0)
	update_panels (UP_OPTIMIZE, UP_KEEPSEL);
    repaint_screen ();
}
开发者ID:OS2World,项目名称:UTIL-SHELL-Midnight_Commander,代码行数:7,代码来源:listmode.c


示例11: tree_box

/* Show tree in a box, not on a panel */
char *
tree_box (const char *current_dir)
{
    WTree    *mytree;
    Dlg_head *dlg;
    char     *val;
    WButtonBar *bar;

    /* Create the components */
    dlg = create_dlg (0, 0, TREE_Y, TREE_X, dialog_colors,
		      tree_callback, "[Directory Tree]", NULL, DLG_CENTER | DLG_REVERSE);
    mytree = tree_new (0, 2, 2, TREE_Y - 6, TREE_X - 5);
    add_widget (dlg, mytree);
    bar = buttonbar_new(1);
    add_widget (dlg, bar);
    bar->widget.x = 0;
    bar->widget.y = LINES - 1;
    
    run_dlg (dlg);
    if (dlg->ret_value == B_ENTER)
	val = g_strdup (tree_selected_name (mytree));
    else
	val = 0;
    
    destroy_dlg (dlg);
    return val;
}
开发者ID:GalaxyTab4,项目名称:workbench,代码行数:28,代码来源:boxes.c


示例12: edit_files

gboolean
edit_files (const GList * files)
{
    static gboolean made_directory = FALSE;
    Dlg_head *edit_dlg;
    WMenuBar *menubar;
    const GList *file;
    gboolean ok = FALSE;

    if (!made_directory)
    {
        char *dir;

        dir = mc_build_filename (mc_config_get_cache_path (), EDIT_DIR, NULL);
        made_directory = (mkdir (dir, 0700) != -1 || errno == EEXIST);
        g_free (dir);

        dir = mc_build_filename (mc_config_get_path (), EDIT_DIR, NULL);
        made_directory = (mkdir (dir, 0700) != -1 || errno == EEXIST);
        g_free (dir);

        dir = mc_build_filename (mc_config_get_data_path (), EDIT_DIR, NULL);
        made_directory = (mkdir (dir, 0700) != -1 || errno == EEXIST);
        g_free (dir);
    }

    /* Create a new dialog and add it widgets to it */
    edit_dlg =
        create_dlg (FALSE, 0, 0, LINES, COLS, NULL, edit_dialog_callback, edit_dialog_event,
                    "[Internal File Editor]", NULL, DLG_WANT_TAB);

    edit_dlg->get_shortcut = edit_get_shortcut;
    edit_dlg->get_title = edit_get_title;

    menubar = menubar_new (0, 0, COLS, NULL);
    add_widget (edit_dlg, menubar);
    edit_init_menu (menubar);

    add_widget (edit_dlg, buttonbar_new (TRUE));

    for (file = files; file != NULL; file = g_list_next (file))
    {
        mcedit_arg_t *f = (mcedit_arg_t *) file->data;
        gboolean f_ok;

        f_ok = edit_add_window (edit_dlg, edit_dlg->y + 1, edit_dlg->x,
                                edit_dlg->lines - 2, edit_dlg->cols, f->file_vpath, f->line_number);
        /* at least one file has been opened succefully */
        ok = ok || f_ok;
    }

    if (ok)
        run_dlg (edit_dlg);

    if (!ok || edit_dlg->state == DLG_CLOSED)
        destroy_dlg (edit_dlg);

    return ok;
}
开发者ID:TomyLobo,项目名称:mc,代码行数:59,代码来源:editwidget.c


示例13: destroy_op_win

void
destroy_op_win (void)
{
    dlg_run_done (op_dlg);
    destroy_dlg (op_dlg);
#ifndef HAVE_X
    the_hint->widget.y = last_hint_line;
#endif
}
开发者ID:OS2World,项目名称:UTIL-SHELL-Midnight_Commander,代码行数:9,代码来源:filegui.c


示例14: fg_message

static void
fg_message (int flags, const char *title, const char *text)
{
    Dlg_head *d;

    d = do_create_message (flags, title, text);
    tty_getch ();
    dlg_run_done (d);
    destroy_dlg (d);
}
开发者ID:ryanlee,项目名称:mc,代码行数:10,代码来源:wtools.c


示例15: edit_file

int
edit_file (const char *_file, int line)
{
    static gboolean made_directory = FALSE;
    Dlg_head *edit_dlg;
    WEdit *wedit;
    WMenuBar *menubar;

    if (!made_directory)
    {
        char *dir = concat_dir_and_file (mc_config_get_cache_path (), EDIT_DIR);
        made_directory = (mkdir (dir, 0700) != -1 || errno == EEXIST);
        g_free (dir);

        dir = concat_dir_and_file (mc_config_get_path (), EDIT_DIR);
        made_directory = (mkdir (dir, 0700) != -1 || errno == EEXIST);
        g_free (dir);

        dir = concat_dir_and_file (mc_config_get_data_path (), EDIT_DIR);
        made_directory = (mkdir (dir, 0700) != -1 || errno == EEXIST);
        g_free (dir);
    }

    wedit = edit_init (NULL, 1, 0, LINES - 2, COLS, _file, line);

    if (wedit == NULL)
        return 0;

    /* Create a new dialog and add it widgets to it */
    edit_dlg =
        create_dlg (FALSE, 0, 0, LINES, COLS, NULL, edit_dialog_callback,
                    "[Internal File Editor]", NULL, DLG_WANT_TAB);

    edit_dlg->get_shortcut = edit_get_shortcut;
    edit_dlg->get_title = edit_get_title;

    menubar = menubar_new (0, 0, COLS, NULL);
    add_widget (edit_dlg, menubar);
    edit_init_menu (menubar);

    init_widget (&wedit->widget, wedit->widget.y, wedit->widget.x,
                 wedit->widget.lines, wedit->widget.cols, edit_callback, edit_event);
    widget_want_cursor (wedit->widget, TRUE);

    add_widget (edit_dlg, wedit);

    add_widget (edit_dlg, buttonbar_new (TRUE));

    run_dlg (edit_dlg);

    if (edit_dlg->state == DLG_CLOSED)
        destroy_dlg (edit_dlg);

    return 1;
}
开发者ID:artzub,项目名称:mc,代码行数:55,代码来源:editwidget.c


示例16: run_listbox

/** Returns the number of the item selected */
int
run_listbox (Listbox * l)
{
    int val = -1;

    if (run_dlg (l->dlg) != B_CANCEL)
        val = l->list->pos;
    destroy_dlg (l->dlg);
    g_free (l);
    return val;
}
开发者ID:Chainie,项目名称:mc,代码行数:12,代码来源:listbox-window.c


示例17: run_listbox

/* Returns the number of the item selected */
int run_listbox (Listbox *l)
{
    int val;
    
    run_dlg (l->dlg);
    if (l->dlg->ret_value == B_CANCEL)
	val = -1;
    else
	val = l->list->pos;
    destroy_dlg (l->dlg);
    g_free (l);
    return val;
}
开发者ID:ebichu,项目名称:dd-wrt,代码行数:14,代码来源:wtools.c


示例18: learn_button

static int
learn_button (WButton * button, int action)
{
    Dlg_head *d;
    char *seq;

    (void) button;

    d = create_message (D_ERROR, _("Teach me a key"),
                        _("Please press the %s\n"
                          "and then wait until this message disappears.\n\n"
                          "Then, press it again to see if OK appears\n"
                          "next to its button.\n\n"
                          "If you want to escape, press a single Escape key\n"
                          "and wait as well."), _(key_name_conv_tab[action - B_USER].longname));
    mc_refresh ();
    if (learnkeys[action - B_USER].sequence != NULL)
    {
        g_free (learnkeys[action - B_USER].sequence);
        learnkeys[action - B_USER].sequence = NULL;
    }
    seq = learn_key ();

    if (seq)
    {
        /* Esc hides the dialog and do not allow definitions of
         * regular characters
         */
        gboolean seq_ok = FALSE;

        if (*seq && strcmp (seq, "\\e") && strcmp (seq, "\\e\\e")
            && strcmp (seq, "^m") && strcmp (seq, "^i") && (seq[1] || (*seq < ' ' || *seq > '~')))
        {

            learnchanged = 1;
            learnkeys[action - B_USER].sequence = seq;
            seq = convert_controls (seq);
            seq_ok = define_sequence (key_name_conv_tab[action - B_USER].code, seq, MCKEY_NOACTION);
        }

        if (!seq_ok)
            message (D_NORMAL, _("Cannot accept this key"), _("You have entered \"%s\""), seq);

        g_free (seq);
    }

    dlg_run_done (d);
    destroy_dlg (d);
    dlg_select_widget (learnkeys[action - B_USER].button);
    return 0;                   /* Do not kill learn_dlg */
}
开发者ID:BrEacK,项目名称:mc,代码行数:51,代码来源:learn.c


示例19: file_progress_real_query_replace

FileProgressStatus
file_progress_real_query_replace (enum OperationMode mode, char *destname, struct stat *_s_stat,
				  struct stat *_d_stat)
{
    if (file_progress_replace_result < REPLACE_ALWAYS){
	file_progress_replace_filename = destname;
	s_stat = _s_stat;
	d_stat = _d_stat;
	init_replace (mode);
	run_dlg (replace_dlg);
	file_progress_replace_result = replace_dlg->ret_value;
	if (file_progress_replace_result == B_CANCEL)
	    file_progress_replace_result = REPLACE_ABORT;
	destroy_dlg (replace_dlg);
    }

    switch (file_progress_replace_result){
    case REPLACE_UPDATE:
	do_refresh ();
	if (_s_stat->st_mtime > _d_stat->st_mtime)
	    return FILE_CONT;
	else
	    return FILE_SKIP;

    case REPLACE_SIZE:
	do_refresh ();
	if (_s_stat->st_size == _d_stat->st_size)
	    return FILE_SKIP;
	else
	    return FILE_CONT;
	
    case REPLACE_REGET:
	/* Carefull: we fall through and set do_append */
	file_progress_do_reget = _d_stat->st_size;
	
    case REPLACE_APPEND:
        file_progress_do_append = 1;
	
    case REPLACE_YES:
    case REPLACE_ALWAYS:
	do_refresh ();
	return FILE_CONT;
    case REPLACE_NO:
    case REPLACE_NEVER:
	do_refresh ();
	return FILE_SKIP;
    case REPLACE_ABORT:
    default:
	return FILE_ABORT;
    }
}
开发者ID:OS2World,项目名称:UTIL-SHELL-Midnight_Commander,代码行数:51,代码来源:filegui.c


示例20: display_box

int
display_box (WPanel *panel, char **userp, char **minip, int *use_msformat, int num)
{
    int result, i;
    char *section = NULL;
    const char *p;

    if (!panel) {
        p = get_nth_panel_name (num);
        panel = g_new (WPanel, 1);
        panel->list_type = list_full;
        panel->user_format = g_strdup (DEFAULT_USER_FORMAT);
        panel->user_mini_status = 0;
	for (i = 0; i < LIST_TYPES; i++)
    	    panel->user_status_format[i] = g_strdup (DEFAULT_USER_FORMAT);
        section = g_strconcat ("Temporal:", p, (char *) NULL);
        if (!profile_has_section (section, profile_name)) {
            g_free (section);
            section = g_strdup (p);
        }
        panel_load_setup (panel, section);
        g_free (section);
    }

    current_mode = panel->list_type;
    display_init (current_mode, panel->user_format, 
	panel->user_mini_status, panel->user_status_format);
		  
    run_dlg (dd);

    result = -1;
    
    if (section) {
        g_free (panel->user_format);
	for (i = 0; i < LIST_TYPES; i++)
	   g_free (panel->user_status_format [i]);
        g_free (panel);
    }
    
    if (dd->ret_value != B_CANCEL){
	result = my_radio->sel;
	*userp = g_strdup (user->buffer);
	*minip = g_strdup (status->buffer);
	*use_msformat = check_status->state & C_BOOL;
    }
    destroy_dlg (dd);

    return result;
}
开发者ID:GalaxyTab4,项目名称:workbench,代码行数:49,代码来源:boxes.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ destroy_hrtimer_on_stack函数代码示例发布时间:2022-05-30
下一篇:
C++ destroy_dev函数代码示例发布时间: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