~ubuntu-branches/ubuntu/natty/bluefish/natty-proposed

« back to all changes in this revision

Viewing changes to src/html_table.c

  • Committer: Bazaar Package Importer
  • Author(s): Davide Puricelli (evo)
  • Date: 2005-04-23 17:05:18 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050423170518-pb8zi3vg32cm6g04
Tags: 1.0-1
* Acknowledge NMU, thanks Leo; closes: #291222.
* Updated debian/ files, thanks Daniel Leidert. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 * along with this program; if not, write to the Free Software
20
20
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21
21
 */
22
 
#include "default_include.h"
23
22
 
 
23
#include <gtk/gtk.h>
24
24
#include <string.h>
25
25
 
26
26
#include "cap.h"  /* cap() */
27
27
#include "bluefish.h"
28
 
#include "coloursel.h" /* colorbut_new() */
 
28
/*#include "coloursel.h"*/ /* colorbut_new() */
29
29
#include "html_diag.h"
30
30
#include "html_table.h"
31
31
#include "html2.h" /* style_but_new */
32
 
#include "init.h"       /* positionlist */
 
32
/*#include "init.h"*/   /* positionlist */
33
33
#include "gtk_easy.h"
34
 
/* #include "undo.h" */
35
34
#include "document.h"
36
35
#include "stringlist.h"
37
36
 
48
47
        thestring = insert_string_if_entry(GTK_WIDGET(GTK_ENTRY(GTK_COMBO(dg->combo[1])->entry)), cap("ALIGN"), thestring, NULL);
49
48
        thestring = insert_string_if_entry(GTK_WIDGET(GTK_ENTRY(GTK_COMBO(dg->combo[2])->entry)), cap("VALIGN"), thestring, NULL);
50
49
        thestring = insert_string_if_entry(GTK_WIDGET(GTK_ENTRY(GTK_COMBO(dg->combo[3])->entry)), cap("BGCOLOR"), thestring, NULL);
51
 
        thestring = insert_integer_if_spin(dg->spin[2], cap("WIDTH"), thestring, dg->check[1]);
 
50
        thestring = insert_integer_if_spin(dg->spin[2], cap("WIDTH"), thestring, GTK_TOGGLE_BUTTON(dg->check[1])->active, 0);
52
51
        thestring = insert_string_if_entry(GTK_WIDGET(GTK_ENTRY(GTK_COMBO(dg->combo[4])->entry)), cap("CLASS"), thestring, NULL);
53
52
        thestring = insert_string_if_entry(GTK_WIDGET(GTK_ENTRY(dg->entry[2])), cap("STYLE"), thestring, NULL);
54
53
        thestring = insert_string_if_entry(GTK_WIDGET(GTK_ENTRY(GTK_COMBO(dg->combo[5])->entry)), cap("frame"), thestring, NULL);
57
56
        finalstring = g_strconcat(thestring, ">", NULL);
58
57
        g_free(thestring);
59
58
 
60
 
        if (dg->range.len == -1) {
61
 
                doc_insert_dbl_text(dg->doc, finalstring, cap("</TABLE>"));
 
59
        if (dg->range.end == -1) {
 
60
                doc_insert_two_strings(dg->doc, finalstring, cap("</TABLE>"));
62
61
        } else {
63
 
                replace_text(finalstring, dg->range.pos, dg->range.len);
 
62
                doc_replace_text(dg->doc, finalstring, dg->range.pos, dg->range.end);
64
63
        }
65
64
 
66
65
        g_free(finalstring);
67
 
        html_diag_destroy_cb(NULL, NULL, dg);
 
66
        html_diag_destroy_cb(NULL, dg);
68
67
}
69
68
 
70
69
 
71
 
void tabledialog_cb(GtkWidget * widget, gpointer data)
72
 
