PSPPIRE_VAR_STORE (psppire_sheet_get_model (PSPPIRE_SHEET (vs))));
vs->missing_val_dialog = missing_val_dialog_create (GTK_WINDOW (toplevel));
- vs->var_type_dialog = var_type_dialog_create (GTK_WINDOW (toplevel));
+ vs->var_type_dialog = var_type_dialog_create (GTK_WINDOW (toplevel),
+ PSPPIRE_VAR_STORE (psppire_sheet_get_model (PSPPIRE_SHEET (vs))));
/* Chain up to the parent class */
GTK_WIDGET_CLASS (parent_class)->realize (w);
union value v;
v.f = 1234.56;
- sample_text = value_to_text (v, NULL, dialog->fmt_l);
+ sample_text = value_to_text (v, dialog->vs->dictionary, dialog->fmt_l);
gtk_label_set_text (GTK_LABEL (dialog->label_psample), sample_text);
g_free (sample_text);
v.f = -v.f;
- sample_text = value_to_text (v, NULL, dialog->fmt_l);
+ sample_text = value_to_text (v, dialog->vs->dictionary, dialog->fmt_l);
gtk_label_set_text (GTK_LABEL (dialog->label_nsample), sample_text);
g_free (sample_text);
}
dialog->fmt_l = custom_format;
dialog->fmt_l.type = *(int*) g_value_get_pointer (&the_value);
-
}
-
-
/* Create the structure */
struct var_type_dialog *
-var_type_dialog_create (GtkWindow *toplevel)
+var_type_dialog_create (GtkWindow *toplevel, PsppireVarStore *vs)
{
gint i;
struct var_type_dialog *dialog = g_malloc (sizeof (struct var_type_dialog));
GtkBuilder *xml = builder_new ("var-sheet-dialogs.ui");
+ dialog->vs = vs;
+
dialog->window = get_widget_assert (xml,"var_type_dialog");
dialog->active_button = -1;
#include <data/format.h>
+#include "psppire-var-store.h"
+
/* This module describes the behaviour of the Variable Type dialog box,
used for input of the variable type parameter in the var sheet */
/* Variable to be updated */
struct variable *pv;
+
+ /* The variable store to which this dialog relates */
+ PsppireVarStore *vs;
+
/* Local copy of format specifier */
struct fmt_spec fmt_l;
};
-struct var_type_dialog * var_type_dialog_create (GtkWindow *);
+struct var_type_dialog * var_type_dialog_create (GtkWindow *, PsppireVarStore *vs);
void var_type_dialog_show (struct var_type_dialog *dialog);