Change license from GPLv2+ to GPLv3+.
[pspp-builds.git] / src / ui / gui / var-type-dialog.h
1 /* PSPPIRE - a graphical user interface for PSPP.
2    Copyright (C) 2005  Free Software Foundation
3
4    This program is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
16
17
18 #ifndef __PSPPIRE_VAR_TYPE_DIALOG_H
19 #define __PSPPIRE_VAR_TYPE_DIALOG_H
20
21
22 /*  This module describes the behaviour of the Variable Type dialog box,
23     used for input of the variable type parameter in the var sheet */
24
25 #include <data/format.h>
26
27 enum
28   {
29     BUTTON_NUMERIC,
30     BUTTON_COMMA,
31     BUTTON_DOT,
32     BUTTON_SCIENTIFIC,
33     BUTTON_DATE,
34     BUTTON_DOLLAR,
35     BUTTON_CUSTOM,
36     BUTTON_STRING,
37     num_BUTTONS
38   };
39
40 struct variable;
41
42 typedef void (*variable_changed_func)(struct variable *var);
43
44 struct var_type_dialog
45 {
46   GtkWidget *window;
47
48   /* Variable to be updated */
49   struct variable *pv;
50
51   /* Local copy of format specifier */
52   struct fmt_spec fmt_l;
53
54   /* Toggle Buttons */
55   GtkWidget *radioButton[num_BUTTONS];
56
57   /* Decimals */
58   GtkWidget *label_decimals;
59   GtkWidget *entry_decimals;
60
61   /* Width */
62   GtkWidget *entry_width;
63
64   /* Container for width/decimals entry/labels */
65   GtkWidget *width_decimals;
66
67   /* Date */
68   GtkWidget *date_format_list;
69   GtkTreeView *date_format_treeview;
70
71   /* Dollar */
72   GtkWidget *dollar_window;
73   GtkTreeView *dollar_treeview;
74
75   /* Custom Currency */
76   GtkWidget *custom_currency_hbox;
77   GtkTreeView *custom_treeview;
78   GtkWidget *label_psample;
79   GtkWidget *label_nsample;
80
81   /* Actions */
82   GtkWidget *ok;
83
84   gint active_button;
85 };
86
87
88 struct var_type_dialog * var_type_dialog_create (GladeXML *xml);
89
90
91 void var_type_dialog_set_variable (struct var_type_dialog *dialog,
92                                   variable_changed_func set_variable_changed,
93                                   struct variable *var);
94
95 void var_type_dialog_show (struct var_type_dialog *dialog);
96
97 #endif