From f548196d5cc509d19ba0f7c67da513e9dd4f996d Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 1 Dec 2012 12:15:56 +0100 Subject: [PATCH] Converted crosstabs-dialog to the new way of doing things --- src/ui/gui/automake.mk | 4 +- src/ui/gui/crosstabs-dialog.h | 24 -- src/ui/gui/data-editor.ui | 3 +- src/ui/gui/psppire-data-window.c | 2 - ...og.c => psppire-dialog-action-crosstabs.c} | 376 ++++++++---------- src/ui/gui/psppire-dialog-action-crosstabs.h | 102 +++++ src/ui/gui/widgets.c | 2 + 7 files changed, 276 insertions(+), 237 deletions(-) delete mode 100644 src/ui/gui/crosstabs-dialog.h rename src/ui/gui/{crosstabs-dialog.c => psppire-dialog-action-crosstabs.c} (51%) create mode 100644 src/ui/gui/psppire-dialog-action-crosstabs.h diff --git a/src/ui/gui/automake.mk b/src/ui/gui/automake.mk index d9ed78e875..6d3b6d0ec3 100644 --- a/src/ui/gui/automake.mk +++ b/src/ui/gui/automake.mk @@ -176,8 +176,6 @@ src_ui_gui_psppire_SOURCES = \ src/ui/gui/chi-square-dialog.h \ src/ui/gui/count-dialog.c \ src/ui/gui/count-dialog.h \ - src/ui/gui/crosstabs-dialog.c \ - src/ui/gui/crosstabs-dialog.h \ src/ui/gui/customentry.c \ src/ui/gui/customentry.h \ src/ui/gui/dialog-common.c \ @@ -226,6 +224,8 @@ src_ui_gui_psppire_SOURCES = \ src/ui/gui/psppire-dialog-action-binomial.h \ src/ui/gui/psppire-dialog-action-correlation.c \ src/ui/gui/psppire-dialog-action-correlation.h \ + src/ui/gui/psppire-dialog-action-crosstabs.c \ + src/ui/gui/psppire-dialog-action-crosstabs.h \ src/ui/gui/psppire-dialog-action-descriptives.c \ src/ui/gui/psppire-dialog-action-descriptives.h \ src/ui/gui/psppire-dialog-action-examine.c \ diff --git a/src/ui/gui/crosstabs-dialog.h b/src/ui/gui/crosstabs-dialog.h deleted file mode 100644 index 65e47610d6..0000000000 --- a/src/ui/gui/crosstabs-dialog.h +++ /dev/null @@ -1,24 +0,0 @@ -/* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2008, 2010 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 - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -#ifndef __CROSSTABS_DIALOG_H -#define __CROSSTABS_DIALOG_H - -#include "psppire-data-window.h" - -void crosstabs_dialog (PsppireDataWindow * data); - -#endif diff --git a/src/ui/gui/data-editor.ui b/src/ui/gui/data-editor.ui index 8d948a5b6e..da3a4a5e59 100644 --- a/src/ui/gui/data-editor.ui +++ b/src/ui/gui/data-editor.ui @@ -367,8 +367,9 @@ - + crosstabs + uimanager1 _Crosstabs... diff --git a/src/ui/gui/psppire-data-window.c b/src/ui/gui/psppire-data-window.c index 3a032f0a28..9e5860b719 100644 --- a/src/ui/gui/psppire-data-window.c +++ b/src/ui/gui/psppire-data-window.c @@ -31,7 +31,6 @@ #include "ui/gui/comments-dialog.h" #include "ui/gui/compute-dialog.h" #include "ui/gui/count-dialog.h" -#include "ui/gui/crosstabs-dialog.h" #include "ui/gui/entry-dialog.h" #include "ui/gui/executor.h" #include "ui/gui/find-dialog.h" @@ -1090,7 +1089,6 @@ psppire_data_window_finish_init (PsppireDataWindow *de, connect_action (de, "transform_count", G_CALLBACK (count_dialog)); connect_action (de, "transform_recode-same", G_CALLBACK (recode_same_dialog)); connect_action (de, "transform_recode-different", G_CALLBACK (recode_different_dialog)); - connect_action (de, "crosstabs", G_CALLBACK (crosstabs_dialog)); connect_action (de, "univariate", G_CALLBACK (univariate_dialog)); connect_action (de, "chi-square", G_CALLBACK (chisquare_dialog)); connect_action (de, "runs", G_CALLBACK (runs_dialog)); diff --git a/src/ui/gui/crosstabs-dialog.c b/src/ui/gui/psppire-dialog-action-crosstabs.c similarity index 51% rename from src/ui/gui/crosstabs-dialog.c rename to src/ui/gui/psppire-dialog-action-crosstabs.c index dc046679c7..2bc07c6e4c 100644 --- a/src/ui/gui/crosstabs-dialog.c +++ b/src/ui/gui/psppire-dialog-action-crosstabs.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2008, 2010, 2011, 2012 Free Software Foundation + Copyright (C) 2012 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 @@ -14,29 +14,59 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include -#include "checkbox-treeview.h" -#include "crosstabs-dialog.h" -#include "psppire-var-view.h" +#include -#include -#include +#include "psppire-dialog-action-crosstabs.h" +#include "psppire-value-entry.h" -#include -#include -#include -#include "executor.h" -#include -#include -#include +#include "dialog-common.h" #include "helper.h" +#include +#include "psppire-var-view.h" + +#include "psppire-dialog.h" +#include "builder-wrapper.h" +#include "checkbox-treeview.h" +#include "psppire-dict.h" +#include "libpspp/str.h" #include "gettext.h" #define _(msgid) gettext (msgid) #define N_(msgid) msgid +static void +psppire_dialog_action_crosstabs_class_init (PsppireDialogActionCrosstabsClass *class); + +G_DEFINE_TYPE (PsppireDialogActionCrosstabs, psppire_dialog_action_crosstabs, PSPPIRE_TYPE_DIALOG_ACTION); + +static gboolean +dialog_state_valid (gpointer data) +{ + PsppireDialogActionCrosstabs *cd = PSPPIRE_DIALOG_ACTION_CROSSTABS (data); + + GtkTreeModel *row_vars = gtk_tree_view_get_model (GTK_TREE_VIEW (cd->dest_rows)); + GtkTreeModel *col_vars = gtk_tree_view_get_model (GTK_TREE_VIEW (cd->dest_cols)); + + GtkTreeIter notused; + + return (gtk_tree_model_get_iter_first (row_vars, ¬used) + && gtk_tree_model_get_iter_first (col_vars, ¬used)); +} + +static void +refresh (PsppireDialogAction *rd_) +{ + PsppireDialogActionCrosstabs *cd = PSPPIRE_DIALOG_ACTION_CROSSTABS (rd_); + + GtkTreeModel *liststore = gtk_tree_view_get_model (GTK_TREE_VIEW (cd->dest_rows)); + gtk_list_store_clear (GTK_LIST_STORE (liststore)); + + liststore = gtk_tree_view_get_model (GTK_TREE_VIEW (cd->dest_cols)); + gtk_list_store_clear (GTK_LIST_STORE (liststore)); +} + #define CROSSTABS_STATS \ CS (CHISQ, N_("Chisq")) \ CS (PHI, N_("Phi")) \ @@ -53,6 +83,7 @@ CS (CORR, N_("Corr")) \ CS (STATS_NONE, N_("None")) + #define CROSSTABS_CELLS \ CS (COUNT, N_("Count")) \ CS (ROW, N_("Row")) \ @@ -109,84 +140,36 @@ static const struct checkbox_entry_item cells[] = #undef CS }; -struct format_options -{ - gboolean avalue; - gboolean pivot; - gboolean table; -}; - -struct crosstabs_dialog -{ - GtkTreeView *row_vars; - GtkTreeView *col_vars; - PsppireDict *dict; - - GtkToggleButton *table_button; - GtkToggleButton *pivot_button; - - GtkWidget *format_dialog; - GtkWidget *cell_dialog; - GtkWidget *stat_dialog; - - GtkToggleButton *avalue; - GtkTreeModel *stat; - GtkTreeModel *cell; - - GtkWidget *stat_view; - GtkWidget *cell_view; - struct format_options current_opts; -}; - -static void -refresh (PsppireDialog *dialog, struct crosstabs_dialog *cd) -{ - GtkTreeModel *liststore = gtk_tree_view_get_model (cd->row_vars); - gtk_list_store_clear (GTK_LIST_STORE (liststore)); - - liststore = gtk_tree_view_get_model (cd->col_vars); - gtk_list_store_clear (GTK_LIST_STORE (liststore)); -} static void -on_format_clicked (struct crosstabs_dialog *cd) +on_format_clicked (PsppireDialogActionCrosstabs *cd) { int ret; - if (cd->current_opts.avalue) - { - gtk_toggle_button_set_active (cd->avalue, TRUE); - } - if (cd->current_opts.table) - { - gtk_toggle_button_set_active (cd->table_button, TRUE); - } - if (cd->current_opts.pivot) - { - gtk_toggle_button_set_active (cd->pivot_button, TRUE); - } + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->avalue_button), cd->format_options_avalue); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->table_button), cd->format_options_table); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->pivot_button), cd->format_options_pivot); ret = psppire_dialog_run (PSPPIRE_DIALOG (cd->format_dialog)); if ( ret == PSPPIRE_RESPONSE_CONTINUE ) { - cd->current_opts.avalue = (gtk_toggle_button_get_active (cd->avalue) == TRUE ) - ? TRUE : FALSE; - cd->current_opts.table = (gtk_toggle_button_get_active (cd->table_button) == TRUE) - ? TRUE : FALSE; - cd->current_opts.pivot = (gtk_toggle_button_get_active (cd->pivot_button) == TRUE) - ? TRUE : FALSE; + cd->format_options_avalue = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cd->avalue_button)); + + cd->format_options_table = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cd->table_button)); + + cd->format_options_pivot = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (cd->pivot_button)); } } static void -on_statistics_clicked (struct crosstabs_dialog *cd) +on_cell_clicked (PsppireDialogActionCrosstabs *cd) { - GtkListStore *liststore; - int ret; - - liststore = clone_list_store (GTK_LIST_STORE (cd->stat)); + GtkListStore *liststore = clone_list_store (GTK_LIST_STORE (cd->cell)); - ret = psppire_dialog_run (PSPPIRE_DIALOG (cd->stat_dialog)); + gint ret = psppire_dialog_run (PSPPIRE_DIALOG (cd->cell_dialog)); if ( ret == PSPPIRE_RESPONSE_CONTINUE ) { @@ -194,20 +177,18 @@ on_statistics_clicked (struct crosstabs_dialog *cd) } else { - g_object_unref (cd->stat); - gtk_tree_view_set_model (GTK_TREE_VIEW (cd->stat_view) , GTK_TREE_MODEL (liststore)); - cd->stat = GTK_TREE_MODEL (liststore); + gtk_tree_view_set_model (GTK_TREE_VIEW (cd->cell_view) , GTK_TREE_MODEL (liststore)); + cd->cell = GTK_TREE_MODEL (liststore); } } + + static void -on_cell_clicked (struct crosstabs_dialog *cd) +on_statistics_clicked (PsppireDialogActionCrosstabs *cd) { - GtkListStore *liststore; - int ret; - - liststore = clone_list_store (GTK_LIST_STORE (cd->cell)); + GtkListStore *liststore = clone_list_store (GTK_LIST_STORE (cd->stat)); - ret = psppire_dialog_run (PSPPIRE_DIALOG (cd->cell_dialog)); + gint ret = psppire_dialog_run (PSPPIRE_DIALOG (cd->stat_dialog)); if ( ret == PSPPIRE_RESPONSE_CONTINUE ) { @@ -215,51 +196,119 @@ on_cell_clicked (struct crosstabs_dialog *cd) } else { - g_object_unref (cd->cell); - gtk_tree_view_set_model (GTK_TREE_VIEW (cd->cell_view) , GTK_TREE_MODEL (liststore)); - cd->cell = GTK_TREE_MODEL (liststore); + gtk_tree_view_set_model (GTK_TREE_VIEW (cd->stat_view) , GTK_TREE_MODEL (liststore)); + cd->stat = GTK_TREE_MODEL (liststore); } } + +static void +psppire_dialog_action_crosstabs_activate (GtkAction *a) +{ + PsppireDialogActionCrosstabs *act = PSPPIRE_DIALOG_ACTION_CROSSTABS (a); + PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); + + GtkBuilder *xml = builder_new ("crosstabs.ui"); + + pda->dialog = get_widget_assert (xml, "crosstabs-dialog"); + pda->source = get_widget_assert (xml, "dict-treeview"); + + act->dest_rows = get_widget_assert (xml, "rows"); + act->dest_cols = get_widget_assert (xml, "cols"); + act->format_button = get_widget_assert (xml, "format-button"); + act->stat_button = get_widget_assert (xml, "stats-button"); + act->cell_button = get_widget_assert (xml, "cell-button"); + act->stat_view = get_widget_assert (xml, "stats-view"); + act->cell_view = get_widget_assert (xml, "cell-view"); + act->cell_dialog = get_widget_assert (xml, "cell-dialog"); + act->stat_dialog = get_widget_assert (xml, "stat-dialog"); + act->format_dialog = get_widget_assert (xml, "format-dialog"); + + act->avalue_button = get_widget_assert (xml, "ascending"); + act->table_button = get_widget_assert (xml, "print-tables"); + act->pivot_button = get_widget_assert (xml, "pivot"); + + + g_object_unref (xml); + + act->format_options_avalue = TRUE; + act->format_options_table = TRUE; + act->format_options_pivot = TRUE; + + put_checkbox_items_in_treeview (GTK_TREE_VIEW (act->cell_view), + B_CS_CELL_DEFAULT, + N_CROSSTABS_CELLS, + cells + ); + + act->cell = gtk_tree_view_get_model (GTK_TREE_VIEW (act->cell_view)); + + put_checkbox_items_in_treeview (GTK_TREE_VIEW (act->stat_view), + B_CS_STATS_DEFAULT, + N_CROSSTABS_STATS, + stats + ); + + act->stat = gtk_tree_view_get_model (GTK_TREE_VIEW (act->stat_view)); + + psppire_dialog_action_set_refresh (pda, refresh); + + psppire_dialog_action_set_valid_predicate (pda, + dialog_state_valid); + + g_signal_connect_swapped (act->cell_button, "clicked", + G_CALLBACK (on_cell_clicked), act); + + g_signal_connect_swapped (act->stat_button, "clicked", + G_CALLBACK (on_statistics_clicked), act); + + g_signal_connect_swapped (act->format_button, "clicked", + G_CALLBACK (on_format_clicked), act); + + + if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_crosstabs_parent_class)->activate) + PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_crosstabs_parent_class)->activate (pda); +} + + + static char * -generate_syntax (const struct crosstabs_dialog *cd) +generate_syntax (PsppireDialogAction *a) { - gint i; - int n; + PsppireDialogActionCrosstabs *cd = PSPPIRE_DIALOG_ACTION_CROSSTABS (a); + gchar *text = NULL; + int i, n; guint selected; - GtkTreeIter iter; + GString *string = g_string_new ("CROSSTABS "); gboolean ok; - - gchar *text; - GString *string = g_string_new ("CROSSTABS"); + GtkTreeIter iter; g_string_append (string, "\n\t/TABLES="); - psppire_var_view_append_names (PSPPIRE_VAR_VIEW (cd->row_vars), 0, string); + psppire_var_view_append_names (PSPPIRE_VAR_VIEW (cd->dest_rows), 0, string); g_string_append (string, "\tBY\t"); - psppire_var_view_append_names (PSPPIRE_VAR_VIEW (cd->col_vars), 0, string); + psppire_var_view_append_names (PSPPIRE_VAR_VIEW (cd->dest_cols), 0, string); + g_string_append (string, "\n\t/FORMAT="); - if (cd->current_opts.avalue) - { - g_string_append (string, "AVALUE"); - } + if (cd->format_options_avalue) + g_string_append (string, "AVALUE"); else - { - g_string_append (string, "DVALUE"); - } + g_string_append (string, "DVALUE"); g_string_append (string, " "); - if (cd->current_opts.table) + + if (cd->format_options_table) g_string_append (string, "TABLES"); else g_string_append (string, "NOTABLES"); g_string_append (string, " "); - if (cd->current_opts.pivot) + if (cd->format_options_pivot) g_string_append (string, "PIVOT"); else g_string_append (string, "NOPIVOT"); + selected = 0; for (i = 0, ok = gtk_tree_model_get_iter_first (cd->stat, &iter); ok; i++, ok = gtk_tree_model_iter_next (cd->stat, &iter)) @@ -302,6 +351,8 @@ generate_syntax (const struct crosstabs_dialog *cd) selected &= ~(1u << i); } + + g_string_append (string, "\n\t/CELLS="); if (selected & (1u << CS_CELLS_NONE)) g_string_append (string, "NONE"); @@ -316,7 +367,7 @@ generate_syntax (const struct crosstabs_dialog *cd) g_string_append (string, cells[i].name); } } - + g_string_append (string, ".\n"); text = string->str; @@ -326,110 +377,19 @@ generate_syntax (const struct crosstabs_dialog *cd) return text; } -/* Dialog is valid iff at least one row and one column variable has - been selected. */ -static gboolean -dialog_state_valid (gpointer data) +static void +psppire_dialog_action_crosstabs_class_init (PsppireDialogActionCrosstabsClass *class) { - struct crosstabs_dialog *cd = data; - - GtkTreeModel *row_vars = gtk_tree_view_get_model (cd->row_vars); - GtkTreeModel *col_vars = gtk_tree_view_get_model (cd->col_vars); + GtkActionClass *action_class = GTK_ACTION_CLASS (class); - GtkTreeIter notused; + action_class->activate = psppire_dialog_action_crosstabs_activate; - return (gtk_tree_model_get_iter_first (row_vars, ¬used) - && gtk_tree_model_get_iter_first (col_vars, ¬used)); + PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax; } -/* Pops up the Crosstabs dialog box */ -void -crosstabs_dialog (PsppireDataWindow *de) -{ - gint response; - struct crosstabs_dialog cd; - - GtkBuilder *xml = builder_new ("crosstabs.ui"); - PsppireVarStore *vs = NULL; - PsppireDict *dict = NULL; - - - GtkWidget *dialog = get_widget_assert (xml, "crosstabs-dialog"); - GtkWidget *source = get_widget_assert (xml, "dict-treeview"); - GtkWidget *dest_rows = get_widget_assert (xml, "rows"); - GtkWidget *dest_cols = get_widget_assert (xml, "cols"); - GtkWidget *format_button = get_widget_assert (xml, "format-button"); - GtkWidget *stat_button = get_widget_assert (xml, "stats-button"); - GtkWidget *cell_button = get_widget_assert (xml, "cell-button"); - - cd.stat_view = get_widget_assert (xml, "stats-view"); - cd.cell_view = get_widget_assert (xml, "cell-view"); - - g_object_get (de->data_editor, "var-store", &vs, NULL); - - put_checkbox_items_in_treeview (GTK_TREE_VIEW(cd.stat_view), - B_CS_STATS_DEFAULT, - N_CROSSTABS_STATS, - stats - ); - put_checkbox_items_in_treeview (GTK_TREE_VIEW(cd.cell_view), - B_CS_CELL_DEFAULT, - N_CROSSTABS_CELLS, - cells - ); - - gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); - - g_object_get (vs, "dictionary", &dict, NULL); - g_object_set (source, "model", dict, NULL); - - cd.row_vars = GTK_TREE_VIEW (dest_rows); - cd.col_vars = GTK_TREE_VIEW (dest_cols); - g_object_get (vs, "dictionary", &cd.dict, NULL); - 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.stat_dialog = get_widget_assert (xml, "stat-dialog"); - cd.cell_dialog = get_widget_assert (xml, "cell-dialog"); - - cd.stat = gtk_tree_view_get_model (GTK_TREE_VIEW (cd.stat_view)); - cd.cell = gtk_tree_view_get_model (GTK_TREE_VIEW (cd.cell_view)); - cd.avalue = GTK_TOGGLE_BUTTON (get_widget_assert (xml, "ascending")); - cd.current_opts.avalue = TRUE; - cd.current_opts.table = TRUE; - cd.current_opts.pivot = TRUE; - - gtk_window_set_transient_for (GTK_WINDOW (cd.format_dialog), GTK_WINDOW (de)); - gtk_window_set_transient_for (GTK_WINDOW (cd.cell_dialog), GTK_WINDOW (de)); - gtk_window_set_transient_for (GTK_WINDOW (cd.stat_dialog), GTK_WINDOW (de)); - - g_signal_connect (dialog, "refresh", G_CALLBACK (refresh), &cd); - - psppire_dialog_set_valid_predicate (PSPPIRE_DIALOG (dialog), - dialog_state_valid, &cd); - - g_signal_connect_swapped (format_button, "clicked", - G_CALLBACK (on_format_clicked), &cd); - g_signal_connect_swapped (stat_button, "clicked", - G_CALLBACK (on_statistics_clicked), &cd); - g_signal_connect_swapped (cell_button, "clicked", - G_CALLBACK (on_cell_clicked), &cd); - - response = psppire_dialog_run (PSPPIRE_DIALOG (dialog)); - - - switch (response) - { - case GTK_RESPONSE_OK: - g_free (execute_syntax_string (de, generate_syntax (&cd))); - break; - case PSPPIRE_RESPONSE_PASTE: - g_free (paste_syntax_to_window (generate_syntax (&cd))); - break; - default: - break; - } - - g_object_unref (xml); +static void +psppire_dialog_action_crosstabs_init (PsppireDialogActionCrosstabs *act) +{ } + diff --git a/src/ui/gui/psppire-dialog-action-crosstabs.h b/src/ui/gui/psppire-dialog-action-crosstabs.h new file mode 100644 index 0000000000..ee8169aece --- /dev/null +++ b/src/ui/gui/psppire-dialog-action-crosstabs.h @@ -0,0 +1,102 @@ +/* PSPPIRE - a graphical user interface for PSPP. + Copyright (C) 2012 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 + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + + +#include +#include + +#include "psppire-dialog-action.h" + +#ifndef __PSPPIRE_DIALOG_ACTION_CROSSTABS_H__ +#define __PSPPIRE_DIALOG_ACTION_CROSSTABS_H__ + +G_BEGIN_DECLS + + +#define PSPPIRE_TYPE_DIALOG_ACTION_CROSSTABS (psppire_dialog_action_crosstabs_get_type ()) + +#define PSPPIRE_DIALOG_ACTION_CROSSTABS(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ + PSPPIRE_TYPE_DIALOG_ACTION_CROSSTABS, PsppireDialogActionCrosstabs)) + +#define PSPPIRE_DIALOG_ACTION_CROSSTABS_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), \ + PSPPIRE_TYPE_DIALOG_ACTION_CROSSTABS, \ + PsppireDialogActionCrosstabsClass)) + + +#define PSPPIRE_IS_DIALOG_ACTION_CROSSTABS(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_TYPE_DIALOG_ACTION_CROSSTABS)) + +#define PSPPIRE_IS_DIALOG_ACTION_CROSSTABS_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_TYPE_DIALOG_ACTION_CROSSTABS)) + + +#define PSPPIRE_DIALOG_ACTION_CROSSTABS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \ + PSPPIRE_TYPE_DIALOG_ACTION_CROSSTABS, \ + PsppireDialogActionCrosstabsClass)) + +typedef struct _PsppireDialogActionCrosstabs PsppireDialogActionCrosstabs; +typedef struct _PsppireDialogActionCrosstabsClass PsppireDialogActionCrosstabsClass; + + +struct _PsppireDialogActionCrosstabs +{ + PsppireDialogAction parent; + + /*< private >*/ + gboolean dispose_has_run ; + + GtkWidget *col_vars; + GtkWidget *row_vars; + + GtkWidget *dest_rows; + GtkWidget *dest_cols ; + GtkWidget *format_button ; + GtkWidget *stat_button ; + GtkWidget *cell_button ; + + GtkWidget *stat_view ; + + GtkWidget *cell_view ; + GtkTreeModel *cell ; + GtkWidget *cell_dialog ; + GtkTreeModel *stat; + GtkWidget *stat_dialog ; + + gboolean format_options_avalue; + gboolean format_options_pivot; + gboolean format_options_table; + + GtkWidget *table_button; + GtkWidget *pivot_button; + + GtkWidget *format_dialog; + GtkWidget *avalue_button; +}; + + +struct _PsppireDialogActionCrosstabsClass +{ + PsppireDialogActionClass parent_class; +}; + + +GType psppire_dialog_action_crosstabs_get_type (void) ; + +G_END_DECLS + +#endif /* __PSPPIRE_DIALOG_ACTION_CROSSTABS_H__ */ diff --git a/src/ui/gui/widgets.c b/src/ui/gui/widgets.c index 433ab4f36b..488656e9e6 100644 --- a/src/ui/gui/widgets.c +++ b/src/ui/gui/widgets.c @@ -17,6 +17,7 @@ #include "psppire-dialog-action-binomial.h" #include "psppire-dialog-action-correlation.h" +#include "psppire-dialog-action-crosstabs.h" #include "psppire-dialog-action-descriptives.h" #include "psppire-dialog-action-examine.h" #include "psppire-dialog-action-factor.h" @@ -55,6 +56,7 @@ preregister_widgets (void) psppire_dialog_action_binomial_get_type (); psppire_dialog_action_correlation_get_type (); + psppire_dialog_action_crosstabs_get_type (); psppire_dialog_action_descriptives_get_type (); psppire_dialog_action_examine_get_type (); psppire_dialog_action_factor_get_type (); -- 2.30.2