From: John Darrington Date: Sun, 8 Aug 2010 18:10:04 +0000 (+0200) Subject: Aggregate-dialog: Preselect summary function and variable name. X-Git-Tag: v0.7.6~302 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36ecb7330415c542f02ffb28459926bfcf0bd160;p=pspp-builds.git Aggregate-dialog: Preselect summary function and variable name. Apparently the most common use of aggregate is to count cases. Therefore we set the default summary function and variable name controls, so that the user has fewer keystrokes/mouse clicks in order to achieve this. --- diff --git a/src/language/stats/aggregate.c b/src/language/stats/aggregate.c index 7625a6f1..bcc8a3be 100644 --- a/src/language/stats/aggregate.c +++ b/src/language/stats/aggregate.c @@ -87,16 +87,6 @@ struct agr_var struct casewriter *writer; }; -/* Aggregation functions. */ -enum - { - SUM, MEAN, MEDIAN, SD, MAX, MIN, PGT, PLT, PIN, POUT, FGT, FLT, FIN, - FOUT, N, NU, NMISS, NUMISS, FIRST, LAST, - - FUNC = 0x1f, /* Function mask. */ - FSTRING = 1<<5, /* String function bit. */ - }; - /* Attributes of aggregation functions. */ const struct agr_func agr_func_tab[] = diff --git a/src/language/stats/aggregate.h b/src/language/stats/aggregate.h index 95e574a0..1a50bbe4 100644 --- a/src/language/stats/aggregate.h +++ b/src/language/stats/aggregate.h @@ -30,6 +30,16 @@ enum agr_src_vars AGR_SV_OPT }; +/* Aggregation functions. */ +enum + { + SUM, MEAN, MEDIAN, SD, MAX, MIN, PGT, PLT, PIN, POUT, FGT, FLT, FIN, + FOUT, N, NU, NMISS, NUMISS, FIRST, LAST, + + FUNC = 0x1f, /* Function mask. */ + FSTRING = 1<<5, /* String function bit. */ + }; + /* Attributes of an aggregation function. */ struct agr_func { diff --git a/src/ui/gui/aggregate-dialog.c b/src/ui/gui/aggregate-dialog.c index e1a688a3..40a06a92 100644 --- a/src/ui/gui/aggregate-dialog.c +++ b/src/ui/gui/aggregate-dialog.c @@ -122,9 +122,10 @@ refresh (struct aggregate *agg) gtk_entry_set_text (GTK_ENTRY (agg->summary_arg1_entry), ""); gtk_entry_set_text (GTK_ENTRY (agg->summary_arg2_entry), ""); gtk_entry_set_text (GTK_ENTRY (agg->summary_var_label_entry), ""); - gtk_entry_set_text (GTK_ENTRY (agg->summary_var_name_entry), ""); + gtk_entry_set_text (GTK_ENTRY (agg->summary_var_name_entry), "N_BREAK"); + gtk_editable_select_region (GTK_EDITABLE (agg->summary_var_name_entry), 0, -1); - gtk_combo_box_set_active (GTK_COMBO_BOX (agg->function_combo), -1); + gtk_combo_box_set_active (GTK_COMBO_BOX (agg->function_combo), N); gtk_list_store_clear (PSPPIRE_ACR (agg->summary_acr)->list_store);