Index: trunk/src_plugins/asm/asm.c =================================================================== --- trunk/src_plugins/asm/asm.c (revision 21462) +++ trunk/src_plugins/asm/asm.c (revision 21463) @@ -489,6 +489,7 @@ group_t **g; part_t **p; long n, i; + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; if (asm_ctx.active) { PCB_ACT_IRES(0); @@ -570,6 +571,7 @@ PCB_DAD_HELP(asm_ctx.dlg, "Mark all parts in this group done,\ncontinue with the next group"); PCB_DAD_CHANGE_CB(asm_ctx.dlg, asm_done_group); PCB_DAD_END(asm_ctx.dlg); + PCB_DAD_BUTTON_CLOSES(asm_ctx.dlg, clbtn); PCB_DAD_END(asm_ctx.dlg); asm_ctx.active = 1; Index: trunk/src_plugins/ddraft/constraint_gui.c =================================================================== --- trunk/src_plugins/ddraft/constraint_gui.c (revision 21462) +++ trunk/src_plugins/ddraft/constraint_gui.c (revision 21463) @@ -199,9 +199,11 @@ int constraint_gui(void) { const char *tab_names[] = {"line", "move", NULL}; + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; if (cnstgui_ctx.active) return 0; /* do not open another */ + PCB_DAD_BEGIN_VBOX(cnstgui_ctx.dlg); PCB_DAD_BEGIN_TABBED(cnstgui_ctx.dlg, tab_names); /* line */ @@ -315,6 +317,8 @@ PCB_DAD_END(cnstgui_ctx.dlg); PCB_DAD_END(cnstgui_ctx.dlg); + PCB_DAD_BUTTON_CLOSES(cnstgui_ctx.dlg, clbtn); + PCB_DAD_END(cnstgui_ctx.dlg); /* set up the context */ cnstgui_ctx.active = 1; Index: trunk/src_plugins/dialogs/TEMPLATE.c =================================================================== --- trunk/src_plugins/dialogs/TEMPLATE.c (revision 21462) +++ trunk/src_plugins/dialogs/TEMPLATE.c (revision 21463) @@ -70,11 +70,13 @@ static void pcb_dlg_foo(whatever args) <<<- edit this { + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; if (foo_ctx.active) return; /* do not open another */ PCB_DAD_BEGIN_VBOX(foo_ctx.dlg); PCB_DAD_LABEL(foo_ctx.dlg, "foo"); + PCB_DAD_BUTTON_CLOSES(dlg, clbtn); PCB_DAD_END(foo_ctx.dlg); /* set up the context */ Index: trunk/src_plugins/dialogs/TEMPLATE_MODAL.c =================================================================== --- trunk/src_plugins/dialogs/TEMPLATE_MODAL.c (revision 21462) +++ trunk/src_plugins/dialogs/TEMPLATE_MODAL.c (revision 21463) @@ -52,10 +52,12 @@ static void pcb_dlg_foo(whatever args) <<<- edit this { foo_ctx_t ctx; + pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; PCB_DAD_DECL(dlg); PCB_DAD_BEGIN_VBOX(dlg); PCB_DAD_LABEL(dlg, "foo"); + PCB_DAD_BUTTON_CLOSES(dlg, clbtn); PCB_DAD_END(dlg); /* set up the context */ Index: trunk/src_plugins/dialogs/dlg_about.c =================================================================== --- trunk/src_plugins/dialogs/dlg_about.c (revision 21462) +++ trunk/src_plugins/dialogs/dlg_about.c (revision 21463) @@ -46,6 +46,7 @@ static void pcb_dlg_about(void) { const char *tabs[] = { "About pcb-rnd", "Options", "Paths", "License", NULL }; + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; htsp_entry_t *e; gds_t s; @@ -52,6 +53,7 @@ if (about_ctx.active) return; + PCB_DAD_BEGIN_VBOX(about_ctx.dlg); PCB_DAD_BEGIN_TABBED(about_ctx.dlg, tabs); PCB_DAD_BEGIN_VBOX(about_ctx.dlg); PCB_DAD_LABEL(about_ctx.dlg, pcb_get_info_program()); @@ -87,6 +89,8 @@ PCB_DAD_END(about_ctx.dlg); PCB_DAD_END(about_ctx.dlg); + PCB_DAD_BUTTON_CLOSES(about_ctx.dlg, clbtn); + PCB_DAD_END(about_ctx.dlg); /* set up the context */ about_ctx.active = 1; Index: trunk/src_plugins/dialogs/dlg_comm_m.c =================================================================== --- trunk/src_plugins/dialogs/dlg_comm_m.c (revision 21462) +++ trunk/src_plugins/dialogs/dlg_comm_m.c (revision 21463) @@ -34,6 +34,7 @@ const char *label, *default_str = "", *title = "pcb-rnd user input"; const char *pcb_acts_gui_PromptFor = nope; int ws; + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; PCB_DAD_DECL(dlg); PCB_ACT_CONVARG(1, FGW_STR, gui_PromptFor, label = argv[1].val.str); @@ -45,6 +46,7 @@ PCB_DAD_STRING(dlg); ws = PCB_DAD_CURRENT(dlg); dlg[ws].default_val.str_value = pcb_strdup(default_str); + PCB_DAD_BUTTON_CLOSES(dlg, clbtn); PCB_DAD_END(dlg); PCB_DAD_NEW(dlg, title, NULL, pcb_true, NULL); Index: trunk/src_plugins/dialogs/dlg_export.c =================================================================== --- trunk/src_plugins/dialogs/dlg_export.c (revision 21462) +++ trunk/src_plugins/dialogs/dlg_export.c (revision 21463) @@ -111,6 +111,7 @@ { pcb_hid_t **hids; int n, i; + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; if (export_ctx.active) return; /* do not open another */ @@ -144,6 +145,7 @@ export_ctx.tab_name[i] = NULL; + PCB_DAD_BEGIN_VBOX(export_ctx.dlg); PCB_DAD_BEGIN_TABBED(export_ctx.dlg, export_ctx.tab_name); PCB_DAD_COMPFLAG(export_ctx.dlg, PCB_HATF_LEFT_TAB); export_ctx.tabs = PCB_DAD_CURRENT(export_ctx.dlg); @@ -173,6 +175,8 @@ PCB_DAD_END(export_ctx.dlg); } PCB_DAD_END(export_ctx.dlg); + PCB_DAD_BUTTON_CLOSES(export_ctx.dlg, clbtn); + PCB_DAD_END(export_ctx.dlg); /* set up the context */ export_ctx.active = 1; Index: trunk/src_plugins/dialogs/dlg_flag_edit.c =================================================================== --- trunk/src_plugins/dialogs/dlg_flag_edit.c (revision 21462) +++ trunk/src_plugins/dialogs/dlg_flag_edit.c (revision 21463) @@ -81,6 +81,7 @@ fe_ctx_t ctx; pcb_hid_attr_val_t val; int type; + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; memset(&ctx, 0, sizeof(ctx)); @@ -129,6 +130,7 @@ ctx.len++; } } + PCB_DAD_BUTTON_CLOSES(dlg, clbtn); PCB_DAD_END(dlg); ctx.attrs = dlg; Index: trunk/src_plugins/dialogs/dlg_fontsel.c =================================================================== --- trunk/src_plugins/dialogs/dlg_fontsel.c (revision 21462) +++ trunk/src_plugins/dialogs/dlg_fontsel.c (revision 21463) @@ -103,6 +103,7 @@ static void pcb_dlg_foo(pcb_board_t *pcb) { pcb_box_t vbox = {0, 0, PCB_MM_TO_COORD(55), PCB_MM_TO_COORD(55)}; + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; if (fontsel_ctx.active) return; /* do not open another */ @@ -123,6 +124,7 @@ PCB_DAD_CHANGE_CB(fontsel_ctx.dlg, btn_remove_cb); PCB_DAD_HELP(fontsel_ctx.dlg, "Remove currently selected font"); PCB_DAD_END(fontsel_ctx.dlg); + PCB_DAD_BUTTON_CLOSES(fontsel_ctx.dlg, clbtn); PCB_DAD_END(fontsel_ctx.dlg); fontsel_ctx.active = 1; Index: trunk/src_plugins/dialogs/dlg_layer_binding.c =================================================================== --- trunk/src_plugins/dialogs/dlg_layer_binding.c (revision 21462) +++ trunk/src_plugins/dialogs/dlg_layer_binding.c (revision 21463) @@ -269,7 +269,7 @@ { /* interactive mode */ int n; - + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; PCB_DAD_DECL(dlg); ctx.pcb = PCB; @@ -286,6 +286,7 @@ if (pcb_layergrp_flags(PCB, n) & PCB_LYT_COPPER) num_copper++; + PCB_DAD_BEGIN_VBOX(dlg); PCB_DAD_BEGIN_TABLE(dlg, 2); PCB_DAD_COMPFLAG(dlg, PCB_HATF_SCROLL); for(n = 0; n < ctx.data->LayerN; n++) { @@ -341,6 +342,8 @@ PCB_DAD_END(dlg); } PCB_DAD_END(dlg); + PCB_DAD_BUTTON_CLOSES(dlg, clbtn); + PCB_DAD_END(dlg); ctx.attrs = dlg; Index: trunk/src_plugins/dialogs/dlg_lib_pstk.c =================================================================== --- trunk/src_plugins/dialogs/dlg_lib_pstk.c (revision 21462) +++ trunk/src_plugins/dialogs/dlg_lib_pstk.c (revision 21463) @@ -455,6 +455,8 @@ pstk_lib_ctx_t *ctx; int n; char *name; + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + pcb_hid_dad_buttons_t clbtn_modal[] = {{"Cancel", -1}, {"Use selected", 0}, {NULL, 0}}; if (subc_id <= 0) subc_id = -1; @@ -558,6 +560,7 @@ PCB_DAD_END(ctx->dlg); PCB_DAD_END(ctx->dlg); + PCB_DAD_BUTTON_CLOSES(ctx->dlg, (modal ? clbtn_modal : clbtn)); PCB_DAD_END(ctx->dlg); if (subc_id > 0) { Index: trunk/src_plugins/dialogs/dlg_padstack.c =================================================================== --- trunk/src_plugins/dialogs/dlg_padstack.c (revision 21462) +++ trunk/src_plugins/dialogs/dlg_padstack.c (revision 21463) @@ -511,6 +511,7 @@ int n; char tmp[256]; const char *copy_from_names[pcb_proto_num_layers+1]; + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; PCB_DAD_DECL(dlg); pse->parent_hid_ctx = hid_ctx; @@ -567,6 +568,7 @@ PCB_DAD_CHANGE_CB(dlg, pse_shape_grow); PCB_DAD_HELP(dlg, "Make the shape larger by the selected amount"); PCB_DAD_END(dlg); + PCB_DAD_BUTTON_CLOSES(dlg, clbtn); PCB_DAD_END(dlg); PCB_DAD_NEW(dlg, "Edit padstack shape", pse, pcb_true, NULL); @@ -675,11 +677,13 @@ { int n; const char *tabs[] = { "this instance", "prototype", "generate common geometry", NULL }; + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; PCB_DAD_DECL(dlg); pse->disable_instance_tab = !!pse->disable_instance_tab; target_tab -= pse->disable_instance_tab; + PCB_DAD_BEGIN_VBOX(dlg); PCB_DAD_BEGIN_TABBED(dlg, tabs + pse->disable_instance_tab); pse->tab = PCB_DAD_CURRENT(dlg); @@ -849,6 +853,8 @@ PCB_DAD_END(dlg); PCB_DAD_END(dlg); PCB_DAD_END(dlg); + PCB_DAD_BUTTON_CLOSES(dlg, clbtn); + PCB_DAD_END(dlg); PCB_DAD_NEW(dlg, "Edit padstack", pse, pcb_true, NULL); pse->attrs = dlg; Index: trunk/src_plugins/dialogs/dlg_pinout.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pinout.c (revision 21462) +++ trunk/src_plugins/dialogs/dlg_pinout.c (revision 21463) @@ -136,6 +136,7 @@ static void pcb_dlg_pinout(pcb_board_t *pcb, pcb_data_t *data, pcb_subc_t *sc) { char title[64]; + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; pinout_ctx_t *ctx = calloc(sizeof(pinout_ctx_t), 1); ctx->pcb = pcb; @@ -158,6 +159,7 @@ PCB_DAD_LABEL(ctx->dlg, ""); ctx->w_lab_net = PCB_DAD_CURRENT(ctx->dlg); PCB_DAD_END(ctx->dlg); + PCB_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); PCB_DAD_END(ctx->dlg); if (sc->refdes != NULL) Index: trunk/src_plugins/dialogs/dlg_plugins.c =================================================================== --- trunk/src_plugins/dialogs/dlg_plugins.c (revision 21462) +++ trunk/src_plugins/dialogs/dlg_plugins.c (revision 21463) @@ -31,6 +31,7 @@ pup_plugin_t *p; int nump = 0, numb = 0; gds_t str; + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; PCB_DAD_DECL(dlg); gds_init(&str); @@ -75,6 +76,7 @@ PCB_DAD_BEGIN_VBOX(dlg); PCB_DAD_COMPFLAG(dlg, PCB_HATF_SCROLL | PCB_HATF_EXPFILL); PCB_DAD_LABEL(dlg, str.array); + PCB_DAD_BUTTON_CLOSES(dlg, clbtn); PCB_DAD_END(dlg); PCB_DAD_NEW(dlg, "Manage plugins", NULL, pcb_true, NULL); Index: trunk/src_plugins/dialogs/dlg_pref.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref.c (revision 21462) +++ trunk/src_plugins/dialogs/dlg_pref.c (revision 21463) @@ -219,6 +219,7 @@ static void pcb_dlg_pref(const char *target_tab_str) { const char *tabs[] = { "General", "Board meta", "Sizes & DRC", "Library", "Layers", "Colors", "Window", "Config tree", NULL }; + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; int target_tab = -1; if ((target_tab_str != NULL) && (*target_tab_str != '\0')) { @@ -239,6 +240,7 @@ return; } + PCB_DAD_BEGIN_VBOX(pref_ctx.dlg); PCB_DAD_BEGIN_TABBED(pref_ctx.dlg, tabs); pref_ctx.wtab = PCB_DAD_CURRENT(pref_ctx.dlg); PCB_DAD_BEGIN_VBOX(pref_ctx.dlg); /* General */ @@ -274,6 +276,8 @@ PCB_DAD_END(pref_ctx.dlg); PCB_DAD_END(pref_ctx.dlg); + PCB_DAD_BUTTON_CLOSES(pref_ctx.dlg, clbtn); + PCB_DAD_END(pref_ctx.dlg); /* set up the context */ pref_ctx.active = 1; Index: trunk/src_plugins/dialogs/dlg_pref_lib.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_lib.c (revision 21462) +++ trunk/src_plugins/dialogs/dlg_pref_lib.c (revision 21463) @@ -239,9 +239,11 @@ static int lib_cell_edit(char **cell) { cell_edit_ctx_t ctx; + pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; memset(&ctx, 0, sizeof(ctx)); + PCB_DAD_BEGIN_VBOX(ctx.dlg); PCB_DAD_BEGIN_TABLE(ctx.dlg, 2); PCB_DAD_LABEL(ctx.dlg, "Path:"); PCB_DAD_STRING(ctx.dlg); @@ -257,6 +259,8 @@ PCB_DAD_BUTTON(ctx.dlg, "Help..."); PCB_DAD_CHANGE_CB(ctx.dlg, libhelp_btn); PCB_DAD_END(ctx.dlg); + PCB_DAD_BUTTON_CLOSES(ctx.dlg, clbtn); + PCB_DAD_END(ctx.dlg); PCB_DAD_NEW(ctx.dlg, "Edit library path", &ctx, pcb_true, NULL); if (PCB_DAD_RUN(ctx.dlg) != 0) { @@ -341,6 +345,7 @@ static void pref_libhelp_open(pref_libhelp_ctx_t *ctx) { htsp_entry_t *e; + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; PCB_DAD_LABEL(ctx->dlg, "The following $(variables) can be used in the path:"); PCB_DAD_BEGIN_TABLE(ctx->dlg, 2); @@ -355,6 +360,7 @@ PCB_DAD_LABEL(ctx->dlg, tmp); PCB_DAD_LABEL(ctx->dlg, nat->val.string[0]); } + PCB_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); PCB_DAD_END(ctx->dlg); ctx->active = 1; Index: trunk/src_plugins/dialogs/dlg_test.c =================================================================== --- trunk/src_plugins/dialogs/dlg_test.c (revision 21462) +++ trunk/src_plugins/dialogs/dlg_test.c (revision 21463) @@ -80,6 +80,7 @@ char *row2b[] = {"under_two", "ut", "uuut", NULL}; char *row3[] = {"three", "baz", "BAZ", NULL}; const char *hdr[] = {"num", "data1", "data2", NULL}; + pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; pcb_hid_row_t *row; int failed; @@ -86,6 +87,7 @@ test_t ctx; memset(&ctx, 0, sizeof(ctx)); + PCB_DAD_BEGIN_VBOX(ctx.dlg); PCB_DAD_BEGIN_TABBED(ctx.dlg, tabs); PCB_DAD_CHANGE_CB(ctx.dlg, cb_tab_chg); ctx.wtab = PCB_DAD_CURRENT(ctx.dlg); @@ -181,6 +183,8 @@ PCB_DAD_LABEL(ctx.dlg, "This is a cool preview widget."); PCB_DAD_END(ctx.dlg); PCB_DAD_END(ctx.dlg); + PCB_DAD_BUTTON_CLOSES(ctx.dlg, clbtn); + PCB_DAD_END(ctx.dlg); PCB_DAD_AUTORUN(ctx.dlg, "dlg_test", "attribute dialog test", &ctx, failed); Index: trunk/src_plugins/dialogs/dlg_undo.c =================================================================== --- trunk/src_plugins/dialogs/dlg_undo.c (revision 21462) +++ trunk/src_plugins/dialogs/dlg_undo.c (revision 21463) @@ -119,6 +119,8 @@ static void pcb_dlg_undo(void) { static const char *hdr[] = {"serial", "flg", "operation", NULL}; + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + if (undo_ctx.active) return; /* do not open another */ @@ -136,6 +138,7 @@ PCB_DAD_BUTTON(undo_ctx.dlg, "Clear"); PCB_DAD_CHANGE_CB(undo_ctx.dlg, cb_clear); PCB_DAD_END(undo_ctx.dlg); + PCB_DAD_BUTTON_CLOSES(undo_ctx.dlg, clbtn); PCB_DAD_END(undo_ctx.dlg); /* set up the context */ Index: trunk/src_plugins/export_openems/mesh.c =================================================================== --- trunk/src_plugins/export_openems/mesh.c (revision 21462) +++ trunk/src_plugins/export_openems/mesh.c (revision 21463) @@ -722,6 +722,7 @@ int pcb_mesh_interactive(void) { int n; + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; PCB_DAD_BEGIN_VBOX(ia.dlg); PCB_DAD_BEGIN_HBOX(ia.dlg); @@ -871,7 +872,7 @@ PCB_DAD_CHANGE_CB(ia.dlg, ia_gen_cb); PCB_DAD_END(ia.dlg); PCB_DAD_END(ia.dlg); - + PCB_DAD_BUTTON_CLOSES(ia.dlg, clbtn); PCB_DAD_END(ia.dlg); PCB_DAD_NEW(ia.dlg, "mesher", &ia, 0, ia_close_cb); Index: trunk/src_plugins/extedit/extedit_dad.c =================================================================== --- trunk/src_plugins/extedit/extedit_dad.c (revision 21462) +++ trunk/src_plugins/extedit/extedit_dad.c (revision 21463) @@ -89,6 +89,7 @@ char tmp[256]; const char *names[NUM_METHODS+1]; int n, res; + pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"Edit!", 0}, {NULL, 0}}; for(n = 0; n < NUM_METHODS; n++) names[n] = methods[n].name; @@ -119,6 +120,7 @@ ee.wcmd = PCB_DAD_CURRENT(ee.dlg); PCB_DAD_CHANGE_CB(ee.dlg, ee_chg_cmd); PCB_DAD_END(ee.dlg); + PCB_DAD_BUTTON_CLOSES(ee.dlg, clbtn); PCB_DAD_END(ee.dlg); PCB_DAD_NEW(ee.dlg, "External editor", &ee, pcb_true, NULL); Index: trunk/src_plugins/hid_lesstif/dialogs.c =================================================================== --- trunk/src_plugins/hid_lesstif/dialogs.c (revision 21462) +++ trunk/src_plugins/hid_lesstif/dialogs.c (revision 21463) @@ -436,8 +436,11 @@ } XtUnmanageChild(XmMessageBoxGetChild(dialog, XmDIALOG_SYMBOL_LABEL)); + XtUnmanageChild(XmMessageBoxGetChild(dialog, XmDIALOG_SEPARATOR)); XtUnmanageChild(XmMessageBoxGetChild(dialog, XmDIALOG_MESSAGE_LABEL)); XtUnmanageChild(XmMessageBoxGetChild(dialog, XmDIALOG_HELP_BUTTON)); + XtUnmanageChild(XmMessageBoxGetChild(dialog, XmDIALOG_CANCEL_BUTTON)); + XtUnmanageChild(XmMessageBoxGetChild(dialog, XmDIALOG_OK_BUTTON)); XtAddCallback(dialog, XmNcancelCallback, (XtCallbackProc) dialog_callback_cancel, cb_ctx); if (ok) XtAddCallback(dialog, XmNokCallback, (XtCallbackProc) dialog_callback_ok, cb_ctx); Index: trunk/src_plugins/lib_gtk_common/dlg_attribute.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_attribute.c (revision 21462) +++ trunk/src_plugins/lib_gtk_common/dlg_attribute.c (revision 21463) @@ -746,8 +746,7 @@ ctx->dialog = gtk_dialog_new_with_buttons(_(title), GTK_WINDOW(com->top_window), (GtkDialogFlags) ((modal?GTK_DIALOG_MODAL:0) - | GTK_DIALOG_DESTROY_WITH_PARENT), - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); + | GTK_DIALOG_DESTROY_WITH_PARENT), NULL); gtk_window_set_role(GTK_WINDOW(ctx->dialog), "PCB_attribute_editor"); content_area = gtk_dialog_get_content_area(GTK_DIALOG(ctx->dialog)); Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 21462) +++ trunk/src_plugins/report/report.c (revision 21463) @@ -89,9 +89,11 @@ static void rdialog(const char *name, const char *content) { rdialog_ctx_t *ctx = calloc(sizeof(rdialog_ctx_t), 1); + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; PCB_DAD_BEGIN_VBOX(ctx->dlg); PCB_DAD_LABEL(ctx->dlg, content); + PCB_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); PCB_DAD_END(ctx->dlg); PCB_DAD_NEW(ctx->dlg, name, ctx, pcb_false, rdialog_close_cb); Index: trunk/src_plugins/script/script_act.c =================================================================== --- trunk/src_plugins/script/script_act.c (revision 21462) +++ trunk/src_plugins/script/script_act.c (revision 21463) @@ -160,6 +160,7 @@ script_dlg_t *ctx = caller_data; int failed; char *tmp, *fn = pcb_gui->fileselect("script to load", "Select a script file to load", NULL, NULL, "script", HID_FILESELECT_READ); + pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; typedef struct { PCB_DAD_DECL_NOINIT(dlg) int wid, wlang; @@ -192,6 +193,7 @@ if (tmp != NULL) idlang.dlg[idlang.wlang].default_val.str_value = pcb_strdup(tmp+1); PCB_DAD_END(idlang.dlg); + PCB_DAD_BUTTON_CLOSES(idlang.dlg, clbtn); PCB_DAD_END(idlang.dlg); @@ -206,9 +208,11 @@ static void script_dlg_open(void) { static const char *hdr[] = {"ID", "language", "file", NULL}; + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; if (script_dlg.active) return; /* do not open another */ + PCB_DAD_BEGIN_VBOX(script_dlg.dlg); PCB_DAD_BEGIN_HPANE(script_dlg.dlg); PCB_DAD_COMPFLAG(script_dlg.dlg, PCB_HATF_EXPFILL); /* left side */ @@ -240,6 +244,8 @@ script_dlg.walist = PCB_DAD_CURRENT(script_dlg.dlg); PCB_DAD_END(script_dlg.dlg); PCB_DAD_END(script_dlg.dlg); + PCB_DAD_BUTTON_CLOSES(script_dlg.dlg, clbtn); + PCB_DAD_END(script_dlg.dlg); /* set up the context */ script_dlg.active = 1; Index: trunk/src_plugins/shape/shape_dialog.c =================================================================== --- trunk/src_plugins/shape/shape_dialog.c (revision 21462) +++ trunk/src_plugins/shape/shape_dialog.c (revision 21463) @@ -133,11 +133,13 @@ pcb_coord_t mm2 = PCB_MM_TO_COORD(2); pcb_coord_t maxr = PCB_MM_TO_COORD(1000); const char *tabs[] = {"Regular polygon", "Round rectangle", "Filled circle", NULL}; + pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; shp->pcb = pcb; shp->data = data; shp->layer = layer; + PCB_DAD_BEGIN_VBOX(shp->dlg); PCB_DAD_BEGIN_TABBED(shp->dlg, tabs); /* shp->tab = PCB_DAD_CURRENT(shp->dlg); PCB_DAD_CHANGE_CB(shp->dlg, shp_tab);*/ @@ -337,6 +339,8 @@ PCB_DAD_END(shp->dlg); PCB_DAD_END(shp->dlg); PCB_DAD_END(shp->dlg); + PCB_DAD_BUTTON_CLOSES(shp->dlg, clbtn); + PCB_DAD_END(shp->dlg); PCB_DAD_NEW(shp->dlg, "dlg_shape", shp, modal, shp_close_cb); PCB_DAD_SET_VALUE(shp->dlg_hid_ctx, shp->dia, coord_value, PCB_MM_TO_COORD(25.4)); /* suppress a runtime warning on invalid dia (zero) */