improved monitoring of interrogation process
[gpiv.git] / src / preferences.c
blob78bf1507eecd293ca039b530136d47c0cb0cb78f
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
6 libraries.
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)
15 any later version.
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
43 * Imported gpiv
47 #ifdef HAVE_CONFIG_H
48 # include <config.h>
49 #endif
50 #include "support.h"
52 #include "gpiv_gtk.h"
53 #include "utils.h"
54 #include "preferences.h"
55 #include "console_menus.h"
56 #include "display.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;
67 GtkWidget *notebook1;
68 GtkWidget *table1;
69 GtkWidget *frame_pref_view;
70 GtkWidget *vbox1;
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;
76 GtkWidget *vbox_io;
77 GtkWidget *checkbutton_pref_hdf;
78 GtkWidget *checkbutton_pref_hdfimg;
79 GtkWidget *checkbutton_pref_xcorr;
81 GtkWidget *hbox_cols;
82 GtkWidget *label_pref_spinner_cols;
83 GtkObject *spinbutton_pref_cols_adj;
84 GtkWidget *spinbutton_pref_cols;
86 GtkWidget *hbox_rows;
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;
95 GtkWidget *vbox2;
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;
105 GtkWidget *hbox1;
106 GtkWidget *label_pref_spinner_bins;
107 GtkObject *spinbutton_pref_bins_adj;
108 GtkWidget *spinbutton_pref_bins;
112 GtkWidget *pref_tab1;
113 GtkWidget *table2;
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;
158 /* _parented */
159 /* gnome_dialog_new */
160 preferences = gnome_dialog_new (_("Preferences"),
161 NULL);
162 gtk_object_set_data (GTK_OBJECT (preferences),
163 "preferences",
164 preferences);
165 gnome_dialog_set_parent (GNOME_DIALOG (preferences),
166 GTK_WINDOW (gpiv->console));
167 gtk_window_set_policy (GTK_WINDOW (preferences),
168 FALSE,
169 FALSE,
170 FALSE);
171 gtk_window_set_wmclass (GTK_WINDOW (preferences),
172 "preferneces",
173 "");
175 dialog_vbox1 = GNOME_DIALOG (preferences)->vbox;
176 gtk_object_set_data (GTK_OBJECT (preferences),
177 "dialog_vbox1",
178 dialog_vbox1);
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),
186 "notebook1",
187 notebook1,
188 (GtkDestroyNotify) gtk_widget_unref);
189 gtk_widget_show (notebook1);
190 gtk_box_pack_start (GTK_BOX (dialog_vbox1),
191 notebook1,
192 TRUE,
193 TRUE,
197 * Interface tabulator
200 table1 = gtk_table_new (2,
202 FALSE);
203 gtk_widget_ref (table1);
204 gtk_object_set_data_full (GTK_OBJECT (preferences),
205 "table1",
206 table1,
207 (GtkDestroyNotify) gtk_widget_unref);
208 gtk_widget_show (table1);
209 gtk_container_add (GTK_CONTAINER (notebook1),
210 table1);
214 frame_pref_view = gtk_frame_new (_("View"));
215 gtk_widget_ref (frame_pref_view);
216 gtk_object_set_data_full (GTK_OBJECT (preferences),
217 "frame_pref_view",
218 frame_pref_view,
219 (GtkDestroyNotify) gtk_widget_unref);
220 gtk_widget_show (frame_pref_view);
221 gtk_table_attach (GTK_TABLE (table1),
222 frame_pref_view,
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),
237 "vbox1", vbox1,
238 (GtkDestroyNotify) gtk_widget_unref);
239 gtk_widget_show (vbox1);
240 gtk_container_add (GTK_CONTAINER (frame_pref_view),
241 vbox1);
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),
255 TRUE);
256 } else {
257 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
258 (checkbutton_pref_gpivbuttons),
259 FALSE);
261 gtk_widget_show (checkbutton_pref_gpivbuttons);
262 gtk_box_pack_start (GTK_BOX (vbox1),
263 checkbutton_pref_gpivbuttons,
264 FALSE,
265 FALSE,
268 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_gpivbuttons), "clicked",
269 GTK_SIGNAL_FUNC (on_checkbutton_pref_gpivbuttons_activate),
270 NULL);
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),
284 TRUE);
285 } else {
286 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
287 (checkbutton_pref_tab),
288 FALSE);
290 gtk_widget_show (checkbutton_pref_tab);
291 gtk_box_pack_start (GTK_BOX (vbox1),
292 checkbutton_pref_tab,
293 FALSE,
294 FALSE,
297 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_tab), "clicked",
298 GTK_SIGNAL_FUNC (on_checkbutton_pref_tab_activate),
299 NULL);
303 /* */
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),
307 "frame_pref_io",
308 frame_pref_io,
309 (GtkDestroyNotify) gtk_widget_unref);
310 gtk_widget_show (frame_pref_io);
311 gtk_table_attach (GTK_TABLE (table1),
312 frame_pref_io,
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),
327 "vbox_io", vbox_io,
328 (GtkDestroyNotify) gtk_widget_unref);
329 gtk_widget_show (vbox_io);
330 gtk_container_add (GTK_CONTAINER (frame_pref_io),
331 vbox_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),
343 TRUE);
344 } else {
345 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
346 (checkbutton_pref_hdf),
347 FALSE);
349 gtk_widget_show (checkbutton_pref_hdf);
350 gtk_box_pack_start (GTK_BOX (vbox_io),
351 checkbutton_pref_hdf,
352 FALSE,
353 FALSE,
356 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_hdf), "clicked",
357 GTK_SIGNAL_FUNC (on_checkbutton_pref_hdf_activate),
358 NULL);
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),
371 TRUE);
372 } else {
373 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
374 (checkbutton_pref_hdfimg),
375 FALSE);
377 gtk_widget_show (checkbutton_pref_hdfimg);
378 gtk_box_pack_start (GTK_BOX (vbox_io),
379 checkbutton_pref_hdfimg,
380 FALSE,
381 FALSE,
384 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_hdfimg), "clicked",
385 GTK_SIGNAL_FUNC (on_checkbutton_pref_hdfimg_activate),
386 NULL);
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),
398 TRUE);
399 } else {
400 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
401 (checkbutton_pref_xcorr),
402 FALSE);
404 gtk_widget_show (checkbutton_pref_xcorr);
405 gtk_box_pack_start (GTK_BOX (vbox_io),
406 checkbutton_pref_xcorr,
407 FALSE,
408 FALSE,
411 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_xcorr), "clicked",
412 GTK_SIGNAL_FUNC (on_checkbutton_pref_xcorr_activate),
413 NULL);
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),
423 "hbox_cols",
424 hbox_cols,
425 (GtkDestroyNotify) gtk_widget_unref);
426 gtk_widget_show (hbox_cols);
427 gtk_box_pack_start (GTK_BOX (vbox_io),
428 hbox_cols,
429 FALSE,
430 FALSE,
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,
444 FALSE,
445 FALSE,
450 spinbutton_pref_cols_adj = gtk_adjustment_new (gpiv_par.img_width,
452 IMAGE_WIDTH_MAX,
455 10);
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,
468 TRUE,
469 TRUE,
472 gtk_signal_connect (GTK_OBJECT (spinbutton_pref_cols), "changed",
473 GTK_SIGNAL_FUNC (on_spinbutton_pref_cols_activate),
474 NULL);
478 * spinner for nrows
480 hbox_rows = gtk_hbox_new (FALSE,
482 gtk_widget_ref (hbox_rows);
483 gtk_object_set_data_full (GTK_OBJECT (preferences),
484 "hbox_rows",
485 hbox_rows,
486 (GtkDestroyNotify) gtk_widget_unref);
487 gtk_widget_show (hbox_rows);
488 gtk_box_pack_start (GTK_BOX (vbox_io),
489 hbox_rows,
490 FALSE,
491 FALSE,
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,
505 FALSE,
506 FALSE,
511 spinbutton_pref_rows_adj = gtk_adjustment_new (gpiv_par.img_height,
513 IMAGE_HEIGHT_MAX,
516 10);
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,
529 TRUE,
530 TRUE,
533 gtk_signal_connect (GTK_OBJECT (spinbutton_pref_rows), "changed",
534 GTK_SIGNAL_FUNC (on_spinbutton_pref_rows_activate),
535 NULL);
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),
550 TRUE);
551 } else {
552 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
553 (checkbutton_pref_tooltips),
554 FALSE);
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),
570 NULL);
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),
599 "vbox2",
600 vbox2,
601 (GtkDestroyNotify) gtk_widget_unref);
602 gtk_widget_show (vbox2);
603 gtk_container_add (GTK_CONTAINER (frame_pref_processes),
604 vbox2);
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),
617 TRUE);
618 } else {
619 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON
620 (checkbutton_pref_process_piv),
621 FALSE);
623 gtk_widget_show (checkbutton_pref_process_piv);
624 gtk_box_pack_start (GTK_BOX (vbox2),
625 checkbutton_pref_process_piv,
626 FALSE,
627 FALSE,
630 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_process_piv), "clicked",
631 GTK_SIGNAL_FUNC (on_checkbutton_pref_process_piv_activate),
632 NULL);
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),
647 TRUE);
648 } else {
649 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
650 (checkbutton_pref_process_gradient),
651 FALSE);
653 gtk_widget_show (checkbutton_pref_process_gradient);
654 gtk_box_pack_start (GTK_BOX (vbox2),
655 checkbutton_pref_process_gradient,
656 FALSE,
657 FALSE,
660 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_process_gradient), "clicked",
661 GTK_SIGNAL_FUNC (on_checkbutton_pref_process_gradient_activate),
662 NULL);
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),
677 TRUE);
678 } else {
679 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
680 (checkbutton_pref_process_resstats),
681 FALSE);
683 gtk_widget_show (checkbutton_pref_process_resstats);
684 gtk_box_pack_start (GTK_BOX (vbox2),
685 checkbutton_pref_process_resstats,
686 FALSE,
687 FALSE,
690 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_process_resstats), "clicked",
691 GTK_SIGNAL_FUNC (on_checkbutton_pref_process_resstats_activate),
692 NULL);
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),
707 TRUE);
708 } else {
709 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
710 (checkbutton_pref_process_errvec),
711 FALSE);
713 gtk_widget_show (checkbutton_pref_process_errvec);
714 gtk_box_pack_start (GTK_BOX (vbox2),
715 checkbutton_pref_process_errvec,
716 FALSE,
717 FALSE,
720 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_process_errvec), "clicked",
721 GTK_SIGNAL_FUNC (on_checkbutton_pref_process_errvec_activate),
722 NULL);
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),
737 TRUE);
738 } else {
739 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
740 (checkbutton_pref_process_peaklck),
741 FALSE);
743 gtk_widget_show (checkbutton_pref_process_peaklck);
744 gtk_box_pack_start (GTK_BOX (vbox2),
745 checkbutton_pref_process_peaklck,
746 FALSE,
747 FALSE,
750 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_process_peaklck), "clicked",
751 GTK_SIGNAL_FUNC (on_checkbutton_pref_process_peaklck_activate),
752 NULL);
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),
766 TRUE);
767 } else {
768 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
769 (checkbutton_pref_process_scale),
770 FALSE);
772 gtk_widget_show (checkbutton_pref_process_scale);
773 gtk_box_pack_start (GTK_BOX (vbox2),
774 checkbutton_pref_process_scale,
775 FALSE,
776 FALSE,
779 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_process_scale), "clicked",
780 GTK_SIGNAL_FUNC (on_checkbutton_pref_process_scale_activate),
781 NULL);
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),
796 TRUE);
797 } else {
798 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
799 (checkbutton_pref_process_avg),
800 FALSE);
802 gtk_widget_show (checkbutton_pref_process_avg);
803 gtk_box_pack_start (GTK_BOX (vbox2),
804 checkbutton_pref_process_avg,
805 FALSE,
806 FALSE,
809 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_process_avg), "clicked",
810 GTK_SIGNAL_FUNC (on_checkbutton_pref_process_avg_activate),
811 NULL);
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),
826 TRUE);
827 } else {
828 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
829 (checkbutton_pref_process_substract),
830 FALSE);
832 gtk_widget_show (checkbutton_pref_process_substract);
833 gtk_box_pack_start (GTK_BOX (vbox2),
834 checkbutton_pref_process_substract,
835 FALSE,
836 FALSE,
839 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_process_substract), "clicked",
840 GTK_SIGNAL_FUNC (on_checkbutton_pref_process_substract_activate),
841 NULL);
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),
856 TRUE);
857 } else {
858 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
859 (checkbutton_pref_process_vorstra),
860 FALSE);
862 gtk_widget_show (checkbutton_pref_process_vorstra);
863 gtk_box_pack_start (GTK_BOX (vbox2),
864 checkbutton_pref_process_vorstra,
865 FALSE,
866 FALSE,
869 gtk_signal_connect (GTK_OBJECT (checkbutton_pref_process_vorstra), "clicked",
870 GTK_SIGNAL_FUNC (on_checkbutton_pref_process_vorstra_activate),
871 NULL);
876 hbox1 = gtk_hbox_new (FALSE,
878 gtk_widget_ref (hbox1);
879 gtk_object_set_data_full (GTK_OBJECT (preferences),
880 "hbox1",
881 hbox1,
882 (GtkDestroyNotify) gtk_widget_unref);
883 gtk_widget_show (hbox1);
884 gtk_table_attach (GTK_TABLE (table1),
885 hbox1,
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,
906 FALSE,
907 FALSE,
912 spinbutton_pref_bins_adj = gtk_adjustment_new (10,
914 100,
917 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,
930 TRUE,
931 TRUE,
934 gtk_signal_connect (GTK_OBJECT (spinbutton_pref_bins), "changed",
935 GTK_SIGNAL_FUNC (on_spinbutton_pref_bins_activate),
936 NULL);
940 pref_tab1 = gtk_label_new (_("console"));
941 gtk_widget_ref (pref_tab1);
942 gtk_object_set_data_full (GTK_OBJECT (preferences),
943 "pref_tab1",
944 pref_tab1,
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),
951 pref_tab1);
956 * Display tabulator
959 table2 = gtk_table_new (1,
961 FALSE);
962 gtk_widget_ref (table2);
963 gtk_object_set_data_full (GTK_OBJECT (preferences),
964 "table2",
965 table2,
966 (GtkDestroyNotify) gtk_widget_unref);
967 gtk_widget_show (table2);
968 gtk_container_add (GTK_CONTAINER (notebook1),
969 table2);
972 * Vector scale
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,
1009 _("1"));
1010 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),
1021 TRUE);
1022 } else {
1023 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1024 (radiobutton_pref_display_vecscale1),
1025 FALSE);
1028 gtk_widget_show(radiobutton_pref_display_vecscale1);
1029 gtk_box_pack_start(GTK_BOX(vbox_pref_display_vecscale),
1030 radiobutton_pref_display_vecscale1,
1031 FALSE,
1032 FALSE,
1034 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_vecscale1),
1035 "vscale",
1036 "1");
1041 radiobutton_pref_display_vecscale2 =
1042 gtk_radio_button_new_with_label(vecscale_group, _("2"));
1043 vecscale_group =
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),
1054 TRUE);
1055 } else {
1056 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1057 (radiobutton_pref_display_vecscale2),
1058 FALSE);
1060 gtk_widget_show(radiobutton_pref_display_vecscale2);
1061 gtk_box_pack_start(GTK_BOX(vbox_pref_display_vecscale),
1062 radiobutton_pref_display_vecscale2,
1063 FALSE,
1064 FALSE,
1066 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_vecscale2),
1067 "vscale",
1068 "2");
1073 radiobutton_pref_display_vecscale3 =
1074 gtk_radio_button_new_with_label(vecscale_group, _("4"));
1075 vecscale_group =
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),
1086 TRUE);
1087 } else {
1088 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1089 (radiobutton_pref_display_vecscale3),
1090 FALSE);
1092 gtk_widget_show(radiobutton_pref_display_vecscale3);
1093 gtk_box_pack_start(GTK_BOX(vbox_pref_display_vecscale),
1094 radiobutton_pref_display_vecscale3,
1095 FALSE,
1096 FALSE,
1098 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_vecscale3),
1099 "vscale",
1100 "4");
1105 radiobutton_pref_display_vecscale4 =
1106 gtk_radio_button_new_with_label(vecscale_group, _("8"));
1107 vecscale_group =
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),
1118 TRUE);
1119 } else {
1120 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1121 (radiobutton_pref_display_vecscale4),
1122 FALSE);
1124 gtk_widget_show(radiobutton_pref_display_vecscale4);
1125 gtk_box_pack_start(GTK_BOX(vbox_pref_display_vecscale),
1126 radiobutton_pref_display_vecscale4,
1127 FALSE,
1128 FALSE,
1130 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_vecscale4),
1131 "vscale",
1132 "8");
1137 radiobutton_pref_display_vecscale5 =
1138 gtk_radio_button_new_with_label(vecscale_group, _("16"));
1139 vecscale_group =
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),
1150 TRUE);
1151 } else {
1152 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1153 (radiobutton_pref_display_vecscale5),
1154 FALSE);
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),
1160 "vscale",
1161 "16");
1166 radiobutton_pref_display_vecscale6 =
1167 gtk_radio_button_new_with_label(vecscale_group, _("32"));
1168 vecscale_group =
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),
1179 TRUE);
1180 } else {
1181 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1182 (radiobutton_pref_display_vecscale6),
1183 FALSE);
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),
1189 "vscale",
1190 "32");
1195 radiobutton_pref_display_vecscale7 =
1196 gtk_radio_button_new_with_label(vecscale_group, _("64"));
1197 vecscale_group =
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),
1208 TRUE);
1209 } else {
1210 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1211 (radiobutton_pref_display_vecscale7),
1212 FALSE);
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),
1218 "vscale",
1219 "64");
1223 * Zoom scale
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"));
1257 zoomscale_group =
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),
1268 TRUE);
1269 /* } else { */
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,
1276 FALSE,
1277 FALSE,
1279 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_zoomscale1),
1280 "zscale",
1281 "0");
1286 radiobutton_pref_display_zoomscale2 =
1287 gtk_radio_button_new_with_label(zoomscale_group, _("0.83"));
1288 zoomscale_group =
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),
1299 TRUE);
1300 /* } else { */
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,
1307 FALSE,
1308 FALSE,
1310 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_zoomscale2),
1311 "zscale",
1312 "1");
1317 radiobutton_pref_display_zoomscale3 =
1318 gtk_radio_button_new_with_label(zoomscale_group, _("1.0"));
1319 zoomscale_group =
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),
1330 TRUE);
1331 /* } else { */
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,
1338 FALSE,
1339 FALSE,
1341 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_zoomscale3),
1342 "zscale",
1343 "2");
1348 radiobutton_pref_display_zoomscale4 =
1349 gtk_radio_button_new_with_label(zoomscale_group, _("1.3"));
1350 zoomscale_group =
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),
1361 TRUE);
1362 /* } else { */
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,
1369 FALSE,
1370 FALSE,
1372 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_zoomscale4),
1373 "zscale",
1374 "3");
1379 radiobutton_pref_display_zoomscale5 =
1380 gtk_radio_button_new_with_label(zoomscale_group, _("1.6"));
1381 zoomscale_group =
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),
1392 TRUE);
1393 /* } else { */
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,
1400 FALSE,
1401 FALSE,
1403 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_zoomscale5),
1404 "zscale",
1405 "4");
1410 radiobutton_pref_display_zoomscale6 =
1411 gtk_radio_button_new_with_label(zoomscale_group, _("2.0"));
1412 zoomscale_group =
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),
1423 TRUE);
1424 /* } else { */
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,
1431 FALSE,
1432 FALSE,
1434 gtk_object_set_data(GTK_OBJECT(radiobutton_pref_display_zoomscale6),
1435 "zscale",
1436 "5");
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),
1483 TRUE);
1484 } else {
1485 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1486 (checkbutton_pref_display_display_img1),
1487 FALSE);
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,
1492 FALSE,
1493 FALSE,
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),
1508 TRUE);
1509 } else {
1510 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1511 (checkbutton_pref_display_display_img2),
1512 FALSE);
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,
1517 FALSE,
1518 FALSE,
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),
1533 TRUE);
1534 } else {
1535 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1536 (checkbutton_pref_display_display_intregs),
1537 FALSE);
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,
1542 FALSE,
1543 FALSE,
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),
1558 TRUE);
1559 } else {
1560 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1561 (checkbutton_pref_display_display_piv),
1562 FALSE);
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,
1567 FALSE,
1568 FALSE,
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),
1583 TRUE);
1584 } else {
1585 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1586 (checkbutton_pref_display_display_vor),
1587 FALSE);
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,
1592 FALSE,
1593 FALSE,
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),
1608 TRUE);
1609 } else {
1610 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1611 (checkbutton_pref_display_display_sstrain),
1612 FALSE);
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),
1629 TRUE);
1630 } else {
1631 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1632 (checkbutton_pref_display_display_nstrain),
1633 FALSE);
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,
1638 FALSE,
1639 FALSE,
1648 pref_tab2 = gtk_label_new (_("display"));
1649 gtk_widget_ref (pref_tab2);
1650 gtk_object_set_data_full (GTK_OBJECT (preferences),
1651 "pref_tab2",
1652 pref_tab2,
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),
1658 pref_tab2);
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),
1691 GTK_BUTTONBOX_END);
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);
1699 button_pref_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),
1703 "button_pref_ok",
1704 button_pref_ok,
1705 (GtkDestroyNotify) gtk_widget_unref);
1706 gtk_widget_show (button_pref_ok);
1707 GTK_WIDGET_SET_FLAGS (button_pref_ok,
1708 GTK_CAN_DEFAULT);
1709 gtk_tooltips_set_tip(gpiv->tooltips, button_pref_ok,
1710 _("Updates parameters and save as defaults"),
1711 NULL);
1713 gtk_object_set_data(GTK_OBJECT(button_pref_ok),
1714 "gpiv",
1715 gpiv);
1716 gtk_signal_connect (GTK_OBJECT (button_pref_ok), "clicked",
1717 GTK_SIGNAL_FUNC (on_button_pref_ok),
1718 NULL);
1722 gnome_dialog_append_button (GNOME_DIALOG (preferences),
1723 GNOME_STOCK_BUTTON_APPLY);
1724 button_pref_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",
1729 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"),
1735 NULL);
1737 gtk_object_set_data(GTK_OBJECT(button_pref_apply),
1738 "gpiv",
1739 gpiv);
1740 gtk_signal_connect (GTK_OBJECT (button_pref_apply), "clicked",
1741 GTK_SIGNAL_FUNC (on_button_pref_apply),
1742 NULL);
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",
1753 button_pref_cancel,
1754 (GtkDestroyNotify) gtk_widget_unref);
1755 gtk_widget_show (button_pref_cancel);
1756 GTK_WIDGET_SET_FLAGS (button_pref_cancel,
1757 GTK_CAN_DEFAULT);
1758 gtk_tooltips_set_tip(gpiv->tooltips,
1759 button_pref_cancel,
1760 _("Close preferences window"),
1761 NULL);
1763 gtk_signal_connect (GTK_OBJECT (button_pref_cancel),
1764 "clicked",
1765 GTK_SIGNAL_FUNC (on_button_pref_cancel),
1766 NULL);
1770 * Display callback functions
1774 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_vecscale1),
1775 "toggled",
1776 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_vecscale),
1777 NULL);
1778 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_vecscale2),
1779 "toggled",
1780 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_vecscale),
1781 NULL);
1782 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_vecscale3),
1783 "toggled",
1784 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_vecscale),
1785 NULL);
1786 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_vecscale4),
1787 "toggled",
1788 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_vecscale),
1789 NULL);
1790 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_vecscale5),
1791 "toggled",
1792 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_vecscale),
1793 NULL);
1794 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_vecscale6),
1795 "toggled",
1796 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_vecscale),
1797 NULL);
1798 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_vecscale7),
1799 "toggled",
1800 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_vecscale),
1801 NULL);
1806 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_zoomscale1),
1807 "toggled",
1808 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_zoomscale),
1809 NULL);
1810 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_zoomscale2),
1811 "toggled",
1812 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_zoomscale),
1813 NULL);
1814 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_zoomscale3),
1815 "toggled",
1816 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_zoomscale),
1817 NULL);
1818 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_zoomscale4),
1819 "toggled",
1820 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_zoomscale),
1821 NULL);
1822 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_zoomscale5),
1823 "toggled",
1824 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_zoomscale),
1825 NULL);
1826 gtk_signal_connect (GTK_OBJECT(radiobutton_pref_display_zoomscale6),
1827 "toggled",
1828 GTK_SIGNAL_FUNC(on_radiobutton_pref_display_zoomscale),
1829 NULL);
1834 gtk_signal_connect (GTK_OBJECT(checkbutton_pref_display_display_img1),
1835 "toggled",
1836 GTK_SIGNAL_FUNC(on_checkbutton_pref_display_display_img1),
1837 NULL);
1838 gtk_signal_connect (GTK_OBJECT(checkbutton_pref_display_display_img2),
1839 "toggled",
1840 GTK_SIGNAL_FUNC(on_checkbutton_pref_display_display_img2),
1841 NULL);
1842 gtk_signal_connect (GTK_OBJECT(checkbutton_pref_display_display_intregs), "toggled",
1843 GTK_SIGNAL_FUNC(on_checkbutton_pref_display_display_intregs),
1844 NULL);
1845 gtk_signal_connect (GTK_OBJECT(checkbutton_pref_display_display_piv),
1846 "toggled",
1847 GTK_SIGNAL_FUNC(on_checkbutton_pref_display_display_piv),
1848 NULL);
1849 gtk_signal_connect (GTK_OBJECT(checkbutton_pref_display_display_vor),
1850 "toggled",
1851 GTK_SIGNAL_FUNC(on_checkbutton_pref_display_display_vor),
1852 NULL);
1853 gtk_signal_connect (GTK_OBJECT(checkbutton_pref_display_display_sstrain),
1854 "toggled",
1855 GTK_SIGNAL_FUNC(on_checkbutton_pref_display_display_sstrain),
1856 NULL);
1857 gtk_signal_connect (GTK_OBJECT(checkbutton_pref_display_display_nstrain),
1858 "toggled",
1859 GTK_SIGNAL_FUNC(on_checkbutton_pref_display_display_nstrain),
1860 NULL);
1862 return preferences;
1868 void
1869 on_checkbutton_pref_gpivbuttons_activate(GtkWidget *widget,
1870 gpointer data)
1872 if (GTK_TOGGLE_BUTTON(widget)->active) {
1873 default_par.view_gpivbuttons = 1;
1874 } else {
1875 default_par.view_gpivbuttons = 0;
1880 void
1881 on_checkbutton_pref_tab_activate(GtkWidget *widget,
1882 gpointer data)
1884 if (GTK_TOGGLE_BUTTON(widget)->active) {
1885 default_par.view_tabulator = 1;
1886 } else {
1887 default_par.view_tabulator = 0;
1892 void
1893 on_checkbutton_pref_hdf_activate(GtkWidget *widget,
1894 gpointer data)
1896 if (GTK_TOGGLE_BUTTON(widget)->active) {
1897 default_par.hdf = 1;
1898 } else {
1899 default_par.hdf = 0;
1904 void
1905 on_checkbutton_pref_hdfimg_activate(GtkWidget *widget,
1906 gpointer data)
1908 if (GTK_TOGGLE_BUTTON(widget)->active) {
1909 default_par.hdf_img = 1;
1910 } else {
1911 default_par.hdf_img = 0;
1916 void
1917 on_checkbutton_pref_xcorr_activate(GtkWidget *widget,
1918 gpointer data)
1920 if (GTK_TOGGLE_BUTTON(widget)->active) {
1921 default_par.x_corr = 1;
1922 } else {
1923 default_par.x_corr = 0;
1928 void
1929 on_spinbutton_pref_cols_activate(GtkSpinButton * widget,
1930 GtkWidget * entry)
1932 default_par.img_width =
1933 gtk_spin_button_get_value_as_int(widget);
1934 img_set = TRUE;
1937 void
1938 on_spinbutton_pref_rows_activate(GtkSpinButton * widget,
1939 GtkWidget * entry)
1941 default_par.img_height =
1942 gtk_spin_button_get_value_as_int(widget);
1943 img_set = TRUE;
1947 void
1948 on_checkbutton_pref_tooltips_activate(GtkWidget *widget,
1949 gpointer data)
1951 if (GTK_TOGGLE_BUTTON(widget)->active) {
1952 default_par.show_tooltips = 1;
1953 } else {
1954 default_par.show_tooltips = 0;
1959 void
1960 on_checkbutton_pref_process_piv_activate(GtkWidget *widget,
1961 gpointer data)
1963 if (GTK_TOGGLE_BUTTON(widget)->active) {
1964 default_par.process_piv = TRUE;
1965 } else {
1966 default_par.process_piv = FALSE;
1971 void
1972 on_checkbutton_pref_process_gradient_activate(GtkWidget *widget,
1973 gpointer data)
1975 if (GTK_TOGGLE_BUTTON(widget)->active) {
1976 default_par.process_gradient = TRUE;
1977 } else {
1978 default_par.process_gradient = FALSE;
1985 void
1986 on_checkbutton_pref_process_resstats_activate(GtkWidget *widget,
1987 gpointer data)
1989 if (GTK_TOGGLE_BUTTON(widget)->active) {
1990 default_par.process_resstats = TRUE;
1991 } else {
1992 default_par.process_resstats = FALSE;
1998 void
1999 on_checkbutton_pref_process_errvec_activate(GtkWidget *widget,
2000 gpointer data)
2002 if (GTK_TOGGLE_BUTTON(widget)->active) {
2003 default_par.process_peaklock = TRUE;
2004 } else {
2005 default_par.process_peaklock = FALSE;
2011 void
2012 on_checkbutton_pref_process_peaklck_activate(GtkWidget *widget,
2013 gpointer data)
2015 if (GTK_TOGGLE_BUTTON(widget)->active) {
2016 default_par.process_peaklock = TRUE;
2017 } else {
2018 default_par.process_peaklock = FALSE;
2024 void
2025 on_checkbutton_pref_process_substract_activate(GtkWidget *widget,
2026 gpointer data)
2028 if (GTK_TOGGLE_BUTTON(widget)->active) {
2029 default_par.process_substract = TRUE;
2030 } else {
2031 default_par.process_substract = FALSE;
2037 void
2038 on_checkbutton_pref_process_scale_activate(GtkWidget *widget,
2039 gpointer data)
2041 if (GTK_TOGGLE_BUTTON(widget)->active) {
2042 default_par.process_scale = TRUE;
2043 } else {
2044 default_par.process_scale = FALSE;
2049 void
2050 on_checkbutton_pref_process_avg_activate(GtkWidget *widget,
2051 gpointer data)
2053 if (GTK_TOGGLE_BUTTON(widget)->active) {
2054 default_par.process_average = TRUE;
2055 } else {
2056 default_par.process_average = FALSE;
2061 void
2062 on_checkbutton_pref_process_vorstra_activate(GtkWidget *widget,
2063 gpointer data)
2065 if (GTK_TOGGLE_BUTTON(widget)->active) {
2066 default_par.process_vorstra = TRUE;
2067 } else {
2068 default_par.process_vorstra = FALSE;
2072 void
2073 on_spinbutton_pref_bins_activate(GtkWidget *widget,
2074 gpointer data){}
2079 void
2080 on_radiobutton_pref_display_vecscale(GtkWidget *widget,
2081 gpointer data)
2083 default_par.vector_scale = atoi(gtk_object_get_data(GTK_OBJECT(widget),
2084 "vscale"));
2089 void
2090 on_radiobutton_pref_display_zoomscale(GtkWidget *widget,
2091 gpointer data)
2093 default_par.zoom_index = atoi(gtk_object_get_data(GTK_OBJECT(widget),
2094 "zscale"));
2099 void
2100 on_checkbutton_pref_display_display_img1(GtkWidget *widget,
2101 gpointer data)
2103 if (GTK_TOGGLE_BUTTON(widget)->active) {
2104 default_par.display_img1 = 1;
2105 } else {
2106 default_par.display_img1 = 0;
2110 void
2111 on_checkbutton_pref_display_display_img2(GtkWidget *widget,
2112 gpointer data)
2114 if (GTK_TOGGLE_BUTTON(widget)->active) {
2115 default_par.display_img2 = 1;
2116 } else {
2117 default_par.display_img2 = 0;
2121 void
2122 on_checkbutton_pref_display_display_intregs(GtkWidget *widget,
2123 gpointer data)
2125 if (GTK_TOGGLE_BUTTON(widget)->active) {
2126 default_par.display_intregs = TRUE;
2127 } else {
2128 default_par.display_intregs = FALSE;
2132 void
2133 on_checkbutton_pref_display_display_piv(GtkWidget *widget,
2134 gpointer data)
2136 if (GTK_TOGGLE_BUTTON(widget)->active) {
2137 default_par.display_piv = TRUE;
2138 } else {
2139 default_par.display_piv = FALSE;
2143 void
2144 on_checkbutton_pref_display_display_vor(GtkWidget *widget,
2145 gpointer data)
2147 if (GTK_TOGGLE_BUTTON(widget)->active) {
2148 default_par.display_vor = TRUE;
2149 } else {
2150 default_par.display_vor = FALSE;
2154 void
2155 on_checkbutton_pref_display_display_sstrain(GtkWidget *widget,
2156 gpointer data)
2158 if (GTK_TOGGLE_BUTTON(widget)->active) {
2159 default_par.display_sstrain = TRUE;
2160 } else {
2161 default_par.display_sstrain = FALSE;
2165 void
2166 on_checkbutton_pref_display_display_nstrain(GtkWidget *widget,
2167 gpointer data)
2169 if (GTK_TOGGLE_BUTTON(widget)->active) {
2170 default_par.display_nstrain = TRUE;
2171 } else {
2172 default_par.display_nstrain = FALSE;
2183 void
2184 on_button_pref_ok(GtkWidget *widget,
2185 gpointer data)
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);
2192 store_defaultpar();
2194 if (img_set) {
2195 gtk_warning(_("In order to affect image width and height,\n"
2196 "restart GPIV"));
2199 gnome_dialog_close(GNOME_DIALOG(gpiv_preferences));
2204 void
2205 on_button_pref_apply(GtkWidget *widget,
2206 gpointer data)
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"));
2216 void
2217 on_button_pref_cancel(GtkWidget *widget,
2218 gpointer data){
2219 /* --------------------------------------------------------------------
2220 updates parameters and closes preferences window */
2222 gnome_dialog_close(GNOME_DIALOG(gpiv_preferences));
2228 void
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);
2270 } else {
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);
2280 } else {
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);
2291 } else {
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),
2300 default_par.nbins);
2305 if (default_par.process_piv) {
2306 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON
2307 (gpiv->button_toolbar_piv), TRUE);
2308 } else {
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);
2316 } else {
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);
2324 } else {
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);
2332 } else {
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);
2340 } else {
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);
2348 } else {
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);
2356 } else {
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);
2364 } else {
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);
2372 } else {
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; */
2395 /* } else { */
2396 /* g_warning ("select_zoomscale:: unvalid zoomfacor"); */
2397 /* } */
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);
2406 } else {
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);
2416 } else {
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);
2425 } else {
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);
2434 } else {
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);
2443 } else {
2444 hide_all_scalars(&display_act->gpd.nstrain_data, N_STRAIN);
2453 void
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();