2 * DO NOT EDIT THIS FILE - it is generated by Glade.
16 #include "diaprint_callbacks.h"
17 #include "diaprint_interface.h"
21 create_DiaPrint (void)
24 GtkWidget *dialog_vbox1;
29 GSList *print_group = NULL;
35 GtkWidget *print_even;
37 guint print_pages_key;
38 GtkWidget *print_pages;
40 GtkObject *print_from_adj;
41 GtkWidget *print_from;
43 GtkObject *print_to_adj;
48 GSList *order_group = NULL;
49 guint order_normal_key;
50 GtkWidget *order_normal;
51 guint order_reverse_key;
52 GtkWidget *order_reverse;
55 guint copies_unsorted_key;
56 GtkWidget *copies_unsorted;
59 GtkObject *copies_count_adj;
60 GtkWidget *copies_count;
63 GSList *printto_group = NULL;
64 guint printto_file_key;
65 GtkWidget *printto_file;
66 guint printto_printer_key;
67 GtkWidget *printto_printer;
68 GtkWidget *printto_fileentry;
69 GtkWidget *combo_entry1;
70 GtkWidget *printto_printcommand;
71 GtkWidget *combo_entry2;
72 GtkWidget *dialog_action_area1;
73 GtkWidget *button_print;
74 GtkWidget *button_cancel;
75 GtkAccelGroup *accel_group;
77 accel_group = gtk_accel_group_new ();
79 DiaPrint = gnome_dialog_new (_("Print"), NULL);
80 gtk_object_set_data (GTK_OBJECT (DiaPrint), "DiaPrint", DiaPrint);
81 gtk_container_set_border_width (GTK_CONTAINER (DiaPrint), 2);
82 GTK_WINDOW (DiaPrint)->type = GTK_WINDOW_DIALOG;
83 gtk_window_set_policy (GTK_WINDOW (DiaPrint), FALSE, FALSE, FALSE);
85 dialog_vbox1 = GNOME_DIALOG (DiaPrint)->vbox;
86 gtk_object_set_data (GTK_OBJECT (DiaPrint), "dialog_vbox1", dialog_vbox1);
87 gtk_widget_show (dialog_vbox1);
89 vbox1 = gtk_vbox_new (FALSE, 0);
90 gtk_widget_ref (vbox1);
91 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "vbox1", vbox1,
92 (GtkDestroyNotify) gtk_widget_unref);
93 gtk_widget_show (vbox1);
94 gtk_box_pack_start (GTK_BOX (dialog_vbox1), vbox1, TRUE, TRUE, 0);
96 hbox1 = gtk_hbox_new (FALSE, 0);
97 gtk_widget_ref (hbox1);
98 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "hbox1", hbox1,
99 (GtkDestroyNotify) gtk_widget_unref);
100 gtk_widget_show (hbox1);
101 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 0);
103 frame2 = gtk_frame_new (_("Print"));
104 gtk_widget_ref (frame2);
105 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "frame2", frame2,
106 (GtkDestroyNotify) gtk_widget_unref);
107 gtk_widget_show (frame2);
108 gtk_box_pack_start (GTK_BOX (hbox1), frame2, TRUE, TRUE, 0);
109 gtk_container_set_border_width (GTK_CONTAINER (frame2), 2);
111 vbox2 = gtk_vbox_new (FALSE, 0);
112 gtk_widget_ref (vbox2);
113 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "vbox2", vbox2,
114 (GtkDestroyNotify) gtk_widget_unref);
115 gtk_widget_show (vbox2);
116 gtk_container_add (GTK_CONTAINER (frame2), vbox2);
118 print_all = gtk_radio_button_new_with_label (print_group, "");
119 print_all_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (print_all)->child),
121 gtk_widget_add_accelerator (print_all, "clicked", accel_group,
122 print_all_key, GDK_MOD1_MASK, 0);
123 print_group = gtk_radio_button_group (GTK_RADIO_BUTTON (print_all));
124 gtk_widget_ref (print_all);
125 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "print_all", print_all,
126 (GtkDestroyNotify) gtk_widget_unref);
127 gtk_widget_show (print_all);
128 gtk_box_pack_start (GTK_BOX (vbox2), print_all, FALSE, FALSE, 0);
130 print_odd = gtk_radio_button_new_with_label (print_group, "");
131 print_odd_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (print_odd)->child),
132 _("_Only Odd Pages"));
133 gtk_widget_add_accelerator (print_odd, "clicked", accel_group,
134 print_odd_key, GDK_MOD1_MASK, 0);
135 print_group = gtk_radio_button_group (GTK_RADIO_BUTTON (print_odd));
136 gtk_widget_ref (print_odd);
137 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "print_odd", print_odd,
138 (GtkDestroyNotify) gtk_widget_unref);
139 gtk_widget_show (print_odd);
140 gtk_box_pack_start (GTK_BOX (vbox2), print_odd, FALSE, FALSE, 0);
142 print_even = gtk_radio_button_new_with_label (print_group, "");
143 print_even_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (print_even)->child),
144 _("Only _Even Pages"));
145 gtk_widget_add_accelerator (print_even, "clicked", accel_group,
146 print_even_key, GDK_MOD1_MASK, 0);
147 print_group = gtk_radio_button_group (GTK_RADIO_BUTTON (print_even));
148 gtk_widget_ref (print_even);
149 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "print_even", print_even,
150 (GtkDestroyNotify) gtk_widget_unref);
151 gtk_widget_show (print_even);
152 gtk_box_pack_start (GTK_BOX (vbox2), print_even, FALSE, FALSE, 0);
154 hbox2 = gtk_hbox_new (FALSE, 0);
155 gtk_widget_ref (hbox2);
156 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "hbox2", hbox2,
157 (GtkDestroyNotify) gtk_widget_unref);
158 gtk_widget_show (hbox2);
159 gtk_box_pack_start (GTK_BOX (vbox2), hbox2, TRUE, TRUE, 0);
161 print_pages = gtk_check_button_new_with_label ("");
162 print_pages_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (print_pages)->child),
164 gtk_widget_add_accelerator (print_pages, "clicked", accel_group,
165 print_pages_key, GDK_MOD1_MASK, 0);
166 gtk_widget_ref (print_pages);
167 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "print_pages", print_pages,
168 (GtkDestroyNotify) gtk_widget_unref);
169 gtk_widget_show (print_pages);
170 gtk_box_pack_start (GTK_BOX (hbox2), print_pages, FALSE, FALSE, 0);
172 label1 = gtk_label_new (_("from"));
173 gtk_widget_ref (label1);
174 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "label1", label1,
175 (GtkDestroyNotify) gtk_widget_unref);
176 gtk_widget_show (label1);
177 gtk_box_pack_start (GTK_BOX (hbox2), label1, FALSE, FALSE, 0);
178 gtk_misc_set_padding (GTK_MISC (label1), 1, 0);
180 print_from_adj = gtk_adjustment_new (1, 1, 100000, 1, 10, 10);
181 print_from = gtk_spin_button_new (GTK_ADJUSTMENT (print_from_adj), 1, 0);
182 gtk_widget_ref (print_from);
183 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "print_from", print_from,
184 (GtkDestroyNotify) gtk_widget_unref);
185 gtk_widget_show (print_from);
186 gtk_box_pack_start (GTK_BOX (hbox2), print_from, FALSE, FALSE, 0);
187 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (print_from), TRUE);
189 label2 = gtk_label_new (_("to"));
190 gtk_widget_ref (label2);
191 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "label2", label2,
192 (GtkDestroyNotify) gtk_widget_unref);
193 gtk_widget_show (label2);
194 gtk_box_pack_start (GTK_BOX (hbox2), label2, FALSE, FALSE, 0);
195 gtk_misc_set_padding (GTK_MISC (label2), 1, 0);
197 print_to_adj = gtk_adjustment_new (1, 1, 100000, 1, 10, 10);
198 print_to = gtk_spin_button_new (GTK_ADJUSTMENT (print_to_adj), 1, 0);
199 gtk_widget_ref (print_to);
200 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "print_to", print_to,
201 (GtkDestroyNotify) gtk_widget_unref);
202 gtk_widget_show (print_to);
203 gtk_box_pack_start (GTK_BOX (hbox2), print_to, FALSE, FALSE, 0);
204 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (print_to), TRUE);
206 vbox3 = gtk_vbox_new (FALSE, 0);
207 gtk_widget_ref (vbox3);
208 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "vbox3", vbox3,
209 (GtkDestroyNotify) gtk_widget_unref);
210 gtk_widget_show (vbox3);
211 gtk_box_pack_start (GTK_BOX (hbox1), vbox3, TRUE, TRUE, 0);
213 frame3 = gtk_frame_new (_("Order"));
214 gtk_widget_ref (frame3);
215 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "frame3", frame3,
216 (GtkDestroyNotify) gtk_widget_unref);
217 gtk_widget_show (frame3);
218 gtk_box_pack_start (GTK_BOX (vbox3), frame3, TRUE, TRUE, 0);
219 gtk_container_set_border_width (GTK_CONTAINER (frame3), 2);
221 vbox4 = gtk_vbox_new (FALSE, 0);
222 gtk_widget_ref (vbox4);
223 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "vbox4", vbox4,
224 (GtkDestroyNotify) gtk_widget_unref);
225 gtk_widget_show (vbox4);
226 gtk_container_add (GTK_CONTAINER (frame3), vbox4);
228 order_normal = gtk_radio_button_new_with_label (order_group, "");
229 order_normal_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (order_normal)->child),
231 gtk_widget_add_accelerator (order_normal, "clicked", accel_group,
232 order_normal_key, GDK_MOD1_MASK, 0);
233 order_group = gtk_radio_button_group (GTK_RADIO_BUTTON (order_normal));
234 gtk_widget_ref (order_normal);
235 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "order_normal", order_normal,
236 (GtkDestroyNotify) gtk_widget_unref);
237 gtk_widget_show (order_normal);
238 gtk_box_pack_start (GTK_BOX (vbox4), order_normal, FALSE, FALSE, 0);
240 order_reverse = gtk_radio_button_new_with_label (order_group, "");
241 order_reverse_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (order_reverse)->child),
242 _("_Reverse Order"));
243 gtk_widget_add_accelerator (order_reverse, "clicked", accel_group,
244 order_reverse_key, GDK_MOD1_MASK, 0);
245 order_group = gtk_radio_button_group (GTK_RADIO_BUTTON (order_reverse));
246 gtk_widget_ref (order_reverse);
247 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "order_reverse", order_reverse,
248 (GtkDestroyNotify) gtk_widget_unref);
249 gtk_widget_show (order_reverse);
250 gtk_box_pack_start (GTK_BOX (vbox4), order_reverse, FALSE, FALSE, 0);
252 frame4 = gtk_frame_new (_("Copies"));
253 gtk_widget_ref (frame4);
254 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "frame4", frame4,
255 (GtkDestroyNotify) gtk_widget_unref);
256 gtk_widget_show (frame4);
257 gtk_box_pack_start (GTK_BOX (vbox3), frame4, TRUE, TRUE, 0);
258 gtk_container_set_border_width (GTK_CONTAINER (frame4), 2);
260 vbox5 = gtk_vbox_new (FALSE, 0);
261 gtk_widget_ref (vbox5);
262 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "vbox5", vbox5,
263 (GtkDestroyNotify) gtk_widget_unref);
264 gtk_widget_show (vbox5);
265 gtk_container_add (GTK_CONTAINER (frame4), vbox5);
267 copies_unsorted = gtk_check_button_new_with_label ("");
268 copies_unsorted_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (copies_unsorted)->child),
270 gtk_widget_add_accelerator (copies_unsorted, "clicked", accel_group,
271 copies_unsorted_key, GDK_MOD1_MASK, 0);
272 gtk_widget_ref (copies_unsorted);
273 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "copies_unsorted", copies_unsorted,
274 (GtkDestroyNotify) gtk_widget_unref);
275 gtk_widget_show (copies_unsorted);
276 gtk_box_pack_start (GTK_BOX (vbox5), copies_unsorted, FALSE, FALSE, 0);
278 hbox3 = gtk_hbox_new (FALSE, 0);
279 gtk_widget_ref (hbox3);
280 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "hbox3", hbox3,
281 (GtkDestroyNotify) gtk_widget_unref);
282 gtk_widget_show (hbox3);
283 gtk_box_pack_start (GTK_BOX (vbox5), hbox3, TRUE, TRUE, 0);
284 gtk_container_set_border_width (GTK_CONTAINER (hbox3), 2);
286 label3 = gtk_label_new (_("Count"));
287 gtk_widget_ref (label3);
288 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "label3", label3,
289 (GtkDestroyNotify) gtk_widget_unref);
290 gtk_widget_show (label3);
291 gtk_box_pack_start (GTK_BOX (hbox3), label3, FALSE, FALSE, 0);
292 gtk_misc_set_padding (GTK_MISC (label3), 3, 0);
294 copies_count_adj = gtk_adjustment_new (1, 1, 100000, 1, 10, 10);
295 copies_count = gtk_spin_button_new (GTK_ADJUSTMENT (copies_count_adj), 1, 0);
296 gtk_widget_ref (copies_count);
297 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "copies_count", copies_count,
298 (GtkDestroyNotify) gtk_widget_unref);
299 gtk_widget_show (copies_count);
300 gtk_box_pack_start (GTK_BOX (hbox3), copies_count, TRUE, TRUE, 2);
301 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (copies_count), TRUE);
303 frame1 = gtk_frame_new (_("Print to"));
304 gtk_widget_ref (frame1);
305 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "frame1", frame1,
306 (GtkDestroyNotify) gtk_widget_unref);
307 gtk_widget_show (frame1);
308 gtk_box_pack_start (GTK_BOX (vbox1), frame1, TRUE, TRUE, 0);
309 gtk_container_set_border_width (GTK_CONTAINER (frame1), 2);
311 table1 = gtk_table_new (2, 2, FALSE);
312 gtk_widget_ref (table1);
313 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "table1", table1,
314 (GtkDestroyNotify) gtk_widget_unref);
315 gtk_widget_show (table1);
316 gtk_container_add (GTK_CONTAINER (frame1), table1);
318 printto_file = gtk_radio_button_new_with_label (printto_group, "");
319 printto_file_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (printto_file)->child),
321 gtk_widget_add_accelerator (printto_file, "clicked", accel_group,
322 printto_file_key, GDK_MOD1_MASK, 0);
323 printto_group = gtk_radio_button_group (GTK_RADIO_BUTTON (printto_file));
324 gtk_widget_ref (printto_file);
325 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "printto_file", printto_file,
326 (GtkDestroyNotify) gtk_widget_unref);
327 gtk_widget_show (printto_file);
328 gtk_table_attach (GTK_TABLE (table1), printto_file, 0, 1, 1, 2,
329 (GtkAttachOptions) (GTK_FILL),
330 (GtkAttachOptions) (0), 0, 0);
332 printto_printer = gtk_radio_button_new_with_label (printto_group, "");
333 printto_printer_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (printto_printer)->child),
335 gtk_widget_add_accelerator (printto_printer, "clicked", accel_group,
336 printto_printer_key, GDK_MOD1_MASK, 0);
337 printto_group = gtk_radio_button_group (GTK_RADIO_BUTTON (printto_printer));
338 gtk_widget_ref (printto_printer);
339 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "printto_printer", printto_printer,
340 (GtkDestroyNotify) gtk_widget_unref);
341 gtk_widget_show (printto_printer);
342 gtk_table_attach (GTK_TABLE (table1), printto_printer, 0, 1, 0, 1,
343 (GtkAttachOptions) (GTK_FILL),
344 (GtkAttachOptions) (0), 0, 0);
345 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (printto_printer), TRUE);
347 printto_fileentry = gnome_file_entry_new ("diaprint_printto_fileentry", NULL);
348 gtk_widget_ref (printto_fileentry);
349 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "printto_fileentry", printto_fileentry,
350 (GtkDestroyNotify) gtk_widget_unref);
351 gtk_widget_show (printto_fileentry);
352 gtk_table_attach (GTK_TABLE (table1), printto_fileentry, 1, 2, 1, 2,
353 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
354 (GtkAttachOptions) (0), 0, 0);
355 gtk_container_set_border_width (GTK_CONTAINER (printto_fileentry), 3);
357 combo_entry1 = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (printto_fileentry));
358 gtk_widget_ref (combo_entry1);
359 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "combo_entry1", combo_entry1,
360 (GtkDestroyNotify) gtk_widget_unref);
361 gtk_widget_show (combo_entry1);
363 printto_printcommand = gnome_entry_new ("diaprint_printto_printcommand");
364 gtk_widget_ref (printto_printcommand);
365 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "printto_printcommand", printto_printcommand,
366 (GtkDestroyNotify) gtk_widget_unref);
367 gtk_widget_show (printto_printcommand);
368 gtk_table_attach (GTK_TABLE (table1), printto_printcommand, 1, 2, 0, 1,
369 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
370 (GtkAttachOptions) (0), 0, 0);
371 gtk_container_set_border_width (GTK_CONTAINER (printto_printcommand), 3);
373 combo_entry2 = gnome_entry_gtk_entry (GNOME_ENTRY (printto_printcommand));
374 gtk_widget_ref (combo_entry2);
375 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "combo_entry2", combo_entry2,
376 (GtkDestroyNotify) gtk_widget_unref);
377 gtk_widget_show (combo_entry2);
379 dialog_action_area1 = GNOME_DIALOG (DiaPrint)->action_area;
380 gtk_object_set_data (GTK_OBJECT (DiaPrint), "dialog_action_area1", dialog_action_area1);
381 gtk_widget_show (dialog_action_area1);
382 gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
383 gtk_button_box_set_spacing (GTK_BUTTON_BOX (dialog_action_area1), 8);
385 gnome_dialog_append_button_with_pixmap (GNOME_DIALOG (DiaPrint),
386 _("Print"), GNOME_STOCK_PIXMAP_PRINT);
387 button_print = g_list_last (GNOME_DIALOG (DiaPrint)->buttons)->data;
388 gtk_widget_ref (button_print);
389 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "button_print", button_print,
390 (GtkDestroyNotify) gtk_widget_unref);
391 gtk_widget_show (button_print);
392 GTK_WIDGET_SET_FLAGS (button_print, GTK_CAN_DEFAULT);
394 gnome_dialog_append_button (GNOME_DIALOG (DiaPrint), GNOME_STOCK_BUTTON_CANCEL);
395 button_cancel = g_list_last (GNOME_DIALOG (DiaPrint)->buttons)->data;
396 gtk_widget_ref (button_cancel);
397 gtk_object_set_data_full (GTK_OBJECT (DiaPrint), "button_cancel", button_cancel,
398 (GtkDestroyNotify) gtk_widget_unref);
399 gtk_widget_show (button_cancel);
400 GTK_WIDGET_SET_FLAGS (button_cancel, GTK_CAN_DEFAULT);
402 gtk_signal_connect (GTK_OBJECT (DiaPrint), "show",
403 GTK_SIGNAL_FUNC (diaprint_on_diaprint_show),
405 gtk_signal_connect (GTK_OBJECT (print_pages), "toggled",
406 GTK_SIGNAL_FUNC (diaprint_on_print_pages_toggled),
408 gtk_signal_connect (GTK_OBJECT (print_from), "changed",
409 GTK_SIGNAL_FUNC (diaprint_on_print_from_changed),
411 gtk_signal_connect (GTK_OBJECT (printto_file), "toggled",
412 GTK_SIGNAL_FUNC (diaprint_on_printto_file_toggled),
414 gtk_signal_connect (GTK_OBJECT (printto_printer), "toggled",
415 GTK_SIGNAL_FUNC (diaprint_on_printto_printer_toggled),
418 gtk_widget_grab_focus (button_print);
419 gtk_widget_grab_default (button_print);
420 gtk_window_add_accel_group (GTK_WINDOW (DiaPrint), accel_group);