{
 
70
void tabledialog_dialog(Tbfwin *bfwin, Ttagpopup *data) {
73
71
        GList *alignlist = NULL, *popuplist;
74
72
        GtkWidget *var_but, *dgtable;
75
73
 
80
78
        gchar *custom = NULL;
81
79
        Thtml_diag *dg;
82
80
 
83
 
        dg = html_diag_new(_("Table"));
84
 
        fill_dialogvalues(tagitems, tagvalues, &custom, (Ttagpopup *) data, widget, dg);
 
81
        dg = html_diag_new(bfwin,_("Table"));
 
82
        fill_dialogvalues(tagitems, tagvalues, &custom, (Ttagpopup *) data, dg);
85
83
 
86
84
        dgtable = html_diag_table_in_vbox(dg, 5, 8);
87
85
 
88
86
        dg->spin[1] = spinbut_with_value(tagvalues[0], 0, 100, 1.0, 5.0);
89
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Cell Padding")), 0, 1, 0, 1);
 
87
        bf_mnemonic_label_tad_with_alignment(_("Cell _Padding:"), dg->spin[1], 0, 0.5, dgtable, 0, 1, 0, 1);
90
88
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->spin[1], 1, 2, 0, 1);
91
89
 
92
90
        dg->spin[3] = spinbut_with_value(tagvalues[1], 0, 100, 1.0, 5.0);
93
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Cell Spacing")), 0, 1, 1, 2);
 
91
        bf_mnemonic_label_tad_with_alignment(_("C_ell Spacing:"), dg->spin[3], 0, 0.5, dgtable, 0, 1, 1, 2);
94
92
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->spin[3], 1, 2, 1, 2);
95
93
 
96
 
        dg->combo[4] = combo_with_popdown_sized(tagvalues[7], main_v->current_project.classlist, 1, 80);
97
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Class")), 0, 1, 2, 3);
 
94
        dg->combo[4] = combo_with_popdown_sized(tagvalues[7], bfwin->session->classlist, 1, 80);
 
95
        bf_mnemonic_label_tad_with_alignment(_("Cl_ass:"), dg->combo[4], 0, 0.5, dgtable, 0, 1, 2, 3);
98
96
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->combo[4], 1, 2, 2, 3);
99
97
 
100
98
        dg->entry[2] = entry_with_text(tagvalues[8], 1024);
101
99
        var_but = style_but_new(dg->entry[2], dg->dialog);
102
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Style")), 0, 1, 3, 4);
 
100
        bf_mnemonic_label_tad_with_alignment(_("St_yle:"), dg->entry[2], 0, 0.5, dgtable, 0, 1, 3, 4);
103
101
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->entry[2], 1, 4, 3, 4);
104
102
        gtk_table_attach_defaults(GTK_TABLE(dgtable), var_but, 4, 5, 3, 4);
105
103
 
106
104
        dg->entry[1] = entry_with_text(custom, 1024);
107
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Custom")), 0, 1, 4, 5);
 
105
        bf_mnemonic_label_tad_with_alignment(_("Custo_m:"), dg->entry[1], 0, 0.5, dgtable, 0, 1, 4, 5);
108
106
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->entry[1], 1, 5, 4, 5);
109
107
 
110
108
        alignlist = g_list_append(alignlist, "left");
112
110
        alignlist = g_list_append(alignlist, "center");
113
111
        dg->combo[1] = combo_with_popdown_sized(tagvalues[3], alignlist, 0, 80);
114
112
        g_list_free(alignlist);
115
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Align")), 2, 3, 0, 1);
 
113
        bf_mnemonic_label_tad_with_alignment(_("Ali_gn:"), dg->combo[1], 1, 0.5, dgtable, 2, 3, 0, 1);
116
114
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->combo[1], 3, 5, 0, 1);
117
115
 
118
116
  alignlist = NULL;
126
124
        dg->combo[2] = combo_with_popdown_sized(tagvalues[4], alignlist, 1, 80);
127
125
        g_list_free(alignlist);
128
126
 
129
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Vertical Align")), 2, 3, 1, 2);
 
127
        bf_mnemonic_label_tad_with_alignment(_("_Valign:"), dg->combo[2], 1, 0.5, dgtable, 2, 3, 1, 2);
130
128
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->combo[2], 3, 5, 1, 2);
131
129
 
132
 
        dg->combo[3] = combo_with_popdown_sized(tagvalues[5], main_v->current_project.colorlist, 1, 80);
 
130
        dg->combo[3] = combo_with_popdown_sized(tagvalues[5], bfwin->session->colorlist, 1, 80);
133
131
        var_but = color_but_new(GTK_COMBO(dg->combo[3])->entry, dg->dialog);
