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