1 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 c-style: "K&R" -*- */
3 /*----------------------------------------------------------------------
5 gpiv - Graphic program for Particle Image Velocimetry, based on gtk/gnome
8 Copyright (C) 2002 Gerber van der Graaf
10 This file is part of gpiv.
12 Gpiv is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2, or (at your option)
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 ----------------------------------------------------------------------*/
29 * $Log: preferences.c,v $
30 * Revision 1.5 2003-09-01 11:17:15 gerber
31 * improved monitoring of interrogation process
33 * Revision 1.4 2003/08/22 15:24:52 gerber
34 * interactive spatial scaling
36 * Revision 1.3 2003/07/25 15:40:24 gerber
37 * removed/disabled setting of correlation in Eval tab, Correlation type in Image info tab
39 * Revision 1.2 2003/06/27 13:47:26 gerber
40 * display ruler, line/point evaluation
42 * Revision 1.1.1.1 2003/06/17 17:10:52 gerber
54 #include "preferences.h"
55 #include "console_menus.h"
58 /* #include "console_interface.h" */
59 /* #include "console.h" */
60 /* #include "pivvalid_interface.h" */
63 GtkWidget
*create_preferences (GpivConsole
*gpiv
)
65 GtkWidget
*preferences
;
66 GtkWidget
*dialog_vbox1
;
69 GtkWidget
*frame_pref_view
;
71 /* GtkWidget *checkbutton_pref_menubar; */
72 /* GtkWidget *checkbutton_pref_toolbuttons; */
73 GtkWidget
*checkbutton_pref_gpivbuttons
;
74 GtkWidget
*checkbutton_pref_tab
;
75 GtkWidget
*frame_pref_io
;
77 GtkWidget
*checkbutton_pref_hdf
;
78 GtkWidget
*checkbutton_pref_hdfimg
;
79 GtkWidget
*checkbutton_pref_xcorr
;
82 GtkWidget
*label_pref_spinner_cols
;
83 GtkObject
*spinbutton_pref_cols_adj
;
84 GtkWidget
*spinbutton_pref_cols
;
87 GtkWidget
*label_pref_spinner_rows
;
88 GtkObject
*spinbutton_pref_rows_adj
;
89 GtkWidget
*spinbutton_pref_rows
;
93 GtkWidget
*checkbutton_pref_tooltips
;
94 GtkWidget
*frame_pref_processes
;
96 GtkWidget
*checkbutton_pref_process_piv
;
97 GtkWidget
*checkbutton_pref_process_gradient
;
98 GtkWidget
*checkbutton_pref_process_resstats
;
99 GtkWidget
*checkbutton_pref_process_errvec
;
100 GtkWidget
*checkbutton_pref_process_peaklck
;
101 GtkWidget
*checkbutton_pref_process_scale
;
102 GtkWidget
*checkbutton_pref_process_avg
;
103 GtkWidget
*checkbutton_pref_process_substract
;
104 GtkWidget
*checkbutton_pref_process_vorstra
;
106 GtkWidget
*label_pref_spinner_bins
;
107 GtkObject
*spinbutton_pref_bins_adj
;
108 GtkWidget
*spinbutton_pref_bins
;
112 GtkWidget
*pref_tab1
;
114 GtkWidget
*frame_pref_display_vecscale
;
115 GtkWidget
*vbox_pref_display_vecscale
;
116 GSList
*vecscale_group
= NULL
;
117 GtkWidget
*radiobutton_pref_display_vecscale1
;
118 GtkWidget
*radiobutton_pref_display_vecscale2
;
119 GtkWidget
*radiobutton_pref_display_vecscale3
;
120 GtkWidget
*radiobutton_pref_display_vecscale4
;
121 GtkWidget
*radiobutton_pref_display_vecscale5
;
122 GtkWidget
*radiobutton_pref_display_vecscale6
;
123 GtkWidget
*radiobutton_pref_display_vecscale7
;
127 GtkWidget
*frame_pref_display_zoomscale
;
128 GtkWidget
*vbox_pref_display_zoomscale
;
129 GSList
*zoomscale_group
= NULL
;
130 GtkWidget
*radiobutton_pref_display_zoomscale1
;
131 GtkWidget
*radiobutton_pref_display_zoomscale2
;
132 GtkWidget
*radiobutton_pref_display_zoomscale3
;
133 GtkWidget
*radiobutton_pref_display_zoomscale4
;
134 GtkWidget
*radiobutton_pref_display_zoomscale5
;
135 GtkWidget
*radiobutton_pref_display_zoomscale6
;
139 GtkWidget
*frame_pref_display_display
;
140 GtkWidget
*vbox_pref_display_display
;
141 GtkWidget
*checkbutton_pref_display_display_img1
;
142 GtkWidget
*checkbutton_pref_display_display_img2
;
143 GtkWidget
*checkbutton_pref_display_display_intregs
;
144 GtkWidget
*checkbutton_pref_display_display_piv
;
145 GtkWidget
*checkbutton_pref_display_display_vor
;
146 GtkWidget
*checkbutton_pref_display_display_sstrain
;
147 GtkWidget
*checkbutton_pref_display_display_nstrain
;
148 GtkWidget
*pref_tab2
;
150 /* GtkWidget *fontselection; */
151 /* GtkWidget *pref_tab3; */
153 GtkWidget
*dialog_action_area1
;
154 GtkWidget
*button_pref_ok
;
155 GtkWidget
*button_pref_apply
;
156 GtkWidget
*button_pref_cancel
;
159 /* gnome_dialog_new */
160 preferences
= gnome_dialog_new (_("Preferences"),
162 gtk_object_set_data (GTK_OBJECT (preferences
),
165 gnome_dialog_set_parent (GNOME_DIALOG (preferences
),
166 GTK_WINDOW (gpiv
->console
));
167 gtk_window_set_policy (GTK_WINDOW (preferences
),
171 gtk_window_set_wmclass (GTK_WINDOW (preferences
),
175 dialog_vbox1
= GNOME_DIALOG (preferences
)->vbox
;
176 gtk_object_set_data (GTK_OBJECT (preferences
),
179 gtk_widget_show (dialog_vbox1
);
183 notebook1
= gtk_notebook_new ();
184 gtk_widget_ref (notebook1
);
185 gtk_object_set_data_full (GTK_OBJECT (preferences
),
188 (GtkDestroyNotify
) gtk_widget_unref
);
189 gtk_widget_show (notebook1
);
190 gtk_box_pack_start (GTK_BOX (dialog_vbox1
),
197 * Interface tabulator
200 table1
= gtk_table_new (2,
203 gtk_widget_ref (table1
);
204 gtk_object_set_data_full (GTK_OBJECT (preferences
),
207 (GtkDestroyNotify
) gtk_widget_unref
);
208 gtk_widget_show (table1
);
209 gtk_container_add (GTK_CONTAINER (notebook1
),
214 frame_pref_view
= gtk_frame_new (_("View"));
215 gtk_widget_ref (frame_pref_view
);
216 gtk_object_set_data_full (GTK_OBJECT (preferences
),
219 (GtkDestroyNotify
) gtk_widget_unref
);
220 gtk_widget_show (frame_pref_view
);
221 gtk_table_attach (GTK_TABLE (table1
),
227 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
228 (GtkAttachOptions
) (GTK_FILL
),
234 vbox1
= gtk_vbox_new (FALSE
, 0);
235 gtk_widget_ref (vbox1
);
236 gtk_object_set_data_full (GTK_OBJECT (preferences
),
238 (GtkDestroyNotify
) gtk_widget_unref
);
239 gtk_widget_show (vbox1
);
240 gtk_container_add (GTK_CONTAINER (frame_pref_view
),
245 checkbutton_pref_gpivbuttons
=
246 gtk_check_button_new_with_label (_("gpiv buttons"));
247 gtk_widget_ref (checkbutton_pref_gpivbuttons
);
248 gtk_object_set_data_full (GTK_OBJECT (preferences
),
249 "checkbutton_pref_gpivbuttons",
250 checkbutton_pref_gpivbuttons
,
251 (GtkDestroyNotify
) gtk_widget_unref
);
252 if (default_par
.view_gpivbuttons
== 1) {
253 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
254 (checkbutton_pref_gpivbuttons
),
257 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
258 (checkbutton_pref_gpivbuttons
),
261 gtk_widget_show (checkbutton_pref_gpivbuttons
);
262 gtk_box_pack_start (GTK_BOX (vbox1
),
263 checkbutton_pref_gpivbuttons
,
268 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_gpivbuttons
), "clicked",
269 GTK_SIGNAL_FUNC (on_checkbutton_pref_gpivbuttons_activate
),
275 checkbutton_pref_tab
= gtk_check_button_new_with_label (_("tabulator"));
276 gtk_widget_ref (checkbutton_pref_tab
);
277 gtk_object_set_data_full (GTK_OBJECT (preferences
),
278 "checkbutton_pref_tab",
279 checkbutton_pref_tab
,
280 (GtkDestroyNotify
) gtk_widget_unref
);
281 if (default_par
.view_tabulator
== 1) {
282 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
283 (checkbutton_pref_tab
),
286 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
287 (checkbutton_pref_tab
),
290 gtk_widget_show (checkbutton_pref_tab
);
291 gtk_box_pack_start (GTK_BOX (vbox1
),
292 checkbutton_pref_tab
,
297 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_tab
), "clicked",
298 GTK_SIGNAL_FUNC (on_checkbutton_pref_tab_activate
),
304 frame_pref_io
= gtk_frame_new (_("In/output"));
305 gtk_widget_ref (frame_pref_io
);
306 gtk_object_set_data_full (GTK_OBJECT (preferences
),
309 (GtkDestroyNotify
) gtk_widget_unref
);
310 gtk_widget_show (frame_pref_io
);
311 gtk_table_attach (GTK_TABLE (table1
),
317 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
318 (GtkAttachOptions
) (GTK_FILL
),
324 vbox_io
= gtk_vbox_new (FALSE
, 0);
325 gtk_widget_ref (vbox_io
);
326 gtk_object_set_data_full (GTK_OBJECT (preferences
),
328 (GtkDestroyNotify
) gtk_widget_unref
);
329 gtk_widget_show (vbox_io
);
330 gtk_container_add (GTK_CONTAINER (frame_pref_io
),
334 checkbutton_pref_hdf
= gtk_check_button_new_with_label (_("HDF5 format (.gpi)"));
335 gtk_widget_ref (checkbutton_pref_hdf
);
336 gtk_object_set_data_full (GTK_OBJECT (preferences
),
337 "checkbutton_pref_hdf",
338 checkbutton_pref_hdf
,
339 (GtkDestroyNotify
) gtk_widget_unref
);
340 if (default_par
.hdf
== 1) {
341 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
342 (checkbutton_pref_hdf
),
345 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
346 (checkbutton_pref_hdf
),
349 gtk_widget_show (checkbutton_pref_hdf
);
350 gtk_box_pack_start (GTK_BOX (vbox_io
),
351 checkbutton_pref_hdf
,
356 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_hdf
), "clicked",
357 GTK_SIGNAL_FUNC (on_checkbutton_pref_hdf_activate
),
362 checkbutton_pref_hdfimg
= gtk_check_button_new_with_label (_("include image in .gpi"));
363 gtk_widget_ref (checkbutton_pref_hdf
);
364 gtk_object_set_data_full (GTK_OBJECT (preferences
),
365 "checkbutton_pref_hdfimg",
366 checkbutton_pref_hdfimg
,
367 (GtkDestroyNotify
) gtk_widget_unref
);
368 if (default_par
.hdf_img
== 1) {
369 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
370 (checkbutton_pref_hdfimg
),
373 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
374 (checkbutton_pref_hdfimg
),
377 gtk_widget_show (checkbutton_pref_hdfimg
);
378 gtk_box_pack_start (GTK_BOX (vbox_io
),
379 checkbutton_pref_hdfimg
,
384 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_hdfimg
), "clicked",
385 GTK_SIGNAL_FUNC (on_checkbutton_pref_hdfimg_activate
),
389 checkbutton_pref_xcorr
= gtk_check_button_new_with_label (_("cross-correlation"));
390 gtk_widget_ref (checkbutton_pref_hdf
);
391 gtk_object_set_data_full (GTK_OBJECT (preferences
),
392 "checkbutton_pref_xcorr",
393 checkbutton_pref_xcorr
,
394 (GtkDestroyNotify
) gtk_widget_unref
);
395 if (default_par
.x_corr
== 1) {
396 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
397 (checkbutton_pref_xcorr
),
400 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
401 (checkbutton_pref_xcorr
),
404 gtk_widget_show (checkbutton_pref_xcorr
);
405 gtk_box_pack_start (GTK_BOX (vbox_io
),
406 checkbutton_pref_xcorr
,
411 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_xcorr
), "clicked",
412 GTK_SIGNAL_FUNC (on_checkbutton_pref_xcorr_activate
),
417 * spinner for ncolumns
419 hbox_cols
= gtk_hbox_new (FALSE
,
421 gtk_widget_ref (hbox_cols
);
422 gtk_object_set_data_full (GTK_OBJECT (preferences
),
425 (GtkDestroyNotify
) gtk_widget_unref
);
426 gtk_widget_show (hbox_cols
);
427 gtk_box_pack_start (GTK_BOX (vbox_io
),
435 label_pref_spinner_cols
= gtk_label_new (_("img width: "));
436 gtk_widget_ref (label_pref_spinner_cols
);
437 gtk_object_set_data_full (GTK_OBJECT (preferences
),
438 "label_pref_spinner_cols",
439 label_pref_spinner_cols
,
440 (GtkDestroyNotify
) gtk_widget_unref
);
441 gtk_widget_show (label_pref_spinner_cols
);
442 gtk_box_pack_start (GTK_BOX (hbox_cols
),
443 label_pref_spinner_cols
,
450 spinbutton_pref_cols_adj
= gtk_adjustment_new (gpiv_par
.img_width
,
456 spinbutton_pref_cols
=
457 gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_pref_cols_adj
),
460 gtk_widget_ref (spinbutton_pref_cols
);
461 gtk_object_set_data_full (GTK_OBJECT (preferences
),
462 "spinbutton_pref_cols",
463 spinbutton_pref_cols
,
464 (GtkDestroyNotify
) gtk_widget_unref
);
465 gtk_widget_show (spinbutton_pref_cols
);
466 gtk_box_pack_start (GTK_BOX (hbox_cols
),
467 spinbutton_pref_cols
,
472 gtk_signal_connect (GTK_OBJECT (spinbutton_pref_cols
), "changed",
473 GTK_SIGNAL_FUNC (on_spinbutton_pref_cols_activate
),
480 hbox_rows
= gtk_hbox_new (FALSE
,
482 gtk_widget_ref (hbox_rows
);
483 gtk_object_set_data_full (GTK_OBJECT (preferences
),
486 (GtkDestroyNotify
) gtk_widget_unref
);
487 gtk_widget_show (hbox_rows
);
488 gtk_box_pack_start (GTK_BOX (vbox_io
),
496 label_pref_spinner_rows
= gtk_label_new (_("img height: "));
497 gtk_widget_ref (label_pref_spinner_rows
);
498 gtk_object_set_data_full (GTK_OBJECT (preferences
),
499 "label_pref_spinner_rows",
500 label_pref_spinner_rows
,
501 (GtkDestroyNotify
) gtk_widget_unref
);
502 gtk_widget_show (label_pref_spinner_rows
);
503 gtk_box_pack_start (GTK_BOX (hbox_rows
),
504 label_pref_spinner_rows
,
511 spinbutton_pref_rows_adj
= gtk_adjustment_new (gpiv_par
.img_height
,
517 spinbutton_pref_rows
=
518 gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_pref_rows_adj
),
521 gtk_widget_ref (spinbutton_pref_rows
);
522 gtk_object_set_data_full (GTK_OBJECT (preferences
),
523 "spinbutton_pref_rows",
524 spinbutton_pref_rows
,
525 (GtkDestroyNotify
) gtk_widget_unref
);
526 gtk_widget_show (spinbutton_pref_rows
);
527 gtk_box_pack_start (GTK_BOX (hbox_rows
),
528 spinbutton_pref_rows
,
533 gtk_signal_connect (GTK_OBJECT (spinbutton_pref_rows
), "changed",
534 GTK_SIGNAL_FUNC (on_spinbutton_pref_rows_activate
),
539 * General; tooltips and histogram bins
541 checkbutton_pref_tooltips
= gtk_check_button_new_with_label (_("tooltips"));
542 gtk_widget_ref (checkbutton_pref_tooltips
);
543 gtk_object_set_data_full (GTK_OBJECT (preferences
),
544 "checkbutton_pref_tooltips",
545 checkbutton_pref_tooltips
,
546 (GtkDestroyNotify
) gtk_widget_unref
);
547 if (default_par
.show_tooltips
== 1) {
548 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
549 (checkbutton_pref_tooltips
),
552 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
553 (checkbutton_pref_tooltips
),
556 gtk_widget_show (checkbutton_pref_tooltips
);
557 gtk_table_attach (GTK_TABLE (table1
),
558 checkbutton_pref_tooltips
,
563 (GtkAttachOptions
) (GTK_FILL
),
564 (GtkAttachOptions
) (0),
568 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_tooltips
), "clicked",
569 GTK_SIGNAL_FUNC (on_checkbutton_pref_tooltips_activate
),
575 frame_pref_processes
= gtk_frame_new (_("processes"));
576 gtk_widget_ref (frame_pref_processes
);
577 gtk_object_set_data_full (GTK_OBJECT (preferences
),
578 "frame_pref_processes",
579 frame_pref_processes
,
580 (GtkDestroyNotify
) gtk_widget_unref
);
581 gtk_widget_show (frame_pref_processes
);
582 gtk_table_attach (GTK_TABLE (table1
),
583 frame_pref_processes
,
588 (GtkAttachOptions
) (GTK_FILL
),
589 (GtkAttachOptions
) (GTK_FILL
),
595 vbox2
= gtk_vbox_new (FALSE
,
597 gtk_widget_ref (vbox2
);
598 gtk_object_set_data_full (GTK_OBJECT (preferences
),
601 (GtkDestroyNotify
) gtk_widget_unref
);
602 gtk_widget_show (vbox2
);
603 gtk_container_add (GTK_CONTAINER (frame_pref_processes
),
608 checkbutton_pref_process_piv
= gtk_check_button_new_with_label (_("piv"));
609 gtk_widget_ref (checkbutton_pref_process_piv
);
610 gtk_object_set_data_full (GTK_OBJECT (preferences
),
611 "checkbutton_pref_process_piv",
612 checkbutton_pref_process_piv
,
613 (GtkDestroyNotify
) gtk_widget_unref
);
614 if (default_par
.process_piv
) {
615 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON
616 (checkbutton_pref_process_piv
),
619 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON
620 (checkbutton_pref_process_piv
),
623 gtk_widget_show (checkbutton_pref_process_piv
);
624 gtk_box_pack_start (GTK_BOX (vbox2
),
625 checkbutton_pref_process_piv
,
630 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_process_piv
), "clicked",
631 GTK_SIGNAL_FUNC (on_checkbutton_pref_process_piv_activate
),
637 checkbutton_pref_process_gradient
=
638 gtk_check_button_new_with_label (_("gradient"));
639 gtk_widget_ref (checkbutton_pref_process_gradient
);
640 gtk_object_set_data_full (GTK_OBJECT (preferences
),
641 "checkbutton_pref_process_gradient",
642 checkbutton_pref_process_gradient
,
643 (GtkDestroyNotify
) gtk_widget_unref
);
644 if (default_par
.process_gradient
) {
645 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
646 (checkbutton_pref_process_gradient
),
649 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
650 (checkbutton_pref_process_gradient
),
653 gtk_widget_show (checkbutton_pref_process_gradient
);
654 gtk_box_pack_start (GTK_BOX (vbox2
),
655 checkbutton_pref_process_gradient
,
660 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_process_gradient
), "clicked",
661 GTK_SIGNAL_FUNC (on_checkbutton_pref_process_gradient_activate
),
667 checkbutton_pref_process_resstats
=
668 gtk_check_button_new_with_label (_("residu stats"));
669 gtk_widget_ref (checkbutton_pref_process_resstats
);
670 gtk_object_set_data_full (GTK_OBJECT (preferences
),
671 "checkbutton_pref_process_resstats",
672 checkbutton_pref_process_resstats
,
673 (GtkDestroyNotify
) gtk_widget_unref
);
674 if (default_par
.process_resstats
) {
675 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
676 (checkbutton_pref_process_resstats
),
679 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
680 (checkbutton_pref_process_resstats
),
683 gtk_widget_show (checkbutton_pref_process_resstats
);
684 gtk_box_pack_start (GTK_BOX (vbox2
),
685 checkbutton_pref_process_resstats
,
690 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_process_resstats
), "clicked",
691 GTK_SIGNAL_FUNC (on_checkbutton_pref_process_resstats_activate
),
697 checkbutton_pref_process_errvec
=
698 gtk_check_button_new_with_label (_("validate"));
699 gtk_widget_ref (checkbutton_pref_process_errvec
);
700 gtk_object_set_data_full (GTK_OBJECT (preferences
),
701 "checkbutton_pref_process_errvec",
702 checkbutton_pref_process_errvec
,
703 (GtkDestroyNotify
) gtk_widget_unref
);
704 if (default_par
.process_errvec
) {
705 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
706 (checkbutton_pref_process_errvec
),
709 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
710 (checkbutton_pref_process_errvec
),
713 gtk_widget_show (checkbutton_pref_process_errvec
);
714 gtk_box_pack_start (GTK_BOX (vbox2
),
715 checkbutton_pref_process_errvec
,
720 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_process_errvec
), "clicked",
721 GTK_SIGNAL_FUNC (on_checkbutton_pref_process_errvec_activate
),
727 checkbutton_pref_process_peaklck
=
728 gtk_check_button_new_with_label (_("peaklock"));
729 gtk_widget_ref (checkbutton_pref_process_peaklck
);
730 gtk_object_set_data_full (GTK_OBJECT (preferences
),
731 "checkbutton_pref_process_peaklck",
732 checkbutton_pref_process_peaklck
,
733 (GtkDestroyNotify
) gtk_widget_unref
);
734 if (default_par
.process_peaklock
) {
735 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
736 (checkbutton_pref_process_peaklck
),
739 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
740 (checkbutton_pref_process_peaklck
),
743 gtk_widget_show (checkbutton_pref_process_peaklck
);
744 gtk_box_pack_start (GTK_BOX (vbox2
),
745 checkbutton_pref_process_peaklck
,
750 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_process_peaklck
), "clicked",
751 GTK_SIGNAL_FUNC (on_checkbutton_pref_process_peaklck_activate
),
756 checkbutton_pref_process_scale
=
757 gtk_check_button_new_with_label (_("scaling"));
758 gtk_widget_ref (checkbutton_pref_process_scale
);
759 gtk_object_set_data_full (GTK_OBJECT (preferences
),
760 "checkbutton_pref_process_scale",
761 checkbutton_pref_process_scale
,
762 (GtkDestroyNotify
) gtk_widget_unref
);
763 if (default_par
.process_scale
) {
764 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
765 (checkbutton_pref_process_scale
),
768 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
769 (checkbutton_pref_process_scale
),
772 gtk_widget_show (checkbutton_pref_process_scale
);
773 gtk_box_pack_start (GTK_BOX (vbox2
),
774 checkbutton_pref_process_scale
,
779 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_process_scale
), "clicked",
780 GTK_SIGNAL_FUNC (on_checkbutton_pref_process_scale_activate
),
786 checkbutton_pref_process_avg
=
787 gtk_check_button_new_with_label (_("average"));
788 gtk_widget_ref (checkbutton_pref_process_avg
);
789 gtk_object_set_data_full (GTK_OBJECT (preferences
),
790 "checkbutton_pref_process_avg",
791 checkbutton_pref_process_avg
,
792 (GtkDestroyNotify
) gtk_widget_unref
);
793 if (default_par
.process_average
) {
794 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
795 (checkbutton_pref_process_avg
),
798 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
799 (checkbutton_pref_process_avg
),
802 gtk_widget_show (checkbutton_pref_process_avg
);
803 gtk_box_pack_start (GTK_BOX (vbox2
),
804 checkbutton_pref_process_avg
,
809 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_process_avg
), "clicked",
810 GTK_SIGNAL_FUNC (on_checkbutton_pref_process_avg_activate
),
816 checkbutton_pref_process_substract
=
817 gtk_check_button_new_with_label (_("substract"));
818 gtk_widget_ref (checkbutton_pref_process_substract
);
819 gtk_object_set_data_full (GTK_OBJECT (preferences
),
820 "checkbutton_pref_process_substract",
821 checkbutton_pref_process_substract
,
822 (GtkDestroyNotify
) gtk_widget_unref
);
823 if (default_par
.process_substract
) {
824 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
825 (checkbutton_pref_process_substract
),
828 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
829 (checkbutton_pref_process_substract
),
832 gtk_widget_show (checkbutton_pref_process_substract
);
833 gtk_box_pack_start (GTK_BOX (vbox2
),
834 checkbutton_pref_process_substract
,
839 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_process_substract
), "clicked",
840 GTK_SIGNAL_FUNC (on_checkbutton_pref_process_substract_activate
),
846 checkbutton_pref_process_vorstra
=
847 gtk_check_button_new_with_label (_("vorticity"));
848 gtk_widget_ref (checkbutton_pref_process_vorstra
);
849 gtk_object_set_data_full (GTK_OBJECT (preferences
),
850 "checkbutton_pref_process_vorstra",
851 checkbutton_pref_process_vorstra
,
852 (GtkDestroyNotify
) gtk_widget_unref
);
853 if (default_par
.process_vorstra
) {
854 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
855 (checkbutton_pref_process_vorstra
),
858 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
859 (checkbutton_pref_process_vorstra
),
862 gtk_widget_show (checkbutton_pref_process_vorstra
);
863 gtk_box_pack_start (GTK_BOX (vbox2
),
864 checkbutton_pref_process_vorstra
,
869 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_process_vorstra
), "clicked",
870 GTK_SIGNAL_FUNC (on_checkbutton_pref_process_vorstra_activate
),
876 hbox1
= gtk_hbox_new (FALSE
,
878 gtk_widget_ref (hbox1
);
879 gtk_object_set_data_full (GTK_OBJECT (preferences
),
882 (GtkDestroyNotify
) gtk_widget_unref
);
883 gtk_widget_show (hbox1
);
884 gtk_table_attach (GTK_TABLE (table1
),
890 (GtkAttachOptions
) (GTK_FILL
),
891 (GtkAttachOptions
) (GTK_FILL
),
897 label_pref_spinner_bins
= gtk_label_new (_("number of histogram bins: "));
898 gtk_widget_ref (label_pref_spinner_bins
);
899 gtk_object_set_data_full (GTK_OBJECT (preferences
),
900 "label_pref_spinner_bins",
901 label_pref_spinner_bins
,
902 (GtkDestroyNotify
) gtk_widget_unref
);
903 gtk_widget_show (label_pref_spinner_bins
);
904 gtk_box_pack_start (GTK_BOX (hbox1
),
905 label_pref_spinner_bins
,
912 spinbutton_pref_bins_adj
= gtk_adjustment_new (10,
918 spinbutton_pref_bins
=
919 gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_pref_bins_adj
),
922 gtk_widget_ref (spinbutton_pref_bins
);
923 gtk_object_set_data_full (GTK_OBJECT (preferences
),
924 "spinbutton_pref_bins",
925 spinbutton_pref_bins
,
926 (GtkDestroyNotify
) gtk_widget_unref
);
927 gtk_widget_show (spinbutton_pref_bins
);
928 gtk_box_pack_start (GTK_BOX (hbox1
),
929 spinbutton_pref_bins
,
934 gtk_signal_connect (GTK_OBJECT (spinbutton_pref_bins
), "changed",
935 GTK_SIGNAL_FUNC (on_spinbutton_pref_bins_activate
),
940 pref_tab1
= gtk_label_new (_("console"));
941 gtk_widget_ref (pref_tab1
);
942 gtk_object_set_data_full (GTK_OBJECT (preferences
),
945 (GtkDestroyNotify
) gtk_widget_unref
);
946 gtk_widget_show (pref_tab1
);
947 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1
),
948 gtk_notebook_get_nth_page
949 (GTK_NOTEBOOK (notebook1
),
959 table2
= gtk_table_new (1,
962 gtk_widget_ref (table2
);
963 gtk_object_set_data_full (GTK_OBJECT (preferences
),
966 (GtkDestroyNotify
) gtk_widget_unref
);
967 gtk_widget_show (table2
);
968 gtk_container_add (GTK_CONTAINER (notebook1
),
975 frame_pref_display_vecscale
= gtk_frame_new (_("vector scale"));
976 gtk_widget_ref (frame_pref_display_vecscale
);
977 gtk_object_set_data_full (GTK_OBJECT (preferences
),
978 "frame_pref_display_vecscale",
979 frame_pref_display_vecscale
,
980 (GtkDestroyNotify
) gtk_widget_unref
);
981 gtk_widget_show (frame_pref_display_vecscale
);
982 gtk_table_attach (GTK_TABLE (table2
),
983 frame_pref_display_vecscale
,
988 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
989 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
994 vbox_pref_display_vecscale
= gtk_vbox_new(FALSE
,
996 gtk_widget_ref(vbox_pref_display_vecscale
);
997 gtk_object_set_data_full(GTK_OBJECT(gpiv
->console
),
998 "vbox_pref_display_vecscale",
999 vbox_pref_display_vecscale
,
1000 (GtkDestroyNotify
) gtk_widget_unref
);
1001 gtk_widget_show(vbox_pref_display_vecscale
);
1002 gtk_container_add(GTK_CONTAINER(frame_pref_display_vecscale
),
1003 vbox_pref_display_vecscale
);
1007 radiobutton_pref_display_vecscale1
=
1008 gtk_radio_button_new_with_label(vecscale_group
,
1011 gtk_radio_button_group(GTK_RADIO_BUTTON
1012 (radiobutton_pref_display_vecscale1
));
1013 gtk_widget_ref(radiobutton_pref_display_vecscale1
);
1014 gtk_object_set_data_full(GTK_OBJECT(gpiv
->console
),
1015 "radiobutton_pref_display_vecscale1",
1016 radiobutton_pref_display_vecscale1
,
1017 (GtkDestroyNotify
) gtk_widget_unref
);
1018 if (default_par
.vector_scale
== 1) {
1019 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1020 (radiobutton_pref_display_vecscale1
),
1023 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1024 (radiobutton_pref_display_vecscale1
),
1028 gtk_widget_show(radiobutton_pref_display_vecscale1
);
1029 gtk_box_pack_start(GTK_BOX(vbox_pref_display_vecscale
),
1030 radiobutton_pref_display_vecscale1
,
1034 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_vecscale1
),
1041 radiobutton_pref_display_vecscale2
=
1042 gtk_radio_button_new_with_label(vecscale_group
, _("2"));
1044 gtk_radio_button_group(GTK_RADIO_BUTTON
1045 (radiobutton_pref_display_vecscale2
));
1046 gtk_widget_ref(radiobutton_pref_display_vecscale2
);
1047 gtk_object_set_data_full(GTK_OBJECT(gpiv
->console
),
1048 "radiobutton_pref_display_vecscale2",
1049 radiobutton_pref_display_vecscale2
,
1050 (GtkDestroyNotify
) gtk_widget_unref
);
1051 if (default_par
.vector_scale
== 2) {
1052 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1053 (radiobutton_pref_display_vecscale2
),
1056 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1057 (radiobutton_pref_display_vecscale2
),
1060 gtk_widget_show(radiobutton_pref_display_vecscale2
);
1061 gtk_box_pack_start(GTK_BOX(vbox_pref_display_vecscale
),
1062 radiobutton_pref_display_vecscale2
,
1066 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_vecscale2
),
1073 radiobutton_pref_display_vecscale3
=
1074 gtk_radio_button_new_with_label(vecscale_group
, _("4"));
1076 gtk_radio_button_group(GTK_RADIO_BUTTON
1077 (radiobutton_pref_display_vecscale3
));
1078 gtk_widget_ref(radiobutton_pref_display_vecscale3
);
1079 gtk_object_set_data_full(GTK_OBJECT(gpiv
->console
),
1080 "radiobutton_pref_display_vecscale3",
1081 radiobutton_pref_display_vecscale3
,
1082 (GtkDestroyNotify
) gtk_widget_unref
);
1083 if (default_par
.vector_scale
== 4) {
1084 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1085 (radiobutton_pref_display_vecscale3
),
1088 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1089 (radiobutton_pref_display_vecscale3
),
1092 gtk_widget_show(radiobutton_pref_display_vecscale3
);
1093 gtk_box_pack_start(GTK_BOX(vbox_pref_display_vecscale
),
1094 radiobutton_pref_display_vecscale3
,
1098 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_vecscale3
),
1105 radiobutton_pref_display_vecscale4
=
1106 gtk_radio_button_new_with_label(vecscale_group
, _("8"));
1108 gtk_radio_button_group(GTK_RADIO_BUTTON
1109 (radiobutton_pref_display_vecscale4
));
1110 gtk_widget_ref(radiobutton_pref_display_vecscale4
);
1111 gtk_object_set_data_full(GTK_OBJECT(gpiv
->console
),
1112 "radiobutton_pref_display_vecscale4",
1113 radiobutton_pref_display_vecscale4
,
1114 (GtkDestroyNotify
) gtk_widget_unref
);
1115 if (default_par
.vector_scale
== 8) {
1116 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1117 (radiobutton_pref_display_vecscale4
),
1120 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1121 (radiobutton_pref_display_vecscale4
),
1124 gtk_widget_show(radiobutton_pref_display_vecscale4
);
1125 gtk_box_pack_start(GTK_BOX(vbox_pref_display_vecscale
),
1126 radiobutton_pref_display_vecscale4
,
1130 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_vecscale4
),
1137 radiobutton_pref_display_vecscale5
=
1138 gtk_radio_button_new_with_label(vecscale_group
, _("16"));
1140 gtk_radio_button_group(GTK_RADIO_BUTTON
1141 (radiobutton_pref_display_vecscale5
));
1142 gtk_widget_ref(radiobutton_pref_display_vecscale5
);
1143 gtk_object_set_data_full(GTK_OBJECT(gpiv
->console
),
1144 "radiobutton_pref_display_vecscale5",
1145 radiobutton_pref_display_vecscale5
,
1146 (GtkDestroyNotify
) gtk_widget_unref
);
1147 if (default_par
.vector_scale
== 16) {
1148 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1149 (radiobutton_pref_display_vecscale5
),
1152 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1153 (radiobutton_pref_display_vecscale5
),
1156 gtk_widget_show(radiobutton_pref_display_vecscale5
);
1157 gtk_box_pack_start(GTK_BOX(vbox_pref_display_vecscale
),
1158 radiobutton_pref_display_vecscale5
, FALSE
, FALSE
, 0);
1159 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_vecscale5
),
1166 radiobutton_pref_display_vecscale6
=
1167 gtk_radio_button_new_with_label(vecscale_group
, _("32"));
1169 gtk_radio_button_group(GTK_RADIO_BUTTON
1170 (radiobutton_pref_display_vecscale6
));
1171 gtk_widget_ref(radiobutton_pref_display_vecscale6
);
1172 gtk_object_set_data_full(GTK_OBJECT(gpiv
->console
),
1173 "radiobutton_pref_display_vecscale6",
1174 radiobutton_pref_display_vecscale6
,
1175 (GtkDestroyNotify
) gtk_widget_unref
);
1176 if (default_par
.vector_scale
== 32) {
1177 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1178 (radiobutton_pref_display_vecscale6
),
1181 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1182 (radiobutton_pref_display_vecscale6
),
1185 gtk_widget_show(radiobutton_pref_display_vecscale6
);
1186 gtk_box_pack_start(GTK_BOX(vbox_pref_display_vecscale
),
1187 radiobutton_pref_display_vecscale6
, FALSE
, FALSE
, 0);
1188 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_vecscale6
),
1195 radiobutton_pref_display_vecscale7
=
1196 gtk_radio_button_new_with_label(vecscale_group
, _("64"));
1198 gtk_radio_button_group(GTK_RADIO_BUTTON
1199 (radiobutton_pref_display_vecscale7
));
1200 gtk_widget_ref(radiobutton_pref_display_vecscale7
);
1201 gtk_object_set_data_full(GTK_OBJECT(gpiv
->console
),
1202 "radiobutton_pref_display_vecscale7",
1203 radiobutton_pref_display_vecscale7
,
1204 (GtkDestroyNotify
) gtk_widget_unref
);
1205 if (default_par
.vector_scale
== 64) {
1206 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1207 (radiobutton_pref_display_vecscale7
),
1210 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1211 (radiobutton_pref_display_vecscale7
),
1214 gtk_widget_show(radiobutton_pref_display_vecscale7
);
1215 gtk_box_pack_start(GTK_BOX(vbox_pref_display_vecscale
),
1216 radiobutton_pref_display_vecscale7
, FALSE
, FALSE
, 0);
1217 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_vecscale7
),
1225 frame_pref_display_zoomscale
= gtk_frame_new (_("zoom scale"));
1226 gtk_widget_ref (frame_pref_display_zoomscale
);
1227 gtk_object_set_data_full (GTK_OBJECT (preferences
),
1228 "frame_pref_display_zoomscale",
1229 frame_pref_display_zoomscale
,
1230 (GtkDestroyNotify
) gtk_widget_unref
);
1231 gtk_widget_show (frame_pref_display_zoomscale
);
1232 gtk_table_attach (GTK_TABLE (table2
), frame_pref_display_zoomscale
,
1237 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
1238 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
1243 vbox_pref_display_zoomscale
= gtk_vbox_new(FALSE
, 0);
1244 gtk_widget_ref(vbox_pref_display_zoomscale
);
1245 gtk_object_set_data_full(GTK_OBJECT(gpiv
->console
),
1246 "vbox_pref_display_zoomscale",
1247 vbox_pref_display_zoomscale
,
1248 (GtkDestroyNotify
) gtk_widget_unref
);
1249 gtk_widget_show(vbox_pref_display_zoomscale
);
1250 gtk_container_add(GTK_CONTAINER(frame_pref_display_zoomscale
),
1251 vbox_pref_display_zoomscale
);
1255 radiobutton_pref_display_zoomscale1
=
1256 gtk_radio_button_new_with_label(zoomscale_group
, _("0.5"));
1258 gtk_radio_button_group(GTK_RADIO_BUTTON
1259 (radiobutton_pref_display_zoomscale1
));
1260 gtk_widget_ref(radiobutton_pref_display_zoomscale1
);
1261 gtk_object_set_data_full(GTK_OBJECT(gpiv
->console
),
1262 "radiobutton_pref_display_zoomscale1",
1263 radiobutton_pref_display_zoomscale1
,
1264 (GtkDestroyNotify
) gtk_widget_unref
);
1265 if (default_par
.zoom_index
== ZOOM_0
) {
1266 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1267 (radiobutton_pref_display_zoomscale1
),
1270 /* gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON */
1271 /* (radiobutton_pref_display_zoomscale1), FALSE); */
1273 gtk_widget_show(radiobutton_pref_display_zoomscale1
);
1274 gtk_box_pack_start(GTK_BOX(vbox_pref_display_zoomscale
),
1275 radiobutton_pref_display_zoomscale1
,
1279 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_zoomscale1
),
1286 radiobutton_pref_display_zoomscale2
=
1287 gtk_radio_button_new_with_label(zoomscale_group
, _("0.83"));
1289 gtk_radio_button_group(GTK_RADIO_BUTTON
1290 (radiobutton_pref_display_zoomscale2
));
1291 gtk_widget_ref(radiobutton_pref_display_zoomscale2
);
1292 gtk_object_set_data_full(GTK_OBJECT(gpiv
->console
),
1293 "radiobutton_pref_display_zoomscale2",
1294 radiobutton_pref_display_zoomscale2
,
1295 (GtkDestroyNotify
) gtk_widget_unref
);
1296 if (default_par
.zoom_index
== ZOOM_1
) {
1297 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1298 (radiobutton_pref_display_zoomscale2
),
1301 /* gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON */
1302 /* (radiobutton_pref_display_zoomscale2), FALSE); */
1304 gtk_widget_show(radiobutton_pref_display_zoomscale2
);
1305 gtk_box_pack_start(GTK_BOX(vbox_pref_display_zoomscale
),
1306 radiobutton_pref_display_zoomscale2
,
1310 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_zoomscale2
),
1317 radiobutton_pref_display_zoomscale3
=
1318 gtk_radio_button_new_with_label(zoomscale_group
, _("1.0"));
1320 gtk_radio_button_group(GTK_RADIO_BUTTON
1321 (radiobutton_pref_display_zoomscale3
));
1322 gtk_widget_ref(radiobutton_pref_display_zoomscale3
);
1323 gtk_object_set_data_full(GTK_OBJECT(gpiv
->console
),
1324 "radiobutton_pref_display_zoomscale3",
1325 radiobutton_pref_display_zoomscale3
,
1326 (GtkDestroyNotify
) gtk_widget_unref
);
1327 if (default_par
.zoom_index
== ZOOM_2
) {
1328 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1329 (radiobutton_pref_display_zoomscale3
),
1332 /* gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON */
1333 /* (radiobutton_pref_display_zoomscale3), FALSE); */
1335 gtk_widget_show(radiobutton_pref_display_zoomscale3
);
1336 gtk_box_pack_start(GTK_BOX(vbox_pref_display_zoomscale
),
1337 radiobutton_pref_display_zoomscale3
,
1341 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_zoomscale3
),
1348 radiobutton_pref_display_zoomscale4
=
1349 gtk_radio_button_new_with_label(zoomscale_group
, _("1.3"));
1351 gtk_radio_button_group(GTK_RADIO_BUTTON
1352 (radiobutton_pref_display_zoomscale4
));
1353 gtk_widget_ref(radiobutton_pref_display_zoomscale4
);
1354 gtk_object_set_data_full(GTK_OBJECT(gpiv
->console
),
1355 "radiobutton_pref_display_zoomscale4",
1356 radiobutton_pref_display_zoomscale4
,
1357 (GtkDestroyNotify
) gtk_widget_unref
);
1358 if (default_par
.zoom_index
== ZOOM_3
) {
1359 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1360 (radiobutton_pref_display_zoomscale4
),
1363 /* gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON */
1364 /* (radiobutton_pref_display_zoomscale4), FALSE); */
1366 gtk_widget_show(radiobutton_pref_display_zoomscale4
);
1367 gtk_box_pack_start(GTK_BOX(vbox_pref_display_zoomscale
),
1368 radiobutton_pref_display_zoomscale4
,
1372 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_zoomscale4
),
1379 radiobutton_pref_display_zoomscale5
=
1380 gtk_radio_button_new_with_label(zoomscale_group
, _("1.6"));
1382 gtk_radio_button_group(GTK_RADIO_BUTTON
1383 (radiobutton_pref_display_zoomscale5
));
1384 gtk_widget_ref(radiobutton_pref_display_zoomscale5
);
1385 gtk_object_set_data_full(GTK_OBJECT(gpiv
->console
),
1386 "radiobutton_pref_display_zoomscale5",
1387 radiobutton_pref_display_zoomscale5
,
1388 (GtkDestroyNotify
) gtk_widget_unref
);
1389 if (default_par
.zoom_index
== ZOOM_4
) {
1390 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1391 (radiobutton_pref_display_zoomscale5
),
1394 /* gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON */
1395 /* (radiobutton_pref_display_zoomscale5), FALSE); */
1397 gtk_widget_show(radiobutton_pref_display_zoomscale5
);
1398 gtk_box_pack_start(GTK_BOX(vbox_pref_display_zoomscale
),
1399 radiobutton_pref_display_zoomscale5
,
1403 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_zoomscale5
),
1410 radiobutton_pref_display_zoomscale6
=
1411 gtk_radio_button_new_with_label(zoomscale_group
, _("2.0"));
1413 gtk_radio_button_group(GTK_RADIO_BUTTON
1414 (radiobutton_pref_display_zoomscale6
));
1415 gtk_widget_ref(radiobutton_pref_display_zoomscale6
);
1416 gtk_object_set_data_full(GTK_OBJECT(gpiv
->console
),
1417 "radiobutton_pref_display_zoomscale6",
1418 radiobutton_pref_display_zoomscale6
,
1419 (GtkDestroyNotify
) gtk_widget_unref
);
1420 if (default_par
.zoom_index
== ZOOM_5
) {
1421 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1422 (radiobutton_pref_display_zoomscale6
),
1425 /* gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON */
1426 /* (radiobutton_pref_display_zoomscale6), FALSE); */
1428 gtk_widget_show(radiobutton_pref_display_zoomscale6
);
1429 gtk_box_pack_start(GTK_BOX(vbox_pref_display_zoomscale
),
1430 radiobutton_pref_display_zoomscale6
,
1434 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_zoomscale6
),
1440 * Hide and display data
1443 frame_pref_display_display
= gtk_frame_new (_("hide/display data"));
1444 gtk_widget_ref (frame_pref_display_display
);
1445 gtk_object_set_data_full (GTK_OBJECT (preferences
),
1446 "frame_pref_display_display",
1447 frame_pref_display_display
,
1448 (GtkDestroyNotify
) gtk_widget_unref
);
1449 gtk_widget_show (frame_pref_display_display
);
1450 gtk_table_attach (GTK_TABLE (table2
),
1451 frame_pref_display_display
,
1456 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
1457 (GtkAttachOptions
) (GTK_FILL
),
1461 vbox_pref_display_display
= gtk_vbox_new (FALSE
, 0);
1462 gtk_widget_ref (vbox_pref_display_display
);
1463 gtk_object_set_data_full (GTK_OBJECT (preferences
),
1464 "vbox_pref_display_display",
1465 vbox_pref_display_display
,
1466 (GtkDestroyNotify
) gtk_widget_unref
);
1467 gtk_widget_show (vbox_pref_display_display
);
1468 gtk_container_add (GTK_CONTAINER (frame_pref_display_display
),
1469 vbox_pref_display_display
);
1473 checkbutton_pref_display_display_img1
=
1474 gtk_check_button_new_with_label (_("image A"));
1475 gtk_widget_ref (checkbutton_pref_display_display_img1
);
1476 gtk_object_set_data_full (GTK_OBJECT (preferences
),
1477 "checkbutton_pref_display_display_img1",
1478 checkbutton_pref_display_display_img1
,
1479 (GtkDestroyNotify
) gtk_widget_unref
);
1480 if (default_par
.display_img1
== 1) {
1481 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1482 (checkbutton_pref_display_display_img1
),
1485 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1486 (checkbutton_pref_display_display_img1
),
1489 gtk_widget_show (checkbutton_pref_display_display_img1
);
1490 gtk_box_pack_start (GTK_BOX (vbox_pref_display_display
),
1491 checkbutton_pref_display_display_img1
,
1498 checkbutton_pref_display_display_img2
=
1499 gtk_check_button_new_with_label (_("image B"));
1500 gtk_widget_ref (checkbutton_pref_display_display_img2
);
1501 gtk_object_set_data_full (GTK_OBJECT (preferences
),
1502 "checkbutton_pref_display_display_img2",
1503 checkbutton_pref_display_display_img2
,
1504 (GtkDestroyNotify
) gtk_widget_unref
);
1505 if (default_par
.display_img2
== 1) {
1506 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1507 (checkbutton_pref_display_display_img2
),
1510 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1511 (checkbutton_pref_display_display_img2
),
1514 gtk_widget_show (checkbutton_pref_display_display_img2
);
1515 gtk_box_pack_start (GTK_BOX (vbox_pref_display_display
),
1516 checkbutton_pref_display_display_img2
,
1523 checkbutton_pref_display_display_intregs
=
1524 gtk_check_button_new_with_label (_("Interrogation area's"));
1525 gtk_widget_ref (checkbutton_pref_display_display_intregs
);
1526 gtk_object_set_data_full (GTK_OBJECT (preferences
),
1527 "checkbutton_pref_display_display_intregs",
1528 checkbutton_pref_display_display_intregs
,
1529 (GtkDestroyNotify
) gtk_widget_unref
);
1530 if (default_par
.display_intregs
== 1) {
1531 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1532 (checkbutton_pref_display_display_intregs
),
1535 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1536 (checkbutton_pref_display_display_intregs
),
1539 gtk_widget_show (checkbutton_pref_display_display_intregs
);
1540 gtk_box_pack_start (GTK_BOX (vbox_pref_display_display
),
1541 checkbutton_pref_display_display_intregs
,
1548 checkbutton_pref_display_display_piv
=
1549 gtk_check_button_new_with_label (_("Velocity vectors"));
1550 gtk_widget_ref (checkbutton_pref_display_display_piv
);
1551 gtk_object_set_data_full (GTK_OBJECT (preferences
),
1552 "checkbutton_pref_display_display_piv",
1553 checkbutton_pref_display_display_piv
,
1554 (GtkDestroyNotify
) gtk_widget_unref
);
1555 if (default_par
.display_piv
) {
1556 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1557 (checkbutton_pref_display_display_piv
),
1560 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1561 (checkbutton_pref_display_display_piv
),
1564 gtk_widget_show (checkbutton_pref_display_display_piv
);
1565 gtk_box_pack_start (GTK_BOX (vbox_pref_display_display
),
1566 checkbutton_pref_display_display_piv
,
1573 checkbutton_pref_display_display_vor
=
1574 gtk_check_button_new_with_label (_("Vorticity"));
1575 gtk_widget_ref (checkbutton_pref_display_display_vor
);
1576 gtk_object_set_data_full (GTK_OBJECT (preferences
),
1577 "checkbutton_pref_display_display_vor",
1578 checkbutton_pref_display_display_vor
,
1579 (GtkDestroyNotify
) gtk_widget_unref
);
1580 if (default_par
.display_vor
) {
1581 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1582 (checkbutton_pref_display_display_vor
),
1585 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1586 (checkbutton_pref_display_display_vor
),
1589 gtk_widget_show (checkbutton_pref_display_display_vor
);
1590 gtk_box_pack_start (GTK_BOX (vbox_pref_display_display
),
1591 checkbutton_pref_display_display_vor
,
1598 checkbutton_pref_display_display_sstrain
=
1599 gtk_check_button_new_with_label (_("Shear strain"));
1600 gtk_widget_ref (checkbutton_pref_display_display_sstrain
);
1601 gtk_object_set_data_full (GTK_OBJECT (preferences
),
1602 "checkbutton_pref_display_display_sstrain",
1603 checkbutton_pref_display_display_sstrain
,
1604 (GtkDestroyNotify
) gtk_widget_unref
);
1605 if (default_par
.display_sstrain
== 1) {
1606 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1607 (checkbutton_pref_display_display_sstrain
),
1610 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1611 (checkbutton_pref_display_display_sstrain
),
1614 gtk_widget_show (checkbutton_pref_display_display_sstrain
);
1615 gtk_box_pack_start (GTK_BOX (vbox_pref_display_display
),
1616 checkbutton_pref_display_display_sstrain
, FALSE
, FALSE
, 0);
1619 checkbutton_pref_display_display_nstrain
=
1620 gtk_check_button_new_with_label (_("Normal strain"));
1621 gtk_widget_ref (checkbutton_pref_display_display_nstrain
);
1622 gtk_object_set_data_full (GTK_OBJECT (preferences
),
1623 "checkbutton_pref_display_display_nstrain",
1624 checkbutton_pref_display_display_nstrain
,
1625 (GtkDestroyNotify
) gtk_widget_unref
);
1626 if (default_par
.display_nstrain
== 1) {
1627 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1628 (checkbutton_pref_display_display_nstrain
),
1631 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1632 (checkbutton_pref_display_display_nstrain
),
1635 gtk_widget_show (checkbutton_pref_display_display_nstrain
);
1636 gtk_box_pack_start (GTK_BOX (vbox_pref_display_display
),
1637 checkbutton_pref_display_display_nstrain
,
1648 pref_tab2
= gtk_label_new (_("display"));
1649 gtk_widget_ref (pref_tab2
);
1650 gtk_object_set_data_full (GTK_OBJECT (preferences
),
1653 (GtkDestroyNotify
) gtk_widget_unref
);
1654 gtk_widget_show (pref_tab2
);
1655 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1
),
1656 gtk_notebook_get_nth_page
1657 (GTK_NOTEBOOK (notebook1
), 1),
1663 * Font selection tabulator
1666 /* fontselection = gtk_font_selection_new (); */
1667 /* gtk_widget_ref (fontselection); */
1668 /* gtk_object_set_data_full (GTK_OBJECT (preferences), "fontselection", fontselection, */
1669 /* (GtkDestroyNotify) gtk_widget_unref); */
1670 /* gtk_widget_show (fontselection); */
1671 /* gtk_container_add (GTK_CONTAINER (notebook1), fontselection); */
1673 /* pref_tab3 = gtk_label_new (_("fonts")); */
1674 /* gtk_widget_ref (pref_tab3); */
1675 /* gtk_object_set_data_full (GTK_OBJECT (preferences), "pref_tab3", pref_tab3, */
1676 /* (GtkDestroyNotify) gtk_widget_unref); */
1677 /* gtk_widget_show (pref_tab3); */
1678 /* gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 2), pref_tab3); */
1682 * Dialog area with "OK", "Apply and "Cancel" buttons
1685 dialog_action_area1
= GNOME_DIALOG (preferences
)->action_area
;
1686 gtk_object_set_data (GTK_OBJECT (preferences
),
1687 "dialog_action_area1",
1688 dialog_action_area1
);
1689 gtk_widget_show (dialog_action_area1
);
1690 gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1
),
1692 gtk_button_box_set_spacing (GTK_BUTTON_BOX (dialog_action_area1
),
1697 gnome_dialog_append_button (GNOME_DIALOG (preferences
),
1698 GNOME_STOCK_BUTTON_OK
);
1700 GTK_WIDGET (g_list_last (GNOME_DIALOG (preferences
)->buttons
)->data
);
1701 gtk_widget_ref (button_pref_ok
);
1702 gtk_object_set_data_full (GTK_OBJECT (preferences
),
1705 (GtkDestroyNotify
) gtk_widget_unref
);
1706 gtk_widget_show (button_pref_ok
);
1707 GTK_WIDGET_SET_FLAGS (button_pref_ok
,
1709 gtk_tooltips_set_tip(gpiv
->tooltips
, button_pref_ok
,
1710 _("Updates parameters and save as defaults"),
1713 gtk_object_set_data(GTK_OBJECT(button_pref_ok
),
1716 gtk_signal_connect (GTK_OBJECT (button_pref_ok
), "clicked",
1717 GTK_SIGNAL_FUNC (on_button_pref_ok
),
1722 gnome_dialog_append_button (GNOME_DIALOG (preferences
),
1723 GNOME_STOCK_BUTTON_APPLY
);
1725 GTK_WIDGET (g_list_last (GNOME_DIALOG (preferences
)->buttons
)->data
);
1726 gtk_widget_ref (button_pref_apply
);
1727 gtk_object_set_data_full (GTK_OBJECT (preferences
),
1728 "button_pref_apply",
1730 (GtkDestroyNotify
) gtk_widget_unref
);
1731 gtk_widget_show (button_pref_apply
);
1732 GTK_WIDGET_SET_FLAGS (button_pref_apply
, GTK_CAN_DEFAULT
);
1733 gtk_tooltips_set_tip(gpiv
->tooltips
, button_pref_apply
,
1734 _("Updates actual parameters, do not store as defaults"),
1737 gtk_object_set_data(GTK_OBJECT(button_pref_apply
),
1740 gtk_signal_connect (GTK_OBJECT (button_pref_apply
), "clicked",
1741 GTK_SIGNAL_FUNC (on_button_pref_apply
),
1746 gnome_dialog_append_button (GNOME_DIALOG (preferences
),
1747 GNOME_STOCK_BUTTON_CANCEL
);
1748 button_pref_cancel
=
1749 GTK_WIDGET (g_list_last (GNOME_DIALOG (preferences
)->buttons
)->data
);
1750 gtk_widget_ref (button_pref_cancel
);
1751 gtk_object_set_data_full (GTK_OBJECT (preferences
),
1752 "button_pref_cancel",
1754 (GtkDestroyNotify
) gtk_widget_unref
);
1755 gtk_widget_show (button_pref_cancel
);
1756 GTK_WIDGET_SET_FLAGS (button_pref_cancel
,
1758 gtk_tooltips_set_tip(gpiv
->tooltips
,
1760 _("Close preferences window"),
1763 gtk_signal_connect (GTK_OBJECT (button_pref_cancel
),
1765 GTK_SIGNAL_FUNC (on_button_pref_cancel
),
1770 * Display callback functions
1774 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_vecscale1
),
1776 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_vecscale
),
1778 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_vecscale2
),
1780 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_vecscale
),
1782 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_vecscale3
),
1784 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_vecscale
),
1786 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_vecscale4
),
1788 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_vecscale
),
1790 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_vecscale5
),
1792 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_vecscale
),
1794 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_vecscale6
),
1796 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_vecscale
),
1798 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_vecscale7
),
1800 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_vecscale
),
1806 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_zoomscale1
),
1808 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_zoomscale
),
1810 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_zoomscale2
),
1812 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_zoomscale
),
1814 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_zoomscale3
),
1816 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_zoomscale
),
1818 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_zoomscale4
),
1820 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_zoomscale
),
1822 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_zoomscale5
),
1824 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_zoomscale
),
1826 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_zoomscale6
),
1828 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_zoomscale
),
1834 gtk_signal_connect (GTK_OBJECT(checkbutton_pref_display_display_img1
),
1836 GTK_SIGNAL_FUNC(on_checkbutton_pref_display_display_img1
),
1838 gtk_signal_connect (GTK_OBJECT(checkbutton_pref_display_display_img2
),
1840 GTK_SIGNAL_FUNC(on_checkbutton_pref_display_display_img2
),
1842 gtk_signal_connect (GTK_OBJECT(checkbutton_pref_display_display_intregs
), "toggled",
1843 GTK_SIGNAL_FUNC(on_checkbutton_pref_display_display_intregs
),
1845 gtk_signal_connect (GTK_OBJECT(checkbutton_pref_display_display_piv
),
1847 GTK_SIGNAL_FUNC(on_checkbutton_pref_display_display_piv
),
1849 gtk_signal_connect (GTK_OBJECT(checkbutton_pref_display_display_vor
),
1851 GTK_SIGNAL_FUNC(on_checkbutton_pref_display_display_vor
),
1853 gtk_signal_connect (GTK_OBJECT(checkbutton_pref_display_display_sstrain
),
1855 GTK_SIGNAL_FUNC(on_checkbutton_pref_display_display_sstrain
),
1857 gtk_signal_connect (GTK_OBJECT(checkbutton_pref_display_display_nstrain
),
1859 GTK_SIGNAL_FUNC(on_checkbutton_pref_display_display_nstrain
),
1869 on_checkbutton_pref_gpivbuttons_activate(GtkWidget
*widget
,
1872 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
1873 default_par
.view_gpivbuttons
= 1;
1875 default_par
.view_gpivbuttons
= 0;
1881 on_checkbutton_pref_tab_activate(GtkWidget
*widget
,
1884 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
1885 default_par
.view_tabulator
= 1;
1887 default_par
.view_tabulator
= 0;
1893 on_checkbutton_pref_hdf_activate(GtkWidget
*widget
,
1896 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
1897 default_par
.hdf
= 1;
1899 default_par
.hdf
= 0;
1905 on_checkbutton_pref_hdfimg_activate(GtkWidget
*widget
,
1908 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
1909 default_par
.hdf_img
= 1;
1911 default_par
.hdf_img
= 0;
1917 on_checkbutton_pref_xcorr_activate(GtkWidget
*widget
,
1920 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
1921 default_par
.x_corr
= 1;
1923 default_par
.x_corr
= 0;
1929 on_spinbutton_pref_cols_activate(GtkSpinButton
* widget
,
1932 default_par
.img_width
=
1933 gtk_spin_button_get_value_as_int(widget
);
1938 on_spinbutton_pref_rows_activate(GtkSpinButton
* widget
,
1941 default_par
.img_height
=
1942 gtk_spin_button_get_value_as_int(widget
);
1948 on_checkbutton_pref_tooltips_activate(GtkWidget
*widget
,
1951 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
1952 default_par
.show_tooltips
= 1;
1954 default_par
.show_tooltips
= 0;
1960 on_checkbutton_pref_process_piv_activate(GtkWidget
*widget
,
1963 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
1964 default_par
.process_piv
= TRUE
;
1966 default_par
.process_piv
= FALSE
;
1972 on_checkbutton_pref_process_gradient_activate(GtkWidget
*widget
,
1975 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
1976 default_par
.process_gradient
= TRUE
;
1978 default_par
.process_gradient
= FALSE
;
1986 on_checkbutton_pref_process_resstats_activate(GtkWidget
*widget
,
1989 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
1990 default_par
.process_resstats
= TRUE
;
1992 default_par
.process_resstats
= FALSE
;
1999 on_checkbutton_pref_process_errvec_activate(GtkWidget
*widget
,
2002 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
2003 default_par
.process_peaklock
= TRUE
;
2005 default_par
.process_peaklock
= FALSE
;
2012 on_checkbutton_pref_process_peaklck_activate(GtkWidget
*widget
,
2015 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
2016 default_par
.process_peaklock
= TRUE
;
2018 default_par
.process_peaklock
= FALSE
;
2025 on_checkbutton_pref_process_substract_activate(GtkWidget
*widget
,
2028 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
2029 default_par
.process_substract
= TRUE
;
2031 default_par
.process_substract
= FALSE
;
2038 on_checkbutton_pref_process_scale_activate(GtkWidget
*widget
,
2041 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
2042 default_par
.process_scale
= TRUE
;
2044 default_par
.process_scale
= FALSE
;
2050 on_checkbutton_pref_process_avg_activate(GtkWidget
*widget
,
2053 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
2054 default_par
.process_average
= TRUE
;
2056 default_par
.process_average
= FALSE
;
2062 on_checkbutton_pref_process_vorstra_activate(GtkWidget
*widget
,
2065 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
2066 default_par
.process_vorstra
= TRUE
;
2068 default_par
.process_vorstra
= FALSE
;
2073 on_spinbutton_pref_bins_activate(GtkWidget
*widget
,
2080 on_radiobutton_pref_display_vecscale(GtkWidget
*widget
,
2083 default_par
.vector_scale
= atoi(gtk_object_get_data(GTK_OBJECT(widget
),
2090 on_radiobutton_pref_display_zoomscale(GtkWidget
*widget
,
2093 default_par
.zoom_index
= atoi(gtk_object_get_data(GTK_OBJECT(widget
),
2100 on_checkbutton_pref_display_display_img1(GtkWidget
*widget
,
2103 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
2104 default_par
.display_img1
= 1;
2106 default_par
.display_img1
= 0;
2111 on_checkbutton_pref_display_display_img2(GtkWidget
*widget
,
2114 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
2115 default_par
.display_img2
= 1;
2117 default_par
.display_img2
= 0;
2122 on_checkbutton_pref_display_display_intregs(GtkWidget
*widget
,
2125 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
2126 default_par
.display_intregs
= TRUE
;
2128 default_par
.display_intregs
= FALSE
;
2133 on_checkbutton_pref_display_display_piv(GtkWidget
*widget
,
2136 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
2137 default_par
.display_piv
= TRUE
;
2139 default_par
.display_piv
= FALSE
;
2144 on_checkbutton_pref_display_display_vor(GtkWidget
*widget
,
2147 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
2148 default_par
.display_vor
= TRUE
;
2150 default_par
.display_vor
= FALSE
;
2155 on_checkbutton_pref_display_display_sstrain(GtkWidget
*widget
,
2158 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
2159 default_par
.display_sstrain
= TRUE
;
2161 default_par
.display_sstrain
= FALSE
;
2166 on_checkbutton_pref_display_display_nstrain(GtkWidget
*widget
,
2169 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
2170 default_par
.display_nstrain
= TRUE
;
2172 default_par
.display_nstrain
= FALSE
;
2184 on_button_pref_ok(GtkWidget
*widget
,
2186 /* --------------------------------------------------------------------
2187 updates parameters, set as defaults and closes preferences window */
2189 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT(widget
), "gpiv");
2191 apply_gpivpar(gpiv
);
2195 gtk_warning(_("In order to affect image width and height,\n"
2199 gnome_dialog_close(GNOME_DIALOG(gpiv_preferences
));
2205 on_button_pref_apply(GtkWidget
*widget
,
2207 /* --------------------------------------------------------------------
2208 updates parameters */
2210 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT(widget
), "gpiv");
2211 apply_gpivpar(gpiv
);
2212 if (img_set
) gtk_warning(_("In order to change image width and height,\n"
2213 "press OK button and restart GPIV"));
2217 on_button_pref_cancel(GtkWidget
*widget
,
2219 /* --------------------------------------------------------------------
2220 updates parameters and closes preferences window */
2222 gnome_dialog_close(GNOME_DIALOG(gpiv_preferences
));
2229 apply_gpivpar(GpivConsole
* gpiv
)
2230 /* --------------------------------------------------------------------
2231 Updates actual parameters */
2233 GtkWidget
*settings_menu_gpiv0
=
2234 gtk_object_get_data(GTK_OBJECT(gpiv
->console
), "settings_menu_gpiv0");
2235 GtkWidget
*settings_menu_gpiv1
=
2236 gtk_object_get_data(GTK_OBJECT(gpiv
->console
), "settings_menu_gpiv1");
2239 gpiv_par
.show_tooltips
= default_par
.show_tooltips
;
2240 gpiv_par
.view_tabulator
= default_par
.view_tabulator
;
2241 gpiv_par
.view_gpivbuttons
= default_par
.view_gpivbuttons
;
2242 gpiv_par
.nbins
= default_par
.nbins
;
2243 gpiv_par
.process_piv
= default_par
.process_piv
;
2244 gpiv_par
.process_gradient
= default_par
.process_gradient
;
2245 gpiv_par
.process_resstats
= default_par
.process_resstats
;
2246 gpiv_par
.process_errvec
= default_par
.process_errvec
;
2247 gpiv_par
.process_peaklock
= default_par
.process_peaklock
;
2248 gpiv_par
.process_scale
= default_par
.process_scale
;
2249 gpiv_par
.process_average
= default_par
.process_average
;
2250 gpiv_par
.process_substract
= default_par
.process_substract
;
2251 gpiv_par
.process_vorstra
= default_par
.process_vorstra
;
2252 gpiv_par
.vector_scale
= default_par
.vector_scale
;
2253 gpiv_par
.zoom_index
= default_par
.zoom_index
;
2254 gpiv_par
.display_img1
= default_par
.display_img1
;
2255 gpiv_par
.display_img2
= default_par
.display_img2
;
2256 gpiv_par
.display_intregs
= default_par
.display_intregs
;
2257 gpiv_par
.display_piv
= default_par
.display_piv
;
2258 gpiv_par
.display_vor
= default_par
.display_vor
;
2259 gpiv_par
.display_sstrain
= default_par
.display_sstrain
;
2260 gpiv_par
.display_nstrain
= default_par
.display_nstrain
;
2261 gpiv_par
.hdf
= default_par
.hdf
;
2262 gpiv_par
.hdf_img
= default_par
.hdf_img
;
2263 gpiv_par
.x_corr
= default_par
.x_corr
;
2266 if (default_par
.view_gpivbuttons
== 1) {
2267 gtk_widget_show(gpiv
->handlebox1
);
2268 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
2269 (settings_menu_gpiv0
), TRUE
);
2271 gtk_widget_hide(gpiv
->handlebox1
);
2272 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
2273 (settings_menu_gpiv0
), FALSE
);
2276 if (default_par
.view_tabulator
== 1) {
2277 gtk_widget_show(gpiv
->notebook
);
2278 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
2279 (settings_menu_gpiv1
), TRUE
);
2281 gtk_widget_hide(gpiv
->notebook
);
2282 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
2283 (settings_menu_gpiv1
), FALSE
);
2286 if (default_par
.show_tooltips
== 1) {
2287 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
2288 (help_menu_gpiv
[0].widget
), TRUE
);
2289 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
2290 (help_menu_gpiv_popup
[0].widget
), TRUE
);
2292 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
2293 (help_menu_gpiv
[0].widget
), FALSE
);
2294 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
2295 (help_menu_gpiv_popup
[0].widget
), FALSE
);
2298 gtk_spin_button_set_value(GTK_SPIN_BUTTON
2299 (gpiv
->pivvalid
->spinbutton_peaklck_bins
),
2305 if (default_par
.process_piv
) {
2306 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON
2307 (gpiv
->button_toolbar_piv
), TRUE
);
2309 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON
2310 (gpiv
->button_toolbar_piv
), FALSE
);
2313 if (default_par
.process_gradient
) {
2314 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2315 (gpiv
->button_toolbar_gradient
), TRUE
);
2317 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2318 (gpiv
->button_toolbar_gradient
), FALSE
);
2321 if (default_par
.process_resstats
) {
2322 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2323 (gpiv
->button_toolbar_resstats
), TRUE
);
2325 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2326 (gpiv
->button_toolbar_resstats
), FALSE
);
2329 if (default_par
.process_errvec
) {
2330 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2331 (gpiv
->button_toolbar_errvec
), TRUE
);
2333 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2334 (gpiv
->button_toolbar_errvec
), FALSE
);
2337 if (default_par
.process_peaklock
) {
2338 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2339 (gpiv
->button_toolbar_peaklock
), TRUE
);
2341 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2342 (gpiv
->button_toolbar_peaklock
), FALSE
);
2345 if (default_par
.process_scale
) {
2346 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2347 (gpiv
->button_toolbar_scale
), TRUE
);
2349 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2350 (gpiv
->button_toolbar_scale
), FALSE
);
2353 if (default_par
.process_average
) {
2354 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2355 (gpiv
->button_toolbar_average
), TRUE
);
2357 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2358 (gpiv
->button_toolbar_average
), FALSE
);
2361 if (default_par
.process_substract
) {
2362 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2363 (gpiv
->button_toolbar_subavg
), TRUE
);
2365 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2366 (gpiv
->button_toolbar_subavg
), FALSE
);
2369 if (default_par
.process_vorstra
) {
2370 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2371 (gpiv
->button_toolbar_vorstra
), TRUE
);
2373 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2374 (gpiv
->button_toolbar_vorstra
), FALSE
);
2377 if (nbufs
> 0 && display_act
->gpd
.exist_piv
&& display_act
->display_piv
) {
2378 update_all_vectors(&display_act
->gpd
);
2381 if (display_act
!= NULL
) {
2383 /* if (default_par.zoom_index == ZOOM_0) { */
2384 /* zoomfactor = 0.5; */
2385 /* } else if (default_par.zoom_index == ZOOM_1) { */
2386 /* zoomfactor = 0.83; */
2387 /* } else if (default_par.zoom_index == ZOOM_2) { */
2388 /* zoomfactor = 1.0; */
2389 /* } else if (default_par.zoom_index == ZOOM_3) { */
2390 /* zoomfactor = 1.3; */
2391 /* } else if (default_par.zoom_index == ZOOM_4) { */
2392 /* zoomfactor = 1.6; */
2393 /* } else if (default_par.zoom_index == ZOOM_5) { */
2394 /* zoomfactor = 2.0; */
2396 /* g_warning ("select_zoomscale:: unvalid zoomfacor"); */
2399 /* update_all_displays(&display_act->gpd); */
2402 if (display_act
->display_intregs
) {
2403 if (default_par
.display_intregs
== 1) {
2404 create_all_intregs2(display_act
);
2405 create_all_intregs1(display_act
);
2407 hide_all_intregs1(display_act
);
2408 hide_all_intregs2(display_act
);
2413 if (display_act
->gpd
.exist_piv
) {
2414 if (default_par
.display_piv
) {
2415 display_all_vectors(&display_act
->gpd
);
2417 hide_all_vectors(&display_act
->gpd
);
2422 if (display_act
->gpd
.exist_vor
) {
2423 if (default_par
.display_vor
) {
2424 display_all_scalars(&display_act
->gpd
.vor_data
, VORTICITY
);
2426 hide_all_scalars(&display_act
->gpd
.vor_data
, VORTICITY
);
2431 if (display_act
->gpd
.exist_sstrain
) {
2432 if (default_par
.display_sstrain
) {
2433 display_all_scalars(&display_act
->gpd
.sstrain_data
, S_STRAIN
);
2435 hide_all_scalars(&display_act
->gpd
.sstrain_data
, S_STRAIN
);
2440 if (display_act
->gpd
.exist_nstrain
) {
2441 if (default_par
.display_nstrain
) {
2442 display_all_scalars(&display_act
->gpd
.nstrain_data
, N_STRAIN
);
2444 hide_all_scalars(&display_act
->gpd
.nstrain_data
, N_STRAIN
);
2454 store_defaultpar(void)
2455 /* --------------------------------------------------------------------
2456 Store parameters as defaults */
2458 gnome_config_push_prefix("/gpiv/General/");
2459 /* gnome_config_set_bool("print_par", print_par); */
2460 gnome_config_set_bool("show_tooltips", default_par
.show_tooltips
);
2461 gnome_config_set_bool("view_gpivbuttons", default_par
.view_gpivbuttons
);
2462 gnome_config_set_bool("view_tabulator", default_par
.view_tabulator
);
2463 gnome_config_set_int("nbins", default_par
.nbins
);
2464 gnome_config_set_bool("hdf", default_par
.hdf
);
2465 gnome_config_set_bool("hdf_img", default_par
.hdf_img
);
2468 gnome_config_push_prefix("/gpiv/Image/");
2469 gnome_config_set_bool("x_corr", default_par
.x_corr
);
2470 gnome_config_set_int("columns", default_par
.img_width
);
2471 gnome_config_set_int("rows", default_par
.img_height
);
2474 gnome_config_push_prefix("/gpiv/Processes/");
2475 gnome_config_set_bool("process_piv", default_par
.process_piv
);
2476 gnome_config_set_bool("process_gradient", default_par
.process_gradient
);
2477 gnome_config_set_bool("process_resstats", default_par
.process_resstats
);
2478 gnome_config_set_bool("process_errvec", default_par
.process_errvec
);
2479 gnome_config_set_bool("process_peaklock", default_par
.process_peaklock
);
2480 gnome_config_set_bool("process_scale", default_par
.process_scale
);
2481 gnome_config_set_bool("process_average", default_par
.process_average
);
2482 gnome_config_set_bool("process_substract", default_par
.process_substract
);
2483 gnome_config_set_bool("process_vorstra", default_par
.process_vorstra
);
2486 gnome_config_push_prefix("/gpiv/Display/");
2487 gnome_config_set_int("vector_scale", default_par
.vector_scale
);
2488 gnome_config_set_int("zoom_index", default_par
.zoom_index
);
2489 gnome_config_set_int("display_img1", default_par
.display_img1
);
2490 gnome_config_set_int("display_img2", default_par
.display_img2
);
2491 gnome_config_set_bool("display_intregs", default_par
.display_intregs
);
2492 gnome_config_set_bool("display_piv", default_par
.display_piv
);
2493 gnome_config_set_bool("display_vor", default_par
.display_vor
);
2494 gnome_config_set_bool("display_sstrain", default_par
.display_sstrain
);
2495 gnome_config_set_bool("display_nstrain", default_par
.display_nstrain
);
2497 gnome_config_pop_prefix();
2498 gnome_config_sync();