1 /* Dia -- a diagram creation/manipulation program
2 * Copyright (C) 1998 Alexander Larsson
4 * sheets_dialog.c : a sheets and objects dialog
5 * Copyright (C) 2002 M.C. Nelson
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 * DO NOT EDIT THIS FILE - it is generated by Glade and then hand-coded
25 * to make GNOME optional and add the underline
26 * for accelerated buttons.
33 #include <sys/types.h>
41 #include <gdk/gdkkeysyms.h>
44 #include "sheets_dialog_callbacks.h"
45 #include "sheets_dialog.h"
48 #include "persistence.h"
51 create_sheets_main_dialog (void)
53 GtkWidget
*sheets_main_dialog
;
54 GtkWidget
*dialog_vbox1
;
55 GtkWidget
*table_sheets
;
56 GtkWidget
*vbuttonbox
;
57 GtkWidget
*button_copy
;
58 GtkWidget
*button_copy_all
;
59 GtkWidget
*button_move
;
60 GtkWidget
*button_move_all
;
61 GtkWidget
*optionmenu_right
;
62 GtkWidget
*optionmenu_right_menu
;
63 GtkWidget
*optionmenu_left
;
64 GtkWidget
*optionmenu_left_menu
;
65 GtkWidget
*glade_menuitem
;
66 GtkWidget
*scrolledwindow_left
;
67 GtkWidget
*scrolledwindow_right
;
68 GtkWidget
*dialog_action_area1
;
70 GtkWidget
*button_new
;
71 GtkWidget
*button_move_up
;
72 GtkWidget
*button_move_down
;
73 GtkWidget
*button_edit
;
74 GtkWidget
*button_remove
;
75 GtkWidget
*button_apply
;
76 GtkWidget
*button_revert
;
77 GtkWidget
*button_close
;
78 GtkAccelGroup
*accel_group
;
80 accel_group
= gtk_accel_group_new ();
82 sheets_main_dialog
= gtk_dialog_new ();
83 gtk_object_set_data (GTK_OBJECT (sheets_main_dialog
), "sheets_main_dialog", sheets_main_dialog
);
84 gtk_window_set_title (GTK_WINDOW (sheets_main_dialog
), _("Sheets and Objects"));
85 gtk_window_set_role(GTK_WINDOW(sheets_main_dialog
), "sheets_main_dialog");
86 gtk_window_set_default_size (GTK_WINDOW (sheets_main_dialog
), 506, 261);
87 gtk_window_set_resizable (GTK_WINDOW (sheets_main_dialog
), TRUE
);
89 dialog_vbox1
= GTK_DIALOG (sheets_main_dialog
)->vbox
;
90 gtk_object_set_data (GTK_OBJECT (sheets_main_dialog
), "dialog_vbox1", dialog_vbox1
);
91 gtk_widget_show (dialog_vbox1
);
93 table_sheets
= gtk_table_new (2, 3, FALSE
);
94 gtk_widget_ref (table_sheets
);
95 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "table_sheets", table_sheets
,
96 (GtkDestroyNotify
) gtk_widget_unref
);
97 gtk_widget_show (table_sheets
);
98 gtk_box_pack_start (GTK_BOX (dialog_vbox1
), table_sheets
, TRUE
, TRUE
, 0);
100 vbuttonbox
= gtk_vbutton_box_new ();
101 gtk_widget_ref (vbuttonbox
);
102 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "vbuttonbox", vbuttonbox
,
103 (GtkDestroyNotify
) gtk_widget_unref
);
104 gtk_widget_show (vbuttonbox
);
105 gtk_table_attach (GTK_TABLE (table_sheets
), vbuttonbox
, 1, 2, 1, 2,
106 (GtkAttachOptions
) (GTK_FILL
),
107 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
), 17, 0);
108 gtk_button_box_set_layout (GTK_BUTTON_BOX (vbuttonbox
), GTK_BUTTONBOX_SPREAD
);
110 button_copy
= gtk_button_new_with_label (_("<- Copy"));
111 gtk_widget_ref (button_copy
);
112 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "button_copy", button_copy
,
113 (GtkDestroyNotify
) gtk_widget_unref
);
114 gtk_widget_show (button_copy
);
115 gtk_container_add (GTK_CONTAINER (vbuttonbox
), button_copy
);
116 gtk_widget_add_accelerator (button_copy
, "clicked", accel_group
,
117 GDK_c
, GDK_CONTROL_MASK
,
120 button_copy_all
= gtk_button_new_with_label (_("<- Copy All"));
121 gtk_widget_ref (button_copy_all
);
122 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "button_copy_all", button_copy_all
,
123 (GtkDestroyNotify
) gtk_widget_unref
);
124 gtk_widget_show (button_copy_all
);
125 gtk_container_add (GTK_CONTAINER (vbuttonbox
), button_copy_all
);
127 button_move
= gtk_button_new_with_label (_("<- Move"));
128 gtk_widget_ref (button_move
);
129 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "button_move", button_move
,
130 (GtkDestroyNotify
) gtk_widget_unref
);
131 gtk_widget_show (button_move
);
132 gtk_container_add (GTK_CONTAINER (vbuttonbox
), button_move
);
133 gtk_widget_add_accelerator (button_move
, "clicked", accel_group
,
134 GDK_m
, GDK_CONTROL_MASK
,
137 button_move_all
= gtk_button_new_with_label (_("<- Move All"));
138 gtk_widget_ref (button_move_all
);
139 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "button_move_all", button_move_all
,
140 (GtkDestroyNotify
) gtk_widget_unref
);
141 gtk_widget_show (button_move_all
);
142 gtk_container_add (GTK_CONTAINER (vbuttonbox
), button_move_all
);
144 optionmenu_right
= gtk_option_menu_new ();
145 gtk_widget_ref (optionmenu_right
);
146 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "optionmenu_right", optionmenu_right
,
147 (GtkDestroyNotify
) gtk_widget_unref
);
148 gtk_widget_show (optionmenu_right
);
149 gtk_table_attach (GTK_TABLE (table_sheets
), optionmenu_right
, 2, 3, 0, 1,
150 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
151 (GtkAttachOptions
) (GTK_FILL
), 0, 0);
152 optionmenu_right_menu
= gtk_menu_new ();
153 gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu_right
), optionmenu_right_menu
);
155 optionmenu_left
= gtk_option_menu_new ();
156 gtk_widget_ref (optionmenu_left
);
157 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "optionmenu_left", optionmenu_left
,
158 (GtkDestroyNotify
) gtk_widget_unref
);
159 gtk_widget_show (optionmenu_left
);
160 gtk_table_attach (GTK_TABLE (table_sheets
), optionmenu_left
, 0, 1, 0, 1,
161 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
162 (GtkAttachOptions
) (GTK_FILL
), 0, 0);
163 optionmenu_left_menu
= gtk_menu_new ();
164 glade_menuitem
= gtk_menu_item_new_with_label ("");
165 gtk_widget_show (glade_menuitem
);
166 gtk_menu_append (GTK_MENU (optionmenu_left_menu
), glade_menuitem
);
167 gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu_left
), optionmenu_left_menu
);
169 scrolledwindow_left
= gtk_scrolled_window_new (NULL
, NULL
);
170 gtk_widget_ref (scrolledwindow_left
);
171 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "scrolledwindow_left", scrolledwindow_left
,
172 (GtkDestroyNotify
) gtk_widget_unref
);
173 gtk_widget_show (scrolledwindow_left
);
174 gtk_table_attach (GTK_TABLE (table_sheets
), scrolledwindow_left
, 0, 1, 1, 2,
175 (GtkAttachOptions
) (GTK_FILL
),
176 (GtkAttachOptions
) (GTK_FILL
), 0, 0);
177 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow_left
), GTK_POLICY_AUTOMATIC
, GTK_POLICY_AUTOMATIC
);
179 scrolledwindow_right
= gtk_scrolled_window_new (NULL
, NULL
);
180 gtk_widget_ref (scrolledwindow_right
);
181 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "scrolledwindow_right", scrolledwindow_right
,
182 (GtkDestroyNotify
) gtk_widget_unref
);
183 gtk_widget_show (scrolledwindow_right
);
184 gtk_table_attach (GTK_TABLE (table_sheets
), scrolledwindow_right
, 2, 3, 1, 2,
185 (GtkAttachOptions
) (GTK_FILL
),
186 (GtkAttachOptions
) (GTK_FILL
), 0, 0);
187 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow_right
), GTK_POLICY_AUTOMATIC
, GTK_POLICY_AUTOMATIC
);
189 dialog_action_area1
= GTK_DIALOG (sheets_main_dialog
)->action_area
;
190 gtk_object_set_data (GTK_OBJECT (sheets_main_dialog
), "dialog_action_area1", dialog_action_area1
);
191 gtk_widget_show (dialog_action_area1
);
192 gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area1
), 10);
194 hbox1
= gtk_hbox_new (TRUE
, 0);
195 gtk_widget_ref (hbox1
);
196 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "hbox1", hbox1
,
197 (GtkDestroyNotify
) gtk_widget_unref
);
198 gtk_widget_show (hbox1
);
199 gtk_box_pack_start (GTK_BOX (dialog_action_area1
), hbox1
, TRUE
, TRUE
, 0);
201 button_new
= gtk_button_new_from_stock(GTK_STOCK_NEW
);
202 gtk_widget_ref (button_new
);
203 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "button_new", button_new
,
204 (GtkDestroyNotify
) gtk_widget_unref
);
205 gtk_widget_show (button_new
);
206 gtk_box_pack_start (GTK_BOX (hbox1
), button_new
, FALSE
, TRUE
, 0);
207 gtk_widget_add_accelerator (button_new
, "clicked", accel_group
,
208 GDK_n
, GDK_CONTROL_MASK
,
211 button_move_up
= gtk_button_new_from_stock (GTK_STOCK_GO_UP
);
212 gtk_widget_ref (button_move_up
);
213 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "button_move_up", button_move_up
,
214 (GtkDestroyNotify
) gtk_widget_unref
);
215 gtk_widget_show (button_move_up
);
216 gtk_box_pack_start (GTK_BOX (hbox1
), button_move_up
, FALSE
, TRUE
, 0);
217 gtk_widget_add_accelerator (button_move_up
, "clicked", accel_group
,
218 GDK_u
, GDK_CONTROL_MASK
,
220 button_move_down
= gtk_button_new_from_stock (GTK_STOCK_GO_DOWN
);
221 gtk_widget_ref (button_move_down
);
222 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "button_move_down", button_move_down
,
223 (GtkDestroyNotify
) gtk_widget_unref
);
224 gtk_widget_show (button_move_down
);
225 gtk_box_pack_start (GTK_BOX (hbox1
), button_move_down
, FALSE
, TRUE
, 0);
226 gtk_widget_add_accelerator (button_move_down
, "clicked", accel_group
,
227 GDK_d
, GDK_CONTROL_MASK
,
230 button_edit
= gtk_button_new(); /* _with_label (_("Edit")); */
234 label
= gtk_label_new(_("Edit"));
235 gtk_widget_ref(label
);
236 gtk_label_parse_uline(GTK_LABEL(label
), _("_Edit"));
237 gtk_container_add(GTK_CONTAINER(button_edit
), label
);
238 gtk_widget_show(label
);
240 gtk_widget_ref (button_edit
);
241 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "button_edit", button_edit
,
242 (GtkDestroyNotify
) gtk_widget_unref
);
243 gtk_widget_show (button_edit
);
244 gtk_box_pack_start (GTK_BOX (hbox1
), button_edit
, FALSE
, TRUE
, 0);
245 gtk_widget_add_accelerator (button_edit
, "clicked", accel_group
,
246 GDK_e
, GDK_CONTROL_MASK
,
249 button_remove
= gtk_button_new_from_stock(GTK_STOCK_REMOVE
);
250 gtk_widget_ref (button_remove
);
251 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "button_remove", button_remove
,
252 (GtkDestroyNotify
) gtk_widget_unref
);
253 gtk_widget_show (button_remove
);
254 gtk_box_pack_start (GTK_BOX (hbox1
), button_remove
, FALSE
, TRUE
, 0);
255 gtk_widget_add_accelerator (button_remove
, "clicked", accel_group
,
256 GDK_r
, GDK_CONTROL_MASK
,
259 button_apply
= gtk_button_new_from_stock(GTK_STOCK_APPLY
);
260 gtk_widget_ref (button_apply
);
261 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "button_apply", button_apply
,
262 (GtkDestroyNotify
) gtk_widget_unref
);
263 gtk_widget_show (button_apply
);
264 gtk_box_pack_start (GTK_BOX (hbox1
), button_apply
, FALSE
, TRUE
, 0);
265 gtk_widget_set_sensitive (button_apply
, FALSE
);
267 button_revert
= gtk_button_new_with_label(_("Revert"));
268 gtk_widget_ref (button_revert
);
269 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "button_revert", button_revert
,
270 (GtkDestroyNotify
) gtk_widget_unref
);
271 gtk_widget_show (button_revert
);
272 gtk_box_pack_start (GTK_BOX (hbox1
), button_revert
, FALSE
, TRUE
, 0);
273 gtk_widget_set_sensitive (button_revert
, FALSE
);
275 button_close
= gtk_button_new_from_stock(GTK_STOCK_CLOSE
);
276 gtk_widget_ref (button_close
);
277 gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog
), "button_close", button_close
,
278 (GtkDestroyNotify
) gtk_widget_unref
);
279 gtk_widget_show (button_close
);
280 gtk_box_pack_start (GTK_BOX (hbox1
), button_close
, FALSE
, TRUE
, 0);
282 g_signal_connect (GTK_OBJECT (sheets_main_dialog
), "delete_event",
283 G_CALLBACK (on_sheets_main_dialog_delete_event
),
285 g_signal_connect (GTK_OBJECT (button_copy
), "clicked",
286 G_CALLBACK (on_sheets_dialog_button_copy_clicked
),
288 g_signal_connect (GTK_OBJECT (button_copy_all
), "clicked",
289 G_CALLBACK (on_sheets_dialog_button_copy_all_clicked
),
291 g_signal_connect (GTK_OBJECT (button_move
), "clicked",
292 G_CALLBACK (on_sheets_dialog_button_move_clicked
),
294 g_signal_connect (GTK_OBJECT (button_move_all
), "clicked",
295 G_CALLBACK (on_sheets_dialog_button_move_all_clicked
),
297 g_signal_connect (GTK_OBJECT (button_new
), "clicked",
298 G_CALLBACK (on_sheets_dialog_button_new_clicked
),
300 g_signal_connect (GTK_OBJECT (button_move_up
), "clicked",
301 G_CALLBACK (on_sheets_dialog_button_move_up_clicked
),
303 g_signal_connect (GTK_OBJECT (button_move_down
), "clicked",
304 G_CALLBACK (on_sheets_dialog_button_move_down_clicked
),
306 g_signal_connect (GTK_OBJECT (button_edit
), "clicked",
307 G_CALLBACK (on_sheets_dialog_button_edit_clicked
),
309 g_signal_connect (GTK_OBJECT (button_remove
), "clicked",
310 G_CALLBACK (on_sheets_dialog_button_remove_clicked
),
312 g_signal_connect (GTK_OBJECT (button_apply
), "clicked",
313 G_CALLBACK (on_sheets_dialog_button_apply_clicked
),
315 g_signal_connect (GTK_OBJECT (button_revert
), "clicked",
316 G_CALLBACK (on_sheets_dialog_button_revert_clicked
),
318 g_signal_connect (GTK_OBJECT (button_close
), "clicked",
319 G_CALLBACK (on_sheets_dialog_button_close_clicked
),
322 gtk_window_add_accel_group (GTK_WINDOW (sheets_main_dialog
), accel_group
);
324 persistence_register_window(GTK_WINDOW(sheets_main_dialog
));
326 return sheets_main_dialog
;
330 create_sheets_new_dialog (void)
332 GtkWidget
*sheets_new_dialog
;
333 GtkWidget
*dialog_vbox2
;
336 GtkWidget
*button_browse
;
337 GSList
*table1_group
= NULL
;
338 GtkWidget
*radiobutton_svg_shape
;
339 GtkWidget
*combo_from_file
;
340 GtkWidget
*combo_entry_from_file
;
341 GtkWidget
*label_description
;
342 GtkWidget
*radiobutton_sheet
;
343 GtkWidget
*entry_sheet_name
;
344 GtkWidget
*radiobutton_line_break
;
345 GtkWidget
*entry_svg_description
;
346 GtkWidget
*entry_sheet_description
;
347 GtkWidget
*label_svg_description
;
348 GtkWidget
*dialog_action_area2
;
349 GtkWidget
*hbuttonbox1
;
350 GtkWidget
*button_ok
;
351 GtkWidget
*button_cancel
;
353 sheets_new_dialog
= gtk_dialog_new ();
354 gtk_object_set_data (GTK_OBJECT (sheets_new_dialog
), "sheets_new_dialog", sheets_new_dialog
);
355 gtk_window_set_title (GTK_WINDOW (sheets_new_dialog
), _("New"));
356 gtk_window_set_role (GTK_WINDOW (sheets_new_dialog
), "sheets_new_dialog");
357 gtk_window_set_resizable (GTK_WINDOW (sheets_new_dialog
), FALSE
);
359 dialog_vbox2
= GTK_DIALOG (sheets_new_dialog
)->vbox
;
360 gtk_object_set_data (GTK_OBJECT (sheets_new_dialog
), "dialog_vbox2", dialog_vbox2
);
361 gtk_widget_show (dialog_vbox2
);
363 Typefg
= gtk_frame_new (_("Type"));
364 gtk_widget_ref (Typefg
);
365 gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog
), "Typefg", Typefg
,
366 (GtkDestroyNotify
) gtk_widget_unref
);
367 gtk_widget_show (Typefg
);
368 gtk_box_pack_start (GTK_BOX (dialog_vbox2
), Typefg
, TRUE
, TRUE
, 0);
369 gtk_container_set_border_width (GTK_CONTAINER (Typefg
), 5);
371 table1
= gtk_table_new (5, 4, FALSE
);
372 gtk_widget_ref (table1
);
373 gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog
), "table1", table1
,
374 (GtkDestroyNotify
) gtk_widget_unref
);
375 gtk_widget_show (table1
);
376 gtk_container_add (GTK_CONTAINER (Typefg
), table1
);
378 button_browse
= gtk_button_new_with_label (_("Browse..."));
379 gtk_widget_ref (button_browse
);
380 gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog
), "button_browse", button_browse
,
381 (GtkDestroyNotify
) gtk_widget_unref
);
382 gtk_widget_show (button_browse
);
383 gtk_table_attach (GTK_TABLE (table1
), button_browse
, 3, 4, 0, 1,
384 (GtkAttachOptions
) (GTK_FILL
),
385 (GtkAttachOptions
) (0), 3, 0);
387 radiobutton_svg_shape
= gtk_radio_button_new_with_label (table1_group
, _("SVG Shape:"));
388 table1_group
= gtk_radio_button_group (GTK_RADIO_BUTTON (radiobutton_svg_shape
));
389 gtk_widget_ref (radiobutton_svg_shape
);
390 gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog
), "radiobutton_svg_shape", radiobutton_svg_shape
,
391 (GtkDestroyNotify
) gtk_widget_unref
);
392 gtk_widget_show (radiobutton_svg_shape
);
393 gtk_table_attach (GTK_TABLE (table1
), radiobutton_svg_shape
, 0, 1, 0, 1,
394 (GtkAttachOptions
) (GTK_FILL
),
395 (GtkAttachOptions
) (0), 0, 0);
396 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_svg_shape
), TRUE
);
398 combo_from_file
= gtk_combo_new ();
399 gtk_widget_ref (combo_from_file
);
400 gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog
), "combo_from_file", combo_from_file
,
401 (GtkDestroyNotify
) gtk_widget_unref
);
402 gtk_widget_show (combo_from_file
);
403 gtk_table_attach (GTK_TABLE (table1
), combo_from_file
, 1, 3, 0, 1,
404 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
405 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
), 0, 0);
406 gtk_combo_set_case_sensitive (GTK_COMBO (combo_from_file
), TRUE
);
408 combo_entry_from_file
= GTK_COMBO (combo_from_file
)->entry
;
409 gtk_widget_ref (combo_entry_from_file
);
410 gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog
), "combo_entry_from_file", combo_entry_from_file
,
411 (GtkDestroyNotify
) gtk_widget_unref
);
412 gtk_widget_show (combo_entry_from_file
);
414 label_description
= gtk_label_new (_("description:"));
415 gtk_widget_ref (label_description
);
416 gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog
), "label_description", label_description
,
417 (GtkDestroyNotify
) gtk_widget_unref
);
418 gtk_widget_show (label_description
);
419 gtk_table_attach (GTK_TABLE (table1
), label_description
, 0, 1, 4, 5,
420 (GtkAttachOptions
) (GTK_FILL
),
421 (GtkAttachOptions
) (0), 0, 0);
422 gtk_widget_set_sensitive (label_description
, FALSE
);
423 gtk_label_set_justify (GTK_LABEL (label_description
), GTK_JUSTIFY_RIGHT
);
424 gtk_misc_set_alignment (GTK_MISC (label_description
), 0.77, 0.5);
426 radiobutton_sheet
= gtk_radio_button_new_with_label (table1_group
, _("Sheet name:"));
427 table1_group
= gtk_radio_button_group (GTK_RADIO_BUTTON (radiobutton_sheet
));
428 gtk_widget_ref (radiobutton_sheet
);
429 gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog
), "radiobutton_sheet", radiobutton_sheet
,
430 (GtkDestroyNotify
) gtk_widget_unref
);
431 gtk_widget_show (radiobutton_sheet
);
432 gtk_table_attach (GTK_TABLE (table1
), radiobutton_sheet
, 0, 1, 3, 4,
433 (GtkAttachOptions
) (GTK_FILL
),
434 (GtkAttachOptions
) (0), 0, 0);
436 entry_sheet_name
= gtk_entry_new ();
437 gtk_widget_ref (entry_sheet_name
);
438 gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog
), "entry_sheet_name", entry_sheet_name
,
439 (GtkDestroyNotify
) gtk_widget_unref
);
440 gtk_widget_show (entry_sheet_name
);
441 gtk_table_attach (GTK_TABLE (table1
), entry_sheet_name
, 1, 3, 3, 4,
442 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
443 (GtkAttachOptions
) (0), 0, 0);
444 gtk_widget_set_usize (entry_sheet_name
, 255, -2);
445 gtk_widget_set_sensitive (entry_sheet_name
, FALSE
);
447 radiobutton_line_break
= gtk_radio_button_new_with_label (table1_group
, _("Line Break"));
448 table1_group
= gtk_radio_button_group (GTK_RADIO_BUTTON (radiobutton_line_break
));
449 gtk_widget_ref (radiobutton_line_break
);
450 gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog
), "radiobutton_line_break", radiobutton_line_break
,
451 (GtkDestroyNotify
) gtk_widget_unref
);
452 gtk_widget_show (radiobutton_line_break
);
453 gtk_table_attach (GTK_TABLE (table1
), radiobutton_line_break
, 0, 1, 2, 3,
454 (GtkAttachOptions
) (GTK_FILL
),
455 (GtkAttachOptions
) (0), 0, 0);
457 entry_svg_description
= gtk_entry_new ();
458 gtk_widget_ref (entry_svg_description
);
459 gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog
), "entry_svg_description", entry_svg_description
,
460 (GtkDestroyNotify
) gtk_widget_unref
);
461 gtk_widget_show (entry_svg_description
);
462 gtk_table_attach (GTK_TABLE (table1
), entry_svg_description
, 1, 3, 1, 2,
463 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
464 (GtkAttachOptions
) (0), 0, 0);
466 entry_sheet_description
= gtk_entry_new ();
467 gtk_widget_ref (entry_sheet_description
);
468 gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog
), "entry_sheet_description", entry_sheet_description
,
469 (GtkDestroyNotify
) gtk_widget_unref
);
470 gtk_widget_show (entry_sheet_description
);
471 gtk_table_attach (GTK_TABLE (table1
), entry_sheet_description
, 1, 3, 4, 5,
472 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
473 (GtkAttachOptions
) (0), 0, 0);
474 gtk_widget_set_usize (entry_sheet_description
, 255, -2);
475 gtk_widget_set_sensitive (entry_sheet_description
, FALSE
);
477 label_svg_description
= gtk_label_new (_("description:"));
478 gtk_widget_ref (label_svg_description
);
479 gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog
), "label_svg_description", label_svg_description
,
480 (GtkDestroyNotify
) gtk_widget_unref
);
481 gtk_widget_show (label_svg_description
);
482 gtk_table_attach (GTK_TABLE (table1
), label_svg_description
, 0, 1, 1, 2,
483 (GtkAttachOptions
) (GTK_FILL
),
484 (GtkAttachOptions
) (0), 0, 0);
485 gtk_label_set_justify (GTK_LABEL (label_svg_description
), GTK_JUSTIFY_RIGHT
);
486 gtk_misc_set_alignment (GTK_MISC (label_svg_description
), 0.77, 0.5);
488 dialog_action_area2
= GTK_DIALOG (sheets_new_dialog
)->action_area
;
489 gtk_object_set_data (GTK_OBJECT (sheets_new_dialog
), "dialog_action_area2", dialog_action_area2
);
490 gtk_widget_show (dialog_action_area2
);
491 gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area2
), 10);
493 hbuttonbox1
= gtk_hbutton_box_new ();
494 gtk_widget_ref (hbuttonbox1
);
495 gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog
), "hbuttonbox1", hbuttonbox1
,
496 (GtkDestroyNotify
) gtk_widget_unref
);
497 gtk_widget_show (hbuttonbox1
);
498 gtk_box_pack_start (GTK_BOX (dialog_action_area2
), hbuttonbox1
, TRUE
, TRUE
, 0);
499 gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1
), GTK_BUTTONBOX_END
);
500 gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox1
), 0);
502 button_ok
= gtk_button_new_from_stock(GTK_STOCK_OK
);
503 gtk_widget_ref (button_ok
);
504 gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog
), "button_ok", button_ok
,
505 (GtkDestroyNotify
) gtk_widget_unref
);
506 gtk_widget_show (button_ok
);
507 gtk_container_add (GTK_CONTAINER (hbuttonbox1
), button_ok
);
508 GTK_WIDGET_SET_FLAGS (button_ok
, GTK_CAN_DEFAULT
);
510 button_cancel
= gtk_button_new_from_stock(GTK_STOCK_CANCEL
);
511 gtk_widget_ref (button_cancel
);
512 gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog
), "button_cancel", button_cancel
,
513 (GtkDestroyNotify
) gtk_widget_unref
);
514 gtk_widget_show (button_cancel
);
515 gtk_container_add (GTK_CONTAINER (hbuttonbox1
), button_cancel
);
516 GTK_WIDGET_SET_FLAGS (button_cancel
, GTK_CAN_DEFAULT
);
518 g_signal_connect (GTK_OBJECT (button_browse
), "clicked",
519 G_CALLBACK (on_sheets_new_dialog_button_browse_clicked
),
521 g_signal_connect (GTK_OBJECT (radiobutton_svg_shape
), "toggled",
522 G_CALLBACK (on_sheets_new_dialog_radiobutton_svg_shape_toggled
),
524 g_signal_connect (GTK_OBJECT (radiobutton_sheet
), "toggled",
525 G_CALLBACK (on_sheets_new_dialog_radiobutton_sheet_toggled
),
527 g_signal_connect (GTK_OBJECT (radiobutton_line_break
), "toggled",
528 G_CALLBACK (on_sheets_new_dialog_radiobutton_line_break_toggled
),
530 g_signal_connect (GTK_OBJECT (button_ok
), "clicked",
531 G_CALLBACK (on_sheets_new_dialog_button_ok_clicked
),
533 g_signal_connect (GTK_OBJECT (button_cancel
), "clicked",
534 G_CALLBACK (on_sheets_new_dialog_button_cancel_clicked
),
537 gtk_widget_grab_default (button_ok
);
538 return sheets_new_dialog
;
542 create_sheets_edit_dialog (void)
544 GtkWidget
*sheets_edit_dialog
;
545 GtkWidget
*dialog_vbox3
;
547 GtkWidget
*frame_object
;
549 GtkWidget
*label_object_description
;
550 GtkWidget
*entry_object_description
;
551 GtkWidget
*label_object_type
;
552 GtkWidget
*entry_object_type
;
553 GtkWidget
*frame_object_pixmap
;
554 GtkWidget
*pixmap_object
;
555 GtkWidget
*frame_sheet
;
557 GtkWidget
*label_sheet_name
;
558 GtkWidget
*entry_sheet_description
;
559 GtkWidget
*label_sheet_description
;
560 GtkWidget
*entry_sheet_name
;
561 GtkWidget
*dialog_action_area3
;
562 GtkWidget
*hbuttonbox2
;
563 GtkWidget
*button_ok
;
564 GtkWidget
*button_cancel
;
566 sheets_edit_dialog
= gtk_dialog_new ();
567 gtk_object_set_data (GTK_OBJECT (sheets_edit_dialog
), "sheets_edit_dialog", sheets_edit_dialog
);
568 gtk_container_set_border_width (GTK_CONTAINER (sheets_edit_dialog
), 5);
569 gtk_window_set_title (GTK_WINDOW (sheets_edit_dialog
), _("Edit Attributes"));
570 gtk_window_set_role (GTK_WINDOW (sheets_edit_dialog
), "sheets_edit_dialog");
571 gtk_window_set_resizable (GTK_WINDOW (sheets_edit_dialog
), FALSE
);
573 dialog_vbox3
= GTK_DIALOG (sheets_edit_dialog
)->vbox
;
574 gtk_object_set_data (GTK_OBJECT (sheets_edit_dialog
), "dialog_vbox3", dialog_vbox3
);
575 gtk_widget_show (dialog_vbox3
);
577 vbox1
= gtk_vbox_new (FALSE
, 0);
578 gtk_widget_ref (vbox1
);
579 gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog
), "vbox1", vbox1
,
580 (GtkDestroyNotify
) gtk_widget_unref
);
581 gtk_widget_show (vbox1
);
582 gtk_box_pack_start (GTK_BOX (dialog_vbox3
), vbox1
, TRUE
, TRUE
, 0);
584 frame_object
= gtk_frame_new (_("DiaObject"));
585 gtk_widget_ref (frame_object
);
586 gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog
), "frame_object", frame_object
,
587 (GtkDestroyNotify
) gtk_widget_unref
);
588 gtk_widget_show (frame_object
);
589 gtk_box_pack_start (GTK_BOX (vbox1
), frame_object
, TRUE
, TRUE
, 0);
591 table6
= gtk_table_new (3, 2, FALSE
);
592 gtk_widget_ref (table6
);
593 gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog
), "table6", table6
,
594 (GtkDestroyNotify
) gtk_widget_unref
);
595 gtk_widget_show (table6
);
596 gtk_container_add (GTK_CONTAINER (frame_object
), table6
);
597 gtk_container_set_border_width (GTK_CONTAINER (table6
), 5);
598 gtk_table_set_col_spacings (GTK_TABLE (table6
), 6);
600 label_object_description
= gtk_label_new (_("Description:"));
601 gtk_widget_ref (label_object_description
);
602 gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog
), "label_object_description", label_object_description
,
603 (GtkDestroyNotify
) gtk_widget_unref
);
604 gtk_widget_show (label_object_description
);
605 gtk_table_attach (GTK_TABLE (table6
), label_object_description
, 0, 1, 1, 2,
606 (GtkAttachOptions
) (GTK_FILL
),
607 (GtkAttachOptions
) (0), 0, 0);
608 gtk_misc_set_alignment (GTK_MISC (label_object_description
), 0, 0.5);
610 entry_object_description
= gtk_entry_new ();
611 gtk_widget_ref (entry_object_description
);
612 gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog
), "entry_object_description", entry_object_description
,
613 (GtkDestroyNotify
) gtk_widget_unref
);
614 gtk_widget_show (entry_object_description
);
615 gtk_table_attach (GTK_TABLE (table6
), entry_object_description
, 1, 2, 1, 2,
616 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
617 (GtkAttachOptions
) (0), 0, 0);
619 label_object_type
= gtk_label_new (_("Type:"));
620 gtk_widget_ref (label_object_type
);
621 gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog
), "label_object_type", label_object_type
,
622 (GtkDestroyNotify
) gtk_widget_unref
);
623 gtk_widget_show (label_object_type
);
624 gtk_table_attach (GTK_TABLE (table6
), label_object_type
, 0, 1, 2, 3,
625 (GtkAttachOptions
) (GTK_FILL
),
626 (GtkAttachOptions
) (0), 0, 0);
627 gtk_misc_set_alignment (GTK_MISC (label_object_type
), 0, 0.5);
629 entry_object_type
= gtk_entry_new ();
630 gtk_widget_ref (entry_object_type
);
631 gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog
), "entry_object_type", entry_object_type
,
632 (GtkDestroyNotify
) gtk_widget_unref
);
633 gtk_widget_show (entry_object_type
);
634 gtk_table_attach (GTK_TABLE (table6
), entry_object_type
, 1, 2, 2, 3,
635 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
636 (GtkAttachOptions
) (0), 0, 0);
637 gtk_widget_set_sensitive (entry_object_type
, FALSE
);
638 gtk_entry_set_editable (GTK_ENTRY (entry_object_type
), FALSE
);
640 frame_object_pixmap
= gtk_frame_new (NULL
);
641 gtk_widget_ref (frame_object_pixmap
);
642 gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog
), "frame_object_pixmap", frame_object_pixmap
,
643 (GtkDestroyNotify
) gtk_widget_unref
);
644 gtk_widget_show (frame_object_pixmap
);
645 gtk_table_attach (GTK_TABLE (table6
), frame_object_pixmap
, 0, 1, 0, 1,
646 (GtkAttachOptions
) (0),
647 (GtkAttachOptions
) (0), 0, 0);
648 gtk_frame_set_shadow_type (GTK_FRAME (frame_object_pixmap
), GTK_SHADOW_ETCHED_OUT
);
650 pixmap_object
= create_pixmap (sheets_edit_dialog
, NULL
, FALSE
);
651 gtk_widget_ref (pixmap_object
);
652 gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog
), "pixmap_object", pixmap_object
,
653 (GtkDestroyNotify
) gtk_widget_unref
);
654 gtk_widget_show (pixmap_object
);
655 gtk_container_add (GTK_CONTAINER (frame_object_pixmap
), pixmap_object
);
657 frame_sheet
= gtk_frame_new (_("Sheet"));
658 gtk_widget_ref (frame_sheet
);
659 gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog
), "frame_sheet", frame_sheet
,
660 (GtkDestroyNotify
) gtk_widget_unref
);
661 gtk_widget_show (frame_sheet
);
662 gtk_box_pack_start (GTK_BOX (vbox1
), frame_sheet
, TRUE
, TRUE
, 0);
664 table3
= gtk_table_new (2, 2, FALSE
);
665 gtk_widget_ref (table3
);
666 gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog
), "table3", table3
,
667 (GtkDestroyNotify
) gtk_widget_unref
);
668 gtk_widget_show (table3
);
669 gtk_container_add (GTK_CONTAINER (frame_sheet
), table3
);
670 gtk_container_set_border_width (GTK_CONTAINER (table3
), 5);
671 gtk_table_set_col_spacings (GTK_TABLE (table3
), 6);
673 label_sheet_name
= gtk_label_new (_("Name:"));
674 gtk_widget_ref (label_sheet_name
);
675 gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog
), "label_sheet_name", label_sheet_name
,
676 (GtkDestroyNotify
) gtk_widget_unref
);
677 gtk_widget_show (label_sheet_name
);
678 gtk_table_attach (GTK_TABLE (table3
), label_sheet_name
, 0, 1, 0, 1,
679 (GtkAttachOptions
) (GTK_FILL
),
680 (GtkAttachOptions
) (0), 0, 0);
681 gtk_label_set_justify (GTK_LABEL (label_sheet_name
), GTK_JUSTIFY_RIGHT
);
682 gtk_misc_set_alignment (GTK_MISC (label_sheet_name
), 0, 0.5);
684 entry_sheet_description
= gtk_entry_new ();
685 gtk_widget_ref (entry_sheet_description
);
686 gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog
), "entry_sheet_description", entry_sheet_description
,
687 (GtkDestroyNotify
) gtk_widget_unref
);
688 gtk_widget_show (entry_sheet_description
);
689 gtk_table_attach (GTK_TABLE (table3
), entry_sheet_description
, 1, 2, 1, 2,
690 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
691 (GtkAttachOptions
) (0), 0, 0);
693 label_sheet_description
= gtk_label_new (_("Description:"));
694 gtk_widget_ref (label_sheet_description
);
695 gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog
), "label_sheet_description", label_sheet_description
,
696 (GtkDestroyNotify
) gtk_widget_unref
);
697 gtk_widget_show (label_sheet_description
);
698 gtk_table_attach (GTK_TABLE (table3
), label_sheet_description
, 0, 1, 1, 2,
699 (GtkAttachOptions
) (GTK_FILL
),
700 (GtkAttachOptions
) (0), 0, 0);
701 gtk_misc_set_alignment (GTK_MISC (label_sheet_description
), 0, 0.5);
703 entry_sheet_name
= gtk_entry_new ();
704 gtk_widget_ref (entry_sheet_name
);
705 gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog
), "entry_sheet_name", entry_sheet_name
,
706 (GtkDestroyNotify
) gtk_widget_unref
);
707 gtk_widget_show (entry_sheet_name
);
708 gtk_table_attach (GTK_TABLE (table3
), entry_sheet_name
, 1, 2, 0, 1,
709 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
710 (GtkAttachOptions
) (0), 0, 0);
711 gtk_widget_set_usize (entry_sheet_name
, 220, -2);
713 dialog_action_area3
= GTK_DIALOG (sheets_edit_dialog
)->action_area
;
714 gtk_object_set_data (GTK_OBJECT (sheets_edit_dialog
), "dialog_action_area3", dialog_action_area3
);
715 gtk_widget_show (dialog_action_area3
);
716 gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area3
), 10);
718 hbuttonbox2
= gtk_hbutton_box_new ();
719 gtk_widget_ref (hbuttonbox2
);
720 gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog
), "hbuttonbox2", hbuttonbox2
,
721 (GtkDestroyNotify
) gtk_widget_unref
);
722 gtk_widget_show (hbuttonbox2
);
723 gtk_box_pack_start (GTK_BOX (dialog_action_area3
), hbuttonbox2
, TRUE
, TRUE
, 0);
724 gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox2
), GTK_BUTTONBOX_END
);
725 gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox2
), 0);
727 button_ok
= gtk_button_new_from_stock(GTK_STOCK_OK
);
728 gtk_widget_ref (button_ok
);
729 gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog
), "button_ok", button_ok
,
730 (GtkDestroyNotify
) gtk_widget_unref
);
731 gtk_widget_show (button_ok
);
732 gtk_container_add (GTK_CONTAINER (hbuttonbox2
), button_ok
);
733 GTK_WIDGET_SET_FLAGS (button_ok
, GTK_CAN_DEFAULT
);
735 button_cancel
= gtk_button_new_from_stock(GTK_STOCK_CANCEL
);
736 gtk_widget_ref (button_cancel
);
737 gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog
), "button_cancel", button_cancel
,
738 (GtkDestroyNotify
) gtk_widget_unref
);
739 gtk_widget_show (button_cancel
);
740 gtk_container_add (GTK_CONTAINER (hbuttonbox2
), button_cancel
);
741 GTK_WIDGET_SET_FLAGS (button_cancel
, GTK_CAN_DEFAULT
);
743 g_signal_connect (GTK_OBJECT (entry_object_description
), "changed",
744 G_CALLBACK (on_sheets_edit_dialog_entry_object_description_changed
),
746 g_signal_connect (GTK_OBJECT (entry_sheet_description
), "changed",
747 G_CALLBACK (on_sheets_edit_dialog_entry_sheet_description_changed
),
749 g_signal_connect (GTK_OBJECT (entry_sheet_name
), "changed",
750 G_CALLBACK (on_sheets_edit_dialog_entry_sheet_name_changed
),
752 g_signal_connect (GTK_OBJECT (button_ok
), "clicked",
753 G_CALLBACK (on_sheets_edit_dialog_button_ok_clicked
),
755 g_signal_connect (GTK_OBJECT (button_cancel
), "clicked",
756 G_CALLBACK (on_sheets_edit_dialog_button_cancel_clicked
),
759 gtk_widget_grab_default (button_ok
);
760 return sheets_edit_dialog
;
764 create_sheets_remove_dialog (void)
766 GtkWidget
*sheets_remove_dialog
;
767 GtkWidget
*dialog_vbox4
;
770 GSList
*table7_group
= NULL
;
771 GtkWidget
*radiobutton_object
;
772 GtkWidget
*frame_object_pixmap
;
773 GtkWidget
*pixmap_object
;
774 GtkWidget
*radiobutton_sheet
;
775 GtkWidget
*entry_object
;
776 GtkWidget
*entry_sheet
;
777 GtkWidget
*dialog_action_area4
;
778 GtkWidget
*hbuttonbox3
;
779 GtkWidget
*button_ok
;
780 GtkWidget
*button_cancel
;
782 sheets_remove_dialog
= gtk_dialog_new ();
783 gtk_object_set_data (GTK_OBJECT (sheets_remove_dialog
),
784 "sheets_remove_dialog", sheets_remove_dialog
);
785 gtk_window_set_title (GTK_WINDOW (sheets_remove_dialog
), _("Remove"));
786 gtk_window_set_default_size (GTK_WINDOW (sheets_remove_dialog
), 316, -1);
787 gtk_window_set_role (GTK_WINDOW (sheets_remove_dialog
),
788 "sheets_remove_dialog");
789 gtk_window_set_resizable (GTK_WINDOW (sheets_remove_dialog
), TRUE
);
791 dialog_vbox4
= GTK_DIALOG (sheets_remove_dialog
)->vbox
;
792 gtk_object_set_data (GTK_OBJECT (sheets_remove_dialog
), "dialog_vbox4", dialog_vbox4
);
793 gtk_widget_show (dialog_vbox4
);
795 frame
= gtk_frame_new (_("Type"));
796 gtk_widget_ref (frame
);
797 gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog
), "frame", frame
,
798 (GtkDestroyNotify
) gtk_widget_unref
);
799 gtk_widget_show (frame
);
800 gtk_box_pack_start (GTK_BOX (dialog_vbox4
), frame
, TRUE
, TRUE
, 0);
801 gtk_container_set_border_width (GTK_CONTAINER (frame
), 5);
803 table7
= gtk_table_new (3, 2, FALSE
);
804 gtk_widget_ref (table7
);
805 gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog
), "table7", table7
,
806 (GtkDestroyNotify
) gtk_widget_unref
);
807 gtk_widget_show (table7
);
808 gtk_container_add (GTK_CONTAINER (frame
), table7
);
810 radiobutton_object
= gtk_radio_button_new_with_label (table7_group
, _("DiaObject:"));
811 table7_group
= gtk_radio_button_group (GTK_RADIO_BUTTON (radiobutton_object
));
812 gtk_widget_ref (radiobutton_object
);
813 gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog
), "radiobutton_object", radiobutton_object
,
814 (GtkDestroyNotify
) gtk_widget_unref
);
815 gtk_widget_show (radiobutton_object
);
816 gtk_table_attach (GTK_TABLE (table7
), radiobutton_object
, 0, 1, 1, 2,
817 (GtkAttachOptions
) (GTK_FILL
),
818 (GtkAttachOptions
) (0), 0, 0);
820 frame_object_pixmap
= gtk_frame_new (NULL
);
821 gtk_widget_ref (frame_object_pixmap
);
822 gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog
), "frame_object_pixmap", frame_object_pixmap
,
823 (GtkDestroyNotify
) gtk_widget_unref
);
824 gtk_widget_show (frame_object_pixmap
);
825 gtk_table_attach (GTK_TABLE (table7
), frame_object_pixmap
, 0, 1, 0, 1,
826 (GtkAttachOptions
) (0),
827 (GtkAttachOptions
) (0), 0, 0);
828 gtk_frame_set_shadow_type (GTK_FRAME (frame_object_pixmap
), GTK_SHADOW_ETCHED_OUT
);
830 pixmap_object
= create_pixmap (sheets_remove_dialog
, NULL
, FALSE
);
831 gtk_widget_ref (pixmap_object
);
832 gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog
), "pixmap_object", pixmap_object
,
833 (GtkDestroyNotify
) gtk_widget_unref
);
834 gtk_widget_show (pixmap_object
);
835 gtk_container_add (GTK_CONTAINER (frame_object_pixmap
), pixmap_object
);
837 radiobutton_sheet
= gtk_radio_button_new_with_label (table7_group
, _("Sheet:"));
838 table7_group
= gtk_radio_button_group (GTK_RADIO_BUTTON (radiobutton_sheet
));
839 gtk_widget_ref (radiobutton_sheet
);
840 gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog
), "radiobutton_sheet", radiobutton_sheet
,
841 (GtkDestroyNotify
) gtk_widget_unref
);
842 gtk_widget_show (radiobutton_sheet
);
843 gtk_table_attach (GTK_TABLE (table7
), radiobutton_sheet
, 0, 1, 2, 3,
844 (GtkAttachOptions
) (GTK_FILL
),
845 (GtkAttachOptions
) (0), 0, 0);
847 entry_object
= gtk_entry_new ();
848 gtk_widget_ref (entry_object
);
849 gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog
), "entry_object", entry_object
,
850 (GtkDestroyNotify
) gtk_widget_unref
);
851 gtk_widget_show (entry_object
);
852 gtk_table_attach (GTK_TABLE (table7
), entry_object
, 1, 2, 1, 2,
853 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
854 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
), 0, 0);
855 gtk_entry_set_editable (GTK_ENTRY (entry_object
), FALSE
);
857 entry_sheet
= gtk_entry_new ();
858 gtk_widget_ref (entry_sheet
);
859 gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog
), "entry_sheet", entry_sheet
,
860 (GtkDestroyNotify
) gtk_widget_unref
);
861 gtk_widget_show (entry_sheet
);
862 gtk_table_attach (GTK_TABLE (table7
), entry_sheet
, 1, 2, 2, 3,
863 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
864 (GtkAttachOptions
) (0), 0, 0);
865 gtk_entry_set_editable (GTK_ENTRY (entry_sheet
), FALSE
);
867 dialog_action_area4
= GTK_DIALOG (sheets_remove_dialog
)->action_area
;
868 gtk_object_set_data (GTK_OBJECT (sheets_remove_dialog
), "dialog_action_area4", dialog_action_area4
);
869 gtk_widget_show (dialog_action_area4
);
870 gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area4
), 10);
872 hbuttonbox3
= gtk_hbutton_box_new ();
873 gtk_widget_ref (hbuttonbox3
);
874 gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog
), "hbuttonbox3", hbuttonbox3
,
875 (GtkDestroyNotify
) gtk_widget_unref
);
876 gtk_widget_show (hbuttonbox3
);
877 gtk_box_pack_start (GTK_BOX (dialog_action_area4
), hbuttonbox3
, TRUE
, TRUE
, 0);
878 gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox3
), GTK_BUTTONBOX_END
);
879 gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox3
), 0);
881 button_ok
= gtk_button_new_from_stock(GTK_STOCK_OK
);
882 gtk_widget_ref (button_ok
);
883 gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog
), "button_ok", button_ok
,
884 (GtkDestroyNotify
) gtk_widget_unref
);
885 gtk_widget_show (button_ok
);
886 gtk_container_add (GTK_CONTAINER (hbuttonbox3
), button_ok
);
887 GTK_WIDGET_SET_FLAGS (button_ok
, GTK_CAN_DEFAULT
);
889 button_cancel
= gtk_button_new_from_stock(GTK_STOCK_CANCEL
);
890 gtk_widget_ref (button_cancel
);
891 gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog
), "button_cancel", button_cancel
,
892 (GtkDestroyNotify
) gtk_widget_unref
);
893 gtk_widget_show (button_cancel
);
894 gtk_container_add (GTK_CONTAINER (hbuttonbox3
), button_cancel
);
895 GTK_WIDGET_SET_FLAGS (button_cancel
, GTK_CAN_DEFAULT
);
897 g_signal_connect (GTK_OBJECT (radiobutton_object
), "toggled",
898 G_CALLBACK (on_sheets_remove_dialog_radiobutton_object_toggled
),
900 g_signal_connect (GTK_OBJECT (radiobutton_sheet
), "toggled",
901 G_CALLBACK (on_sheets_remove_dialog_radiobutton_sheet_toggled
),
903 g_signal_connect (GTK_OBJECT (button_ok
), "clicked",
904 G_CALLBACK (on_sheets_remove_dialog_button_ok_clicked
),
906 g_signal_connect (GTK_OBJECT (button_cancel
), "clicked",
907 G_CALLBACK (on_sheets_remove_dialog_button_cancel_clicked
),
910 gtk_widget_grab_default (button_ok
);
911 return sheets_remove_dialog
;
915 create_sheets_shapeselection_dialog (void)
917 GtkWidget
*sheets_shapeselection_dialog
;
918 GtkWidget
*ok_button
;
919 GtkWidget
*cancel_button1
;
921 sheets_shapeselection_dialog
= gtk_file_selection_new (_("Select SVG Shape File"));
922 gtk_object_set_data (GTK_OBJECT (sheets_shapeselection_dialog
), "sheets_shapeselection_dialog", sheets_shapeselection_dialog
);
923 gtk_container_set_border_width (GTK_CONTAINER (sheets_shapeselection_dialog
), 10);
925 ok_button
= GTK_FILE_SELECTION (sheets_shapeselection_dialog
)->ok_button
;
926 gtk_object_set_data (GTK_OBJECT (sheets_shapeselection_dialog
), "ok_button", ok_button
);
927 gtk_widget_show (ok_button
);
928 GTK_WIDGET_SET_FLAGS (ok_button
, GTK_CAN_DEFAULT
);
930 cancel_button1
= GTK_FILE_SELECTION (sheets_shapeselection_dialog
)->cancel_button
;
931 gtk_object_set_data (GTK_OBJECT (sheets_shapeselection_dialog
), "cancel_button1", cancel_button1
);
932 gtk_widget_show (cancel_button1
);
933 GTK_WIDGET_SET_FLAGS (cancel_button1
, GTK_CAN_DEFAULT
);
935 g_signal_connect (GTK_OBJECT (ok_button
), "clicked",
936 G_CALLBACK (on_sheets_shapeselection_dialog_button_ok_clicked
),
938 g_signal_connect (GTK_OBJECT (cancel_button1
), "clicked",
939 G_CALLBACK (on_sheets_shapeselection_dialog_button_cancel_clicked
),
942 return sheets_shapeselection_dialog
;