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