Added new files resulting from directory restructuring.
[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 "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 PsppireVariable *pv;
54 #if 0
55   struct variable *var;
56
57   /* Function to be run when the dialog changes a variable */
58   variable_changed_func var_change_func;
59 #endif
60
61   /* Local copy of format specifier */
62   struct fmt_spec fmt_l;
63
64   /* Toggle Buttons */
65   GtkWidget *radioButton[num_BUTTONS];
66
67   /* Decimals */
68   GtkWidget *label_decimals;
69   GtkWidget *entry_decimals;
70
71   /* Width */
72   GtkWidget *entry_width;
73
74   /* Container for width/decimals entry/labels */
75   GtkWidget *width_decimals;
76
77   /* Date */
78   GtkWidget *date_format_list;
79   GtkTreeView *date_format_treeview;
80
81   /* Dollar */
82   GtkWidget *dollar_window;
83   GtkTreeView *dollar_treeview;
84
85   /* Custom Currency */
86   GtkWidget *custom_currency_hbox;
87   GtkTreeView *custom_treeview;
88   GtkWidget *label_psample;
89   GtkWidget *label_nsample;
90
91   /* Actions */
92   GtkWidget *ok;
93
94   gint active_button;
95 };
96
97
98 struct var_type_dialog * var_type_dialog_create(GladeXML *xml);
99
100
101 void var_type_dialog_set_variable(struct var_type_dialog *dialog, 
102                                   variable_changed_func set_variable_changed,
103                                   struct variable *var);
104
105 void var_type_dialog_show(struct var_type_dialog *dialog);
106
107
108 #endif