134
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Background Color")), 2, 3, 2, 3);
 
132
        bf_mnemonic_label_tad_with_alignment(_("Backgrou_nd Color:"), dg->combo[3], 0, 0.5, dgtable, 2, 3, 2, 3);
135
133
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->combo[3], 3, 4, 2, 3);
136
134
        gtk_table_attach_defaults(GTK_TABLE(dgtable), var_but, 4, 5, 2, 3);
137
135
 
138
136
        dg->spin[2] = spinbut_with_value(NULL, 0, 900, 1.0, 5.0);
139
137
        dg->check[1] = gtk_check_button_new_with_label("%");
140
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_(" Width ")), 5, 6, 0, 1);
 
138
        bf_mnemonic_label_tad_with_alignment(_("_Width:"), dg->spin[2], 0, 0.5, dgtable, 5, 6, 0, 1);
141
139
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->spin[2], 6, 7, 0, 1);
142
140
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->check[1], 7, 8, 0, 1);
143
141
        parse_integer_for_dialog(tagvalues[6], dg->spin[2], NULL, dg->check[1]);
144
142
 
145
143
        dg->spin[4] = spinbut_with_value(tagvalues[2], 0, 100, 1.0, 5.0);
146
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Border")), 5, 6, 1, 2);
 
144
        bf_mnemonic_label_tad_with_alignment(_("Bo_rder:"), dg->spin[4], 0, 0.5, dgtable, 5, 6, 1, 2);
147
145
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->spin[4], 6, 8, 1, 2);
148
146
 
149
147
        popuplist = g_list_append(NULL, "");
157
155
        popuplist = g_list_append(popuplist, "box");
158
156
        popuplist = g_list_append(popuplist, "border");
159
157
        dg->combo[5] = combo_with_popdown_sized(tagvalues[10], popuplist, 0, 80);
160
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Frame")), 5, 6, 2, 3);
 
158
        bf_mnemonic_label_tad_with_alignment(_("_Frame:"), dg->combo[5], 0, 0.5, dgtable, 5, 6, 2, 3);
161
159
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->combo[5], 6, 8, 2, 3);
162
160
        g_list_free(popuplist);
163
161
 
168
166
        popuplist = g_list_append(popuplist, "cols");
169
167
        popuplist = g_list_append(popuplist, "all");
170
168
        dg->combo[6] = combo_with_popdown_sized(tagvalues[9], popuplist, 0, 80);
171
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Rules")), 5, 6, 3, 4);
 
169
        bf_mnemonic_label_tad_with_alignment(_("R_ules:"), dg->combo[6], 0, 0.5, dgtable, 5, 6, 3, 4);
172
170
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->combo[6], 6, 8, 3, 4);
173
171
        g_list_free(popuplist);
174
172
 
175
 
        html_diag_finish(dg, tabledialogok_lcb);
 
173
        html_diag_finish(dg, G_CALLBACK(tabledialogok_lcb));
176
174
        
177
175
        if (custom)     g_free(custom);
178
176
}
192
190
        finalstring = g_strconcat(thestring, ">", NULL);
193
191
        g_free(thestring);
194
192
 
195
 
        if (dg->range.len == -1) {
196
 
                doc_insert_dbl_text(dg->doc, finalstring, cap("</TR>"));
 
193
        if (dg->range.end == -1) {
 
194
                doc_insert_two_strings(dg->doc, finalstring, cap("</TR>"));
197
195
        } else {
198
 
                replace_text(finalstring, dg->range.pos, dg->range.len);
 
196
                doc_replace_text(dg->doc, finalstring, dg->range.pos, dg->range.end);
199
197
        }
200
198
        g_free(finalstring);
201
 
        html_diag_destroy_cb(NULL, NULL, dg);
 
199
        html_diag_destroy_cb(NULL, dg);
202
200
}
203
201
 
204
202
 
205
 
void tablerowdialog_cb(GtkWidget * widget, gpointer data)
206
 
