#include "dialog-common.h"
#include "dict-display.h"
#include "widget-io.h"
+#include "t-test-options.h"
#include <language/syntax-string-source.h>
#include "syntax-editor.h"
GtkWidget *dialog;
PsppireDict *dict;
gboolean groups_defined;
- gboolean non_default_options;
- gdouble confidence_interval;
+
+ struct tt_options_dialog *opts;
};
g_string_append (str, ")");
}
- if ( d->non_default_options )
- {
- GtkToggleButton *analysis =
- GTK_TOGGLE_BUTTON (get_widget_assert (d->xml, "radiobutton1"));
-
- g_string_append (str, "\n\t");
- g_string_append_printf (str, "/CRITERIA=CIN(%g)",
- d->confidence_interval/100.0);
-
- g_string_append (str, "\n\t");
- g_string_append_printf (str, "/MISSING=%s",
- gtk_toggle_button_get_active (analysis) ?
- "ANALYSIS" : "LISTWISE");
- }
+ tt_options_dialog_append_syntax (d->opts, str);
g_string_append (str, ".\n");
}
-static void
-run_options (struct tt_indep_samples_dialog *ttd)
-{
- gint response;
- GtkWidget *dialog =
- get_widget_assert (ttd->xml, "options-dialog");
-
- GtkWidget *box =
- get_widget_assert (ttd->xml, "vbox1");
-
- GtkSpinButton *conf_percent = NULL;
-
- GtkWidget *confidence =
- widget_scanf (_("Confidence Interval: %2d %%"),
- &conf_percent);
-
- gtk_spin_button_set_value (conf_percent, ttd->confidence_interval);
-
- gtk_widget_show (confidence);
-
- gtk_box_pack_start_defaults (GTK_BOX (box), confidence);
-
- gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (ttd->dialog));
-
- response = psppire_dialog_run (PSPPIRE_DIALOG (dialog));
-
- if ( response == PSPPIRE_RESPONSE_CONTINUE)
- {
- ttd->non_default_options = TRUE;
- ttd->confidence_interval = gtk_spin_button_get_value (conf_percent);
- }
-
- gtk_container_remove (GTK_CONTAINER (box), confidence);
-}
-
-
-
static gboolean
dialog_state_valid (gpointer data)
GtkWidget *selector1 =
get_widget_assert (xml, "indep-samples-t-test-selector1");
-
GtkWidget *entry =
get_widget_assert (xml, "indep-samples-t-test-entry");
tt_d.xml = xml;
tt_d.dict = vs->dict;
tt_d.groups_defined = FALSE;
- tt_d.non_default_options = FALSE;
- tt_d.confidence_interval = 95.0;
+ tt_d.opts = tt_options_dialog_create (xml, de->parent.window);
gtk_window_set_transient_for (GTK_WINDOW (tt_d.dialog), de->parent.window);
g_signal_connect_swapped (options_button, "clicked",
- G_CALLBACK (run_options), &tt_d);
+ G_CALLBACK (tt_options_dialog_run), tt_d.opts);
g_signal_connect_swapped (tt_d.dialog, "refresh", G_CALLBACK (refresh), xml);
break;
}
-
+ tt_options_dialog_destroy (tt_d.opts);
g_object_unref (xml);
}