Aggregate-dialog: Preselect summary function and variable name. 20100809040503/pspp
authorJohn Darrington <john@darrington.wattle.id.au>
Sun, 8 Aug 2010 18:10:04 +0000 (20:10 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sun, 8 Aug 2010 18:15:00 +0000 (20:15 +0200)
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.

src/language/stats/aggregate.c
src/language/stats/aggregate.h
src/ui/gui/aggregate-dialog.c

index 7625a6f1a76496803ee5b7e20bcb345252107009..bcc8a3be09a9467ebb2bc6cfbd7389f2d67e98ce 100644 (file)
@@ -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[] =
index 95e574a0975e00762f38163b4ae75c26cbc3b57c..1a50bbe4caea0a167b75e99a1b06bf8d790f14d3 100644 (file)
@@ -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
   {
index e1a688a3be8cd61760b243f2db901b96b442684e..40a06a9202bf61c79369aa5bf4fdd985e2e79905 100644 (file)
@@ -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);