{
 
203
void tablerowdialog_dialog(Tbfwin *bfwin, Ttagpopup *data) {
207
204
        GList *alignlist = NULL;
208
205
        GtkWidget *color_but, *var_but;
209
206
 
213
210
        Thtml_diag *dg;
214
211
        GtkWidget *dgtable;
215
212
 
216
 
        dg = html_diag_new(_("Table Row"));
217
 
        fill_dialogvalues(tagitems, tagvalues, &custom, (Ttagpopup *) data, widget, dg);
 
213
        dg = html_diag_new(bfwin,_("Table Row"));
 
214
        fill_dialogvalues(tagitems, tagvalues, &custom, (Ttagpopup *) data, dg);
218
215
 
219
216
        dgtable = html_diag_table_in_vbox(dg, 4, 5);
220
217
 
223
220
        alignlist = g_list_insert(alignlist, "center", 2);
224
221
        dg->combo[1] = combo_with_popdown_sized(tagvalues[0], alignlist, 0, 90);
225
222
        g_list_free(alignlist);
226
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Align")), 0, 1, 0, 1);
 
223
        bf_mnemonic_label_tad_with_alignment(_("Ali_gn:"), dg->combo[1], 0, 0.5, dgtable, 0, 1, 0, 1);
227
224
        gtk_table_attach_defaults(GTK_TABLE(dgtable), GTK_WIDGET(dg->combo[1]), 1, 2, 0, 1);
228
225
 
229
226
  alignlist = NULL;
237
234
        dg->combo[2] = combo_with_popdown_sized(tagvalues[1], alignlist, 0, 90);
238
235
        g_list_free(alignlist);
239
236
 
240
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("VAlign")), 0, 1, 1, 2);
 
237
        bf_mnemonic_label_tad_with_alignment(_("_Valign:"), dg->combo[2], 0, 0.5, dgtable, 0, 1, 1, 2);
241
238
        gtk_table_attach_defaults(GTK_TABLE(dgtable), GTK_WIDGET(GTK_COMBO(dg->combo[2])), 1, 2, 1, 2);
242
239
 
243
 
        dg->combo[4] = combo_with_popdown_sized(tagvalues[3], main_v->current_project.classlist, 1, 90);
244
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Class")), 2, 3, 0, 1);
 
240
        dg->combo[4] = combo_with_popdown_sized(tagvalues[3], bfwin->session->classlist, 1, 90);
 
241
        bf_mnemonic_label_tad_with_alignment(_("Cl_ass:"), dg->combo[4], 1, 0.5, dgtable, 2, 3, 0, 1);
245
242
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->combo[4], 3, 5, 0, 1);
246
243
 
247
 
        dg->combo[3] = combo_with_popdown_sized(tagvalues[2], main_v->current_project.colorlist, 1, 90);
 
244
        dg->combo[3] = combo_with_popdown_sized(tagvalues[2], bfwin->session->colorlist, 1, 90);
248
245
        color_but = color_but_new(GTK_COMBO(dg->combo[3])->entry, dg->dialog);
249
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Background Color")), 2, 3, 1, 2);
 
246
        bf_mnemonic_label_tad_with_alignment(_("Backgrou_nd Color:"), dg->combo[3], 0, 0.5, dgtable, 2, 3, 1, 2);
250
247
        gtk_table_attach_defaults(GTK_TABLE(dgtable), GTK_WIDGET(GTK_COMBO(dg->combo[3])), 3, 4, 1, 2);
251
248
        gtk_table_attach_defaults(GTK_TABLE(dgtable), GTK_WIDGET(color_but), 4, 5, 1, 2);
252
249
 
253
250
        dg->entry[2] = entry_with_text(tagvalues[4], 1024);
254
251
        var_but = style_but_new(dg->entry[2], dg->dialog);
255
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Style")), 0, 1, 2, 3);
 
252
        bf_mnemonic_label_tad_with_alignment(_("St_yle:"), dg->entry[2], 0, 0.5, dgtable, 0, 1, 2, 3);
256
253
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->entry[2], 1, 4, 2, 3);
257
254
        gtk_table_attach_defaults(GTK_TABLE(dgtable), var_but, 4, 5, 2, 3);
258
255
 
259
256
        dg->entry[1] = entry_with_text(custom, 1024);
260
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Custom")), 0, 1, 3, 4);
 
257
        bf_mnemonic_label_tad_with_alignment(_("Custo_m:"), dg->entry[1], 0, 0.5, dgtable, 0, 1, 3, 4);
