/* Formats a value according to FORMAT
The returned string must be freed when no longer required */
gchar *
-value_to_text (union value v, const struct dictionary *dict, struct fmt_spec format)
+value_to_text (union value v, PsppireDict *dict, struct fmt_spec format)
{
gchar *s = 0;
- s = data_out (&v, dict_get_encoding (dict), &format);
+ s = data_out (&v, dict_get_encoding (dict->dict), &format);
g_strchug (s);
return s;
#include <gtk/gtk.h>
-
+#include "psppire-dict.h"
void paste_syntax_in_new_window (const gchar *syntax);
struct fmt_spec;
-struct dictionary;
+
/* Formats a value according to FORMAT
The returned string must be freed when no longer required */
-gchar * value_to_text (union value v, const struct dictionary *dict, struct fmt_spec format);
+gchar * value_to_text (union value v, PsppireDict *dict, struct fmt_spec format);
gboolean text_to_value (const gchar *text, union value *v,
struct variable *pv;
/* The dictionary to which that value belongs */
- const struct dictionary *dict;
+ PsppireDict *dict;
/* local copy */
struct missing_values mvl;
vs->missing_val_dialog->pv =
psppire_var_store_get_var (var_store, row);
- vs->missing_val_dialog->dict = var_store->dict->dict;
+ vs->missing_val_dialog->dict = var_store->dict;
g_signal_connect_swapped (customEntry,
"clicked",
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (vs));
vs->val_labs_dialog = val_labs_dialog_create (GTK_WINDOW (toplevel),
- PSPPIRE_SHEET (vs));
+ 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));
{
GtkWidget *window;
- PsppireSheet *vs;
+ PsppireVarStore *var_store;
/* The variable to be updated */
struct variable *pv;
gchar *text;
get_selected_tuple (dialog, &value, &label);
- text = value_to_text (value, NULL, *var_get_write_format (dialog->pv));
+ text = value_to_text (value, dialog->var_store->dict, *var_get_write_format (dialog->pv));
g_signal_handler_block (GTK_ENTRY (dialog->value_entry),
dialog->value_handler_id);
/* Create a new dialog box
(there should normally be only one)*/
struct val_labs_dialog *
-val_labs_dialog_create (GtkWindow *toplevel, PsppireSheet *sheet)
+val_labs_dialog_create (GtkWindow *toplevel, PsppireVarStore *var_store)
{
GtkTreeViewColumn *column;
struct val_labs_dialog *dialog = g_malloc (sizeof (*dialog));
+ dialog->var_store = var_store;
dialog->window = get_widget_assert (xml,"val_labs_dialog");
dialog->value_entry = get_widget_assert (xml,"value_entry");
dialog->label_entry = get_widget_assert (xml,"label_entry");
- dialog->vs = sheet;
gtk_window_set_transient_for
(GTK_WINDOW (dialog->window), toplevel);
const struct val_lab *vl = labels[i];
gchar *const vstr =
- value_to_text (vl->value, NULL,
+ value_to_text (vl->value, dialog->var_store->dict,
*var_get_write_format (dialog->pv));
gchar *const text = g_strdup_printf ("%s = \"%s\"",
#include <gtk/gtk.h>
#include <data/variable.h>
-#include <gtk-contrib/psppire-sheet.h>
-
+//#include <gtk-contrib/psppire-sheet.h>
+#include "psppire-var-store.h"
struct val_labs;
-struct val_labs_dialog * val_labs_dialog_create (GtkWindow *, PsppireSheet *);
+struct val_labs_dialog * val_labs_dialog_create (GtkWindow *, PsppireVarStore *);
void val_labs_dialog_show (struct val_labs_dialog *);