static void psppire_dialog_action_indep_samps_activate (GtkAction *a) { PsppireDialogActionIndepSamps *act = PSPPIRE_DIALOG_ACTION_INDEP_SAMPS (a); PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); GtkBuilder *xml = builder_new ("indep-samples.ui"); pda->dialog = get_widget_assert (xml,"independent-samples-dialog"); pda->source = get_widget_assert (xml, "indep-samples-treeview1"); act->define_groups_button = get_widget_assert (xml, "define-groups-button"); act->options_button = get_widget_assert (xml, "indep-samples-options-button"); act->def_grps_dialog = get_widget_assert (xml, "define-groups-dialog"); act->group_var_entry = get_widget_assert (xml, "indep-samples-entry"); act->test_vars_tv = get_widget_assert (xml, "indep-samples-treeview2"); act->dg_dialog = get_widget_assert (xml, "define-groups-dialog"); act->dg_grp_entry[0] = get_widget_assert (xml, "group1-entry"); act->dg_grp_entry[1] = get_widget_assert (xml, "group2-entry"); act->dg_cut_point_entry = get_widget_assert (xml, "cut-point-entry"); act->dg_box = get_widget_assert (xml, "dialog-hbox2"); act->dg_table1 = get_widget_assert (xml, "table1"); act->dg_table2 = get_widget_assert (xml, "table2"); act->dg_label = get_widget_assert (xml, "label4"); act->dg_hbox1 = get_widget_assert (xml, "hbox1"); act->dg_values_toggle_button = get_widget_assert (xml, "radiobutton3"); act->dg_cut_point_toggle_button = get_widget_assert (xml, "radiobutton4"); act->opts = tt_options_dialog_create (GTK_WINDOW (pda->toplevel)); g_object_ref (act->dg_table1); g_object_ref (act->dg_table2); g_signal_connect (act->dg_values_toggle_button, "toggled", G_CALLBACK (set_group_criterion_type), act); g_object_unref (xml); psppire_dialog_action_set_refresh (pda, refresh); psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); g_signal_connect_swapped (act->define_groups_button, "clicked", G_CALLBACK (run_define_groups), act); g_signal_connect_swapped (act->options_button, "clicked", G_CALLBACK (tt_options_dialog_run), act->opts); g_signal_connect (act->group_var_entry, "changed", G_CALLBACK (on_grp_var_change), act); if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_indep_samps_parent_class)->activate) PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_indep_samps_parent_class)->activate (pda); }
static void psppire_dialog_action_examine_activate (GtkAction *a) { PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); PsppireDialogActionExamine *act = PSPPIRE_DIALOG_ACTION_EXAMINE (a); GtkBuilder *xml = builder_new ("examine.ui"); GtkWidget *stats_button = get_widget_assert (xml, "stats-button"); GtkWidget *opts_button = get_widget_assert (xml, "opts-button"); GtkWidget *dep_sel = get_widget_assert (xml, "psppire-selector1"); pda->dialog = get_widget_assert (xml, "examine-dialog"); pda->source = get_widget_assert (xml, "treeview1"); act->variables = get_widget_assert (xml, "treeview2"); act->factors = get_widget_assert (xml, "treeview3"); act->id_var = get_widget_assert (xml, "entry1"); act->stats_dialog = get_widget_assert (xml, "statistics-dialog"); act->descriptives_button = get_widget_assert (xml, "descriptives-button"); act->extremes_button = get_widget_assert (xml, "extremes-button"); act->percentiles_button = get_widget_assert (xml, "percentiles-button"); act->opts_dialog = get_widget_assert (xml, "options-dialog"); act->listwise = get_widget_assert (xml, "radiobutton1"); act->pairwise = get_widget_assert (xml, "radiobutton2"); act->report = get_widget_assert (xml, "radiobutton3"); g_object_set (pda->source, "model", pda->dict, NULL); psppire_selector_set_allow (PSPPIRE_SELECTOR (dep_sel), numeric_only); psppire_dialog_action_set_valid_predicate (pda, (void *) dialog_state_valid); psppire_dialog_action_set_refresh (pda, dialog_refresh); g_signal_connect_swapped (stats_button, "clicked", G_CALLBACK (run_stats_dialog), act); g_signal_connect_swapped (opts_button, "clicked", G_CALLBACK (run_opts_dialog), act); PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_examine_parent_class)->activate (pda); }
static void psppire_dialog_action_reliability_activate (GtkAction *a) { PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); PsppireDialogActionReliability *act = PSPPIRE_DIALOG_ACTION_RELIABILITY (a); GtkTreeModel *liststore ; GtkBuilder *xml = builder_new ("reliability.ui"); pda->dialog = get_widget_assert (xml, "reliability-dialog"); pda->source = get_widget_assert (xml, "dict-view"); act->variables = get_widget_assert (xml, "treeview2"); act->split_point_hbox = get_widget_assert (xml, "split-point-hbox"); act->variables = get_widget_assert (xml, "treeview2"); act->model_combo = get_widget_assert (xml, "combobox1"); act->split_spinbutton = get_widget_assert (xml, "spinbutton1"); liststore = gtk_tree_view_get_model (GTK_TREE_VIEW (act->variables)); act->scale_if_item_deleted_checkbutton = get_widget_assert (xml, "totals-checkbutton"); g_signal_connect_swapped (act->model_combo, "changed", G_CALLBACK (update_split_control), pda); g_signal_connect_swapped (liststore, "row-inserted", G_CALLBACK (update_split_control), pda); g_signal_connect_swapped (liststore, "row-deleted", G_CALLBACK (update_split_control), pda); psppire_dialog_action_set_refresh (pda, refresh); psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_reliability_parent_class)->activate) PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_reliability_parent_class)->activate (pda); g_object_unref (xml); }
/* Called whenever the group variable entry widget's contents change */ static void on_grp_var_change (GtkEntry *entry, PsppireDialogActionIndepSamps *act) { PsppireDialogAction *da = PSPPIRE_DIALOG_ACTION (act); const gchar *text = gtk_entry_get_text (entry); const struct variable *v = psppire_dict_lookup_var (da->dict, text); gtk_widget_set_sensitive (act->define_groups_button, v != NULL); if (act->grp_var) { int width = var_get_width (act->grp_var); value_destroy (&act->cut_point, width); value_destroy (&act->grp_val[0], width); value_destroy (&act->grp_val[1], width); } if (v) { const int width = var_get_width (v); value_init (&act->cut_point, width); value_init (&act->grp_val[0], width); value_init (&act->grp_val[1], width); if (width == 0) { act->cut_point.f = SYSMIS; act->grp_val[0].f = SYSMIS; act->grp_val[1].f = SYSMIS; } else { act->cut_point.short_string[0] = '\0'; act->grp_val[0].short_string[0] = '\0'; act->grp_val[1].short_string[0] = '\0'; } } act->grp_var = v; }
static void psppire_dialog_action_sort_activate (GtkAction *a) { PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); PsppireDialogActionSort *act = PSPPIRE_DIALOG_ACTION_SORT (a); GtkBuilder *xml = builder_new ("sort.ui"); pda->dialog = get_widget_assert (xml, "sort-cases-dialog"); pda->source = get_widget_assert (xml, "sort-cases-treeview1"); act->variables = get_widget_assert (xml, "sort-cases-treeview2"); act->ascending = get_widget_assert (xml, "sort-cases-radiobutton0"); psppire_dialog_action_set_refresh (pda, reset); psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_sort_parent_class)->activate) PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_sort_parent_class)->activate (pda); }
static void run_define_groups (PsppireDialogActionIndepSamps *act) { gint response; PsppireDialogAction *da = PSPPIRE_DIALOG_ACTION (act); if ( act->dg_table2->parent) gtk_container_remove (GTK_CONTAINER (act->dg_table2->parent), act->dg_table2); if ( act->dg_table1->parent) gtk_container_remove (GTK_CONTAINER (act->dg_table1->parent), act->dg_table1); if ( var_is_numeric (act->grp_var)) { gtk_table_attach_defaults (GTK_TABLE (act->dg_table1), act->dg_table2, 1, 2, 1, 2); gtk_container_add (GTK_CONTAINER (act->dg_box), act->dg_table1); } else { gtk_container_add (GTK_CONTAINER (act->dg_box), act->dg_table2); act->group_defn = GROUPS_VALUES; } psppire_dialog_set_valid_predicate (PSPPIRE_DIALOG (act->dg_dialog), define_groups_state_valid, act); psppire_value_entry_set_variable (PSPPIRE_VALUE_ENTRY (act->dg_grp_entry[0]), act->grp_var); psppire_value_entry_set_variable (PSPPIRE_VALUE_ENTRY (act->dg_grp_entry[1]), act->grp_var); psppire_value_entry_set_variable (PSPPIRE_VALUE_ENTRY (act->dg_cut_point_entry), act->grp_var); if ( act->group_defn != GROUPS_CUT_POINT ) { gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (act->dg_cut_point_toggle_button), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (act->dg_values_toggle_button), TRUE); } else { gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (act->dg_values_toggle_button), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (act->dg_cut_point_toggle_button), TRUE); } g_signal_emit_by_name (act->dg_grp_entry[0], "changed"); g_signal_emit_by_name (act->dg_grp_entry[1], "changed"); g_signal_emit_by_name (act->dg_cut_point_entry, "changed"); response = psppire_dialog_run (PSPPIRE_DIALOG (act->def_grps_dialog)); if (response == PSPPIRE_RESPONSE_CONTINUE) { const int width = var_get_width (act->grp_var); if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (act->dg_values_toggle_button))) { act->group_defn = GROUPS_VALUES; psppire_value_entry_get_value (PSPPIRE_VALUE_ENTRY (act->dg_grp_entry[0]), &act->grp_val[0], width); psppire_value_entry_get_value (PSPPIRE_VALUE_ENTRY (act->dg_grp_entry[1]), &act->grp_val[1], width); } else { act->group_defn = GROUPS_CUT_POINT; psppire_value_entry_get_value (PSPPIRE_VALUE_ENTRY (act->dg_cut_point_entry), &act->cut_point, width); } psppire_dialog_notify_change (PSPPIRE_DIALOG (da->dialog)); } }
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; psppire_checkbox_treeview_populate (PSPPIRE_CHECKBOX_TREEVIEW (act->cell_view), B_CS_CELL_DEFAULT, N_CROSSTABS_CELLS, cells); act->cell = gtk_tree_view_get_model (GTK_TREE_VIEW (act->cell_view)); psppire_checkbox_treeview_populate (PSPPIRE_CHECKBOX_TREEVIEW (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); }