261
258
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->entry[1], 1, 5, 3, 4);
262
259
 
263
 
        html_diag_finish(dg, tablerowdialogok_lcb);
 
260
        html_diag_finish(dg, G_CALLBACK(tablerowdialogok_lcb));
264
261
 
265
262
        if (custom)     g_free(custom);
266
263
}
274
271
        } else {
275
272
                thestring = g_strdup(cap("<TH"));
276
273
        }
277
 
        thestring = insert_integer_if_spin(dg->spin[1], cap("WIDTH"), thestring, dg->check[2]);
278
 
        thestring = insert_integer_if_spin(dg->spin[3], cap("HEIGHT"), thestring, dg->check[3]);
279
 
        thestring = insert_string_if_entry(dg->spin[5], cap("COLSPAN"), thestring, NULL);
280
 
        thestring = insert_string_if_entry(dg->spin[4], cap("ROWSPAN"), thestring, NULL);
 
274
        thestring = insert_integer_if_spin(dg->spin[1], cap("WIDTH"), thestring, GTK_TOGGLE_BUTTON(dg->check[2])->active,0);
 
275
        thestring = insert_integer_if_spin(dg->spin[3], cap("HEIGHT"), thestring, GTK_TOGGLE_BUTTON(dg->check[3])->active,0);
 
276
        thestring = insert_integer_if_spin(dg->spin[5], cap("COLSPAN"), thestring, FALSE, 0);
 
277
        thestring = insert_integer_if_spin(dg->spin[4], cap("ROWSPAN"), thestring, FALSE, 0);
281
278
        thestring = insert_string_if_entry(GTK_WIDGET(GTK_COMBO(dg->combo[1])->entry), cap("ALIGN"), thestring, NULL);
282
279
        thestring = insert_string_if_entry(GTK_WIDGET(GTK_COMBO(dg->combo[2])->entry), cap("VALIGN"), thestring, NULL);
283
280
        thestring = insert_string_if_entry(GTK_WIDGET(GTK_COMBO(dg->combo[3])->entry), cap("BGCOLOR"), thestring, NULL);
288
285
        finalstring = g_strconcat(thestring, ">", NULL);
289
286
        g_free(thestring);
290
287
 
291
 
        if (dg->range.len == -1) {
 
288
        if (dg->range.end == -1) {
292
289
                if (type == 1) {
293
 
                        doc_insert_dbl_text(dg->doc, finalstring, cap("</TD>"));
 
290
                        doc_insert_two_strings(dg->doc, finalstring, cap("</TD>"));
294
291
                } else {
295
 
                        doc_insert_dbl_text(dg->doc, finalstring, cap("</TH>"));
 
292
                        doc_insert_two_strings(dg->doc, finalstring, cap("</TH>"));
296
293
                }
297
294
        } else {
298
 
                replace_text(finalstring, dg->range.pos, dg->range.len);
 
295
                doc_replace_text(dg->doc, finalstring, dg->range.pos, dg->range.end);
299
296
        }
300
297
        g_free(finalstring);
301
 
        html_diag_destroy_cb(NULL, NULL, dg);
 
298
        html_diag_destroy_cb(NULL, dg);
302
299
}
303
300
 
304
301
static void tabledatadialogok_lcb(GtkWidget * widget, Thtml_diag *dg) {
309
306
        table_head_and_data_dialogok_lcb(0, widget, dg);
310
307
}
311
308
 
312
 
