/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2008 Free Software Foundation
+ Copyright (C) 2008, 2010, 2011 Free Software Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <gtk/gtk.h>
#include <stdlib.h>
-#include <language/syntax-string-source.h>
#include <ui/gui/psppire-data-window.h>
#include <ui/gui/dialog-common.h>
#include <ui/gui/dict-display.h>
#undef CS
};
-enum
- {
- LABEL,
- NO_LABEL,
- NO_VAL_LABEL,
- };
struct format_options
{
gboolean avalue;
GtkWidget *stat_view;
GtkWidget *cell_view;
- GtkToggleButton *label;
- GtkToggleButton *no_label;
- GtkToggleButton *no_val_label;
struct format_options current_opts;
};
on_format_clicked (struct crosstabs_dialog *cd)
{
int ret;
- gboolean lab;
- gboolean no_lab;
- gboolean no_val_lab;
if (cd->current_opts.avalue)
{
{
gtk_toggle_button_set_active (cd->pivot_button, TRUE);
}
- lab = gtk_toggle_button_get_active (cd->label);
- no_lab = gtk_toggle_button_get_active (cd->no_label);
- no_val_lab = gtk_toggle_button_get_active (cd->no_val_label);
- if (!lab)
- if (!no_lab)
- if (!no_val_lab)
- gtk_toggle_button_set_active (cd->label, TRUE);
-
ret = psppire_dialog_run (PSPPIRE_DIALOG (cd->format_dialog));
cd->current_opts.pivot = (gtk_toggle_button_get_active (cd->pivot_button) == TRUE)
? TRUE : FALSE;
}
- else
- {
- gtk_toggle_button_set_active (cd->label, lab);
- gtk_toggle_button_set_active (cd->no_label, no_lab);
- gtk_toggle_button_set_active (cd->no_val_label, no_val_lab);
- }
}
static void
g_string_append (string, "DVALUE");
}
g_string_append (string, " ");
- if (gtk_toggle_button_get_active (cd->label))
- {
- g_string_append (string, "LABELS");
- }
- else if (gtk_toggle_button_get_active (cd->no_label))
- {
- g_string_append (string, "NOLABELS");
- }
- else if (gtk_toggle_button_get_active (cd->no_val_label))
- {
- g_string_append (string, "NOVALLABS");
- }
- g_string_append (string, " ");
if (cd->current_opts.table)
g_string_append (string, "TABLES");
else
cd.format_dialog = get_widget_assert (xml, "format-dialog");
cd.table_button = GTK_TOGGLE_BUTTON (get_widget_assert (xml, "print-tables"));
cd.pivot_button = GTK_TOGGLE_BUTTON (get_widget_assert (xml, "pivot"));
- cd.label = GTK_TOGGLE_BUTTON (get_widget_assert (xml, "radiobutton1"));
- cd.no_label = GTK_TOGGLE_BUTTON (get_widget_assert (xml, "radiobutton2"));
- cd.no_val_label = GTK_TOGGLE_BUTTON (get_widget_assert (xml, "radiobutton3"));
cd.stat_dialog = get_widget_assert (xml, "stat-dialog");
cd.cell_dialog = get_widget_assert (xml, "cell-dialog");
switch (response)
{
case GTK_RESPONSE_OK:
- {
- gchar *syntax = generate_syntax (&cd);
-
- struct getl_interface *sss = create_syntax_string_source (syntax);
- execute_syntax (sss);
-
- g_free (syntax);
- }
+ g_free (execute_syntax_string (de, generate_syntax (&cd)));
break;
case PSPPIRE_RESPONSE_PASTE:
- {
- gchar *syntax = generate_syntax (&cd);
-
- paste_syntax_to_window (syntax);
-
- g_free (syntax);
- }
+ g_free (paste_syntax_to_window (generate_syntax (&cd)));
break;
default:
break;