static void table_head_and_data_dialog_cb(gint type, GtkWidget * widget, gpointer data) {
 
309
static void table_head_and_data_dialog_cb(gint type, Tbfwin *bfwin, Ttagpopup *data) {
313
310
        GList *alignlist = NULL;
314
311
 
315
312
        static gchar *tagitems[] = { "width", "align", "colspan"
322
319
        GtkWidget *dgtable, *var_but;
323
320
 
324
321
        if (type == 1) {
325
 
                dg = html_diag_new(_("Table Data"));
 
322
                dg = html_diag_new(bfwin, _("Table Data"));
326
323
        } else {
327
 
                dg = html_diag_new(_("Table Header"));
 
324
                dg = html_diag_new(bfwin,_("Table Header"));
328
325
        }
329
326
        
330
 
        fill_dialogvalues(tagitems, tagvalues, &custom, (Ttagpopup *) data, widget, dg);
 
327
        fill_dialogvalues(tagitems, tagvalues, &custom, (Ttagpopup *) data, dg);
331
328
 
332
329
        dgtable = html_diag_table_in_vbox(dg, 5, 7);
333
330
 
337
334
        alignlist = g_list_insert(alignlist, "justify", 3);
338
335
        dg->combo[1] = combo_with_popdown_sized(tagvalues[1], alignlist, 1, 80);
339
336
        g_list_free(alignlist);
340
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Align")), 0, 1, 0, 1);
 
337
        bf_mnemonic_label_tad_with_alignment(_("Ali_gn:"), dg->combo[1], 0, 0.5, dgtable, 0, 1, 0, 1);
341
338
        gtk_table_attach_defaults(GTK_TABLE(dgtable), GTK_WIDGET(GTK_COMBO(dg->combo[1])), 1, 2, 0, 1);
342
339
 
343
 
  alignlist = NULL;
 
340
        alignlist = NULL;
344
341
        alignlist = g_list_insert(alignlist, "top", 0);
345
342
        alignlist = g_list_insert(alignlist, "middle", 1);
346
343
        alignlist = g_list_insert(alignlist, "bottom", 2);
351
348
        dg->combo[2] = combo_with_popdown_sized(tagvalues[4], alignlist, 1, 90);
352
349
        g_list_free(alignlist);
353
350
 
354
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("VAlign")), 0, 1, 1, 2);
 
351
        bf_mnemonic_label_tad_with_alignment(_("_Valign:"), dg->combo[2], 0, 0.5, dgtable, 0, 1, 1, 2);
355
352
        gtk_table_attach_defaults(GTK_TABLE(dgtable), GTK_WIDGET(GTK_COMBO(dg->combo[2])), 1, 2, 1, 2);
356
353
 
357
 
        dg->combo[4] = combo_with_popdown_sized(tagvalues[8], main_v->current_project.classlist, 1, 80);
358
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Class")), 0, 1, 2, 3);
 
354
        dg->combo[4] = combo_with_popdown_sized(tagvalues[8], bfwin->session->classlist, 1, 80);
 
355
        bf_mnemonic_label_tad_with_alignment(_("Cl_ass:"), dg->combo[4], 0, 0.5, dgtable, 0, 1, 2, 3);
359
356
        gtk_table_attach_defaults(GTK_TABLE(dgtable), GTK_WIDGET(GTK_COMBO(dg->combo[4])), 1, 2, 2, 3);
360
357
 
361
358
        dg->entry[2] = entry_with_text(tagvalues[9], 512);
362
359
        var_but = style_but_new(dg->entry[2], dg->dialog);
363
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Style")), 0, 1, 3, 4);
 
360
        bf_mnemonic_label_tad_with_alignment(_("St_yle:"), dg->entry[2], 0, 0.5, dgtable, 0, 1, 3, 4);
364
361
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->entry[2], 1, 6, 3, 4);
365
362
        gtk_table_attach_defaults(GTK_TABLE(dgtable), var_but, 6, 7, 3, 4);
366
363
 
367
364
        dg->entry[1] = entry_with_text(custom, 1024);
368
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Custom")), 0, 1, 4, 5);
 
365
        bf_mnemonic_label_tad_with_alignment(_("Custo_m:"), dg->entry[1], 0, 0.5, dgtable, 0, 1, 4, 5);
369
366
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->entry[1], 1, 7, 4, 5);
370
367
 
371
368
        dg->spin[5] = spinbut_with_value(tagvalues[2], 0, 10, 1.0, 2.0);
372
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Col Span")), 2, 3, 0, 1);
 
369
        bf_mnemonic_label_tad_with_alignment(_("Co_l Span:"), dg->spin[5], 1, 0.5, dgtable, 2, 3, 0, 1);
373
370
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->spin[5], 3, 4, 0, 1);
374
371
 
375
372
        dg->spin[4] = spinbut_with_value(tagvalues[5], 0, 100, 1.0, 5.0);
376
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Row Span")), 2, 3, 1, 2);
 
373
        bf_mnemonic_label_tad_with_alignment(_("_Row Span:"), dg->spin[4], 1, 0.5, dgtable, 2, 3, 1, 2);
377
374
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->spin[4], 3, 4, 1, 2);
378
375
 
379
376
        dg->check[1] = gtk_check_button_new();
380
377
        parse_existence_for_dialog(tagvalues[7], dg->check[1]);
381
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("No Wrap")), 2, 3, 2, 3);
 
378
        bf_mnemonic_label_tad_with_alignment(_("No Wra_p:"), dg->check[1], 1, 0.5, dgtable, 2, 3, 2, 3);
382
379
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->check[1], 3, 4, 2, 3);
383
380
        
384
381
        dg->spin[1] = spinbut_with_value(NULL, 0, 100, 1.0, 5.0);
385
382
        dg->check[2] = gtk_check_button_new_with_label("%");
386
383
        parse_integer_for_dialog(tagvalues[0], dg->spin[1], NULL, dg->check[2]);
387
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Width")), 4, 5, 0, 1);
 
384
        bf_mnemonic_label_tad_with_alignment(_("_Width:"), dg->spin[1], 1, 0.5, dgtable, 4, 5, 0, 1);
388
385
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->spin[1], 5, 6, 0, 1);
389
386
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->check[2], 6, 7, 0, 1);
390
387
 
391
388
        dg->spin[3] = spinbut_with_value(NULL, 0, 100, 1.0, 5.0);
392
389
        dg->check[3] = gtk_check_button_new_with_label("%");
393
390
        parse_integer_for_dialog(tagvalues[3], dg->spin[3], NULL, dg->check[3]);
394
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Height")), 4, 5, 1, 2);
 
391
        bf_mnemonic_label_tad_with_alignment(_("_Height:"), dg->spin[3], 1, 0.5, dgtable, 4, 5, 1, 2);
395
392
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->spin[3], 5, 6, 1, 2);
396
393
        gtk_table_attach_defaults(GTK_TABLE(dgtable), dg->check[3], 6, 7, 1, 2);
397
394
 
398
 
        dg->combo[3] = combo_with_popdown_sized(tagvalues[6], main_v->current_project.colorlist, 1, 80);
399
 
        gtk_table_attach_defaults(GTK_TABLE(dgtable), gtk_label_new(_("Background Color")), 4, 5, 2, 3);
 
395
        dg->combo[3] = combo_with_popdown_sized(tagvalues[6], bfwin->session->colorlist, 1, 80);
 
396
        bf_mnemonic_label_tad_with_alignment(_("Backgrou_nd Color:"), dg->combo[3], 1, 0.5, dgtable, 4, 5, 2, 3);
400
397
        gtk_table_attach_defaults(GTK_TABLE(dgtable), GTK_WIDGET(GTK_COMBO(dg->combo[3])), 5, 6, 2, 3);
401
398
        gtk_table_attach_defaults(GTK_TABLE(dgtable), GTK_WIDGET(color_but_new(GTK_COMBO(dg->combo[3])->entry, dg->dialog)), 6, 7, 2, 3);
402
399
 
403
400
        if (type == 1) {
404
 
                html_diag_finish(dg, tabledatadialogok_lcb);
 
401
                html_diag_finish(dg, G_CALLBACK(tabledatadialogok_lcb));
405
402
        } else {
406
 
                html_diag_finish(dg, tableheaddialogok_lcb);
 
403
                html_diag_finish(dg, G_CALLBACK(tableheaddialogok_lcb));
407
404
        }
408
405
 
409
406
        if (custom)     g_free(custom);
410
407
}
411
408
 
412
 
void tabledatadialog_cb(GtkWidget * widget, gpointer data) {
413
 
        table_head_and_data_dialog_cb(1, widget, data);
 
409
void tabledatadialog_dialog(Tbfwin *bfwin, Ttagpopup *data) {
 
410
        table_head_and_data_dialog_cb(1, bfwin, data);
414
411
}
415
412
 
416
 
void tableheaddialog_cb(GtkWidget * widget, gpointer data) {
417
 
        table_head_and_data_dialog_cb(0, widget, data);
 
413
void tableheaddialog_dialog(Tbfwin *bfwin, Ttagpopup *data) {
 
414
        table_head_and_data_dialog_cb(0, bfwin, data);
418
415
}