From: John Darrington Date: Wed, 3 Jan 2007 02:03:18 +0000 (+0000) Subject: Added callback for when the weights on a dictionary change. X-Git-Tag: v0.6.0~594 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cda91450a687e3f520ec4614dcc2d09f6f7c82bb;p=pspp-builds.git Added callback for when the weights on a dictionary change. Reflect the current weight status in the status bar. --- diff --git a/src/data/ChangeLog b/src/data/ChangeLog index 7c254f14..a59b54f7 100644 --- a/src/data/ChangeLog +++ b/src/data/ChangeLog @@ -1,3 +1,8 @@ +Wed Jan 3 11:02:11 WST 2007 John Darrington + + * dictionary.c dictionary.h : Added callback for when the weight variable + of a dictionary changes. + Mon Jan 1 10:36:26 WST 2007 John Darrington * dictionary.c dictionary.h : Added replace_source and replace_dict diff --git a/src/data/dictionary.c b/src/data/dictionary.c index d29939ac..0a649e62 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -729,13 +729,18 @@ dict_get_case_weight (const struct dictionary *d, const struct ccase *c, /* Sets the weighting variable of D to V, or turning off weighting if V is a null pointer. */ void -dict_set_weight (struct dictionary *d, struct variable *v) +dict_set_weight (struct dictionary *d, struct variable *v) { assert (d != NULL); assert (v == NULL || dict_contains_var (d, v)); assert (v == NULL || var_is_numeric (v)); d->weight = v; + + if ( d->callbacks && d->callbacks->weight_changed ) + d->callbacks->weight_changed (d, + v ? var_get_dict_index (v) : -1, + d->cb_data); } /* Returns the filter variable in dictionary D (see cmd_filter()) diff --git a/src/data/dictionary.h b/src/data/dictionary.h index a1b17bb7..3b1ea56e 100644 --- a/src/data/dictionary.h +++ b/src/data/dictionary.h @@ -32,6 +32,7 @@ struct dict_callbacks void (*var_added) (struct dictionary *, int, void *); void (*var_deleted) (struct dictionary *, int, void *); void (*var_changed) (struct dictionary *, int, void *); + void (*weight_changed) (struct dictionary *, int, void *); }; diff --git a/src/ui/gui/data-editor.c b/src/ui/gui/data-editor.c index abf84fad..7e320bbd 100644 --- a/src/ui/gui/data-editor.c +++ b/src/ui/gui/data-editor.c @@ -101,6 +101,37 @@ disable_edit_clear (GtkWidget *w, gint x, gint y, gpointer data) } +/* Callback for when the dictionary changes its weights */ +static void +on_weight_change (GObject *o, gint weight_index, gpointer data) +{ + struct data_editor *de = data; + GtkWidget *weight_status_area = + get_widget_assert (de->xml, "weight-status-area"); + + if ( weight_index == -1 ) + { + gtk_label_set_text (GTK_LABEL (weight_status_area), _("Weights off")); + } + else + { + GtkSheet *var_sheet = + GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); + + PsppireVarStore *vs = PSPPIRE_VAR_STORE + (gtk_sheet_get_model (var_sheet) ); + + struct variable *var = psppire_dict_get_variable (vs->dict, + weight_index); + + gchar *text = g_strdup_printf (_("Weight by %s"), var_get_name (var)); + + gtk_label_set_text (GTK_LABEL (weight_status_area), text); + + g_free (text); + } +} + /* Create a new data editor. @@ -110,6 +141,8 @@ new_data_editor (void) { struct data_editor *de ; struct editor_window *e; + GtkSheet *var_sheet ; + PsppireVarStore *vs; de = g_malloc (sizeof (*de)); @@ -117,6 +150,15 @@ new_data_editor (void) de->xml = glade_xml_new (PKGDATADIR "/data-editor.glade", NULL, NULL); + + var_sheet = GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); + + vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + + g_signal_connect (vs->dict, "weight-changed", + G_CALLBACK (on_weight_change), + de); + connect_help (de->xml); e->window = GTK_WINDOW (get_widget_assert (de->xml, "data_editor")); @@ -242,6 +284,8 @@ new_data_editor (void) "activate", G_CALLBACK (minimise_all_windows), NULL); + + select_sheet (de, PAGE_DATA_SHEET); return de; @@ -422,8 +466,6 @@ status_bar_activate (GtkCheckMenuItem *menuitem, gpointer data) } - - static void grid_lines_activate (GtkCheckMenuItem *menuitem, gpointer data) { diff --git a/src/ui/gui/data-editor.glade b/src/ui/gui/data-editor.glade index b708a893..399e9539 100644 --- a/src/ui/gui/data-editor.glade +++ b/src/ui/gui/data-editor.glade @@ -1,3280 +1,2184 @@ - - - + + + - - - Psppire Data Editor - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 975 - 480 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 0 - - - - True - GTK_PACK_DIRECTION_LTR - GTK_PACK_DIRECTION_LTR - - - - True - _File - True - - - - - - - True - gtk-new - True - - - - - - - True - _Syntax - True - - - - - - True - _Data - True - - - - - - - - - - True - gtk-open - True - - - - - - - True - _Syntax - True - - - - - - True - _Data - True - - - - - - - - - - True - False - gtk-save - True - - - - - - - True - False - gtk-save-as - True - - - - - - - True - - - - - - True - gtk-quit - True - - - - - - - - - - - True - _Edit - True - - - - - - - True - False - gtk-cut - True - - - - - - True - False - gtk-copy - True - - - - - - True - False - gtk-paste - True - - - - - - True - False - Paste _Variables - True - - - - - - True - False - Cl_ear - True - - - - - - - True - - - - - - True - False - _Find - True - - - - True - gtk-find - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - - - - - True - _View - True - - - - - - - True - Status Bar - True - True - - - - - - Toolbars - True - - - - - - True - - - - - - True - Fonts - True - - - - - - True - Grid Lines - True - True - - - - - - True - Value Labels - True - False - - - - - - True - - - - - - True - Data - True - - - - - - True - Variables - True - - - - - - - - - - True - _Data - True - - - - - - - True - False - Insert Variable - True - - - - - - - True - False - Insert Cases - True - - - - - - - True - False - Go To Case - True - - - - - True - gtk-jump-to - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - False - - - - - - True - False - Sort Cases - True - - - - - - - True - False - Transpose - True - - - - - - True - False - Restructure - True - - - - - - True - False - Merge Files - True - - - - - - True - False - Aggregate - True - - - - - - True - False - - - - - - True - False - Split File - True - - - - - - True - False - Select Cases - True - - - - - - True - False - Weight Cases - True - - - - - - - - - - True - _Windows - True - - - - - - - - True - _Minimise All Windows - True - - - - - - - - - - - True - _Help - True - - - - - - - True - _Reference Manual - True - - - - - - True - _About - True - - - - - - - - - - 0 - False - False - - - - - - True - GTK_SHADOW_OUT - GTK_POS_LEFT - GTK_POS_TOP - - - - True - GTK_ORIENTATION_HORIZONTAL - GTK_TOOLBAR_ICONS - True - True - - - - True - False - Open - gtk-open - True - True - False - - - False - True - - - - - - True - False - Save - gtk-save - True - True - False - - - - False - True - - - - - - True - False - Print - gtk-print - True - True - False - - - False - True - - - - - - True - True - True - True - - - False - False - - - - - - True - False - Undo - gtk-undo - True - True - False - - - False - True - - - - - - True - False - Redo - gtk-redo - True - True - False - - - False - True - - - - - - True - True - True - True - - - False - False - - - - - - True - False - Go To Case - gtk-jump-to - True - True - False - - - - False - True - - - - - - True - False - Variables - pspp-goto-variable - - True - True - True - False - - - False - True - - - - - - True - True - True - True - - - False - False - - - - - - True - False - Find - gtk-find - True - True - False - - - False - True - - - - - - True - True - True - True - - - False - False - - - - - - True - False - Insert Case - pspp-insert-case - - True - True - True - False - - - - False - True - - - - - - True - False - Insert Variable - pspp-insert-variable - - True - True - True - False - - - False - True - - - - - - True - True - True - True - - - False - False - - - - - - True - False - Split File - pspp-split-file - - True - True - True - False - - - False - True - - - - - - True - False - Weight Cases - pspp-weight-cases - - True - True - True - False - - - False - True - - - - - - True - False - Select Cases - pspp-select-cases - - True - True - True - False - - - False - True - - - - - - True - True - True - True - - - False - False - - - - - - True - Value Labels - pspp-value-labels - - True - True - True - False - False - - - - False - True - - - - - - True - False - Use Sets - - True - True - True - False - - - False - True - - - - - - - 0 - False - False - - - - - - True - True - True - True - GTK_POS_BOTTOM - True - True - - - - True - False - 0 - - - - True - 1 - 2 - False - 0 - 0 - - - - True - True - True - True - 0 - - True - * - False - - - 1 - 2 - 0 - 1 - - - - - - - True - False - False - True - 0 - - True - * - False - 25 - - - 0 - 1 - 0 - 1 - fill - - - - - - 0 - False - False - - - - - - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT - - - - True - psppire_data_sheet_create - 0 - 0 - Sun, 30 Oct 2005 08:53:47 GMT - - - - - 0 - True - True - - - - - False - True - - - - - - True - Data View - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT - - - - True - psppire_variable_sheet_create - 0 - 0 - Sun, 30 Oct 2005 08:54:45 GMT - - - - - False - True - - - - - - True - Variable View - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - 0 - True - True - - - - - - - - - - 5 - True - False - 5 - - - - True - 0 - 0.5 - GTK_SHADOW_IN - - - - True - Information Area - True - False - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - True - 0 - - - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_IN - - - - True - Processor Area - True - False - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - 35 - True - 0 - - - - - - - 0 - False - False - - - - - - True - 0 - 0.5 - GTK_SHADOW_IN - - - - True - OMS Area - True - False - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - 3 - True - 0 - - - - - - - 0 - False - False - - - - - - True - 0 - 0.5 - GTK_SHADOW_IN - - - - True - Case Counter Area - True - False - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - 10 - True - 0 - - - - - - - 0 - False - False - - - - - - True - 0 - 0.5 - GTK_SHADOW_IN - - - - True - Filter Use Status Area - True - False - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - 10 - True - 0 - - - - - - - 0 - False - False - - - - - - True - 0 - 0.5 - GTK_SHADOW_IN - - - - True - Weight Status Area - True - False - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - 10 - True - 0 - - - - - - - 0 - False - False - - - - - - True - 0 - 0.5 - GTK_SHADOW_IN - - - - True - Split File Status Area - True - False - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - 10 - True - 0 - - - - - - - 0 - False - False - - - - - 0 - False - False - - - - - - - - 6 - Variable Type - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - 485 - False - False - True - True - True - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - - - - 5 - True - False - 5 - - - - 13 - True - True - 0 - - - - True - True - Numeric - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - False - False - - - - - - True - True - Comma - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobutton1 - - - 0 - False - False - - - - - - True - True - Dot - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobutton1 - - - 0 - False - False - - - - - - True - True - Scientific notation - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobutton1 - - - 0 - False - False - - - - - - True - True - Date - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobutton1 - - - 0 - False - False - - - - - - True - True - Dollar - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobutton1 - - - 0 - False - False - - - - - - True - True - Custom currency - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobutton1 - - - 0 - False - False - - - - - - True - True - String - True - GTK_RELIEF_NORMAL - True - False - False - True - radiobutton1 - - - 0 - False - False - - - - - 0 - False - False - - - - - - True - False - 10 - - - - 20 - 194 - True - GTK_POLICY_NEVER - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - True - False - False - False - - - - - 0 - False - False - - - - - - False - 15 - - - - 1 - 120 - True - True - GTK_POLICY_NEVER - GTK_POLICY_NEVER - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - True - False - False - False - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - True - 0 - - - - True - positive - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - True - - - - - - True - negative - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - True - - - - - - - - - - True - Sample - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - GTK_PACK_END - - - - - 0 - True - True - - - - - - True - GTK_POLICY_NEVER - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - True - False - False - False - - - - - 0 - True - True - - - - - - 100 - 50 - True - 2 - 2 - False - 1 - 2 - - - - True - Decimal Places: - False - False - GTK_JUSTIFY_RIGHT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - 25 - True - True - True - 0 - - True - * - False - - - 1 - 2 - 0 - 1 - - - - - - - 25 - True - True - True - True - 0 - - True - * - False - - - 1 - 2 - 1 - 2 - - - - - - - True - False - 0 - - - - True - Width: - False - False - GTK_JUSTIFY_RIGHT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - GTK_PACK_END - - - - - 0 - 1 - 0 - 1 - fill - fill - - - - - 0 - True - True - - - - - 0 - True - False - - - - - - True - GTK_BUTTONBOX_START - 5 - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-help - True - GTK_RELIEF_NORMAL - True - - - - - 0 - True - True - - - - - - - - Value Labels - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - False - False - True - True - True - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - - - - 5 - True - False - 0 - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - 8 - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - 2 - 2 - False - 5 - 0 - - - - 5 - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - False - True - True - gtk-add - True - GTK_RELIEF_NORMAL - True - - - - - - True - False - True - True - gtk-apply - True - GTK_RELIEF_NORMAL - True - - - - - - True - False - True - True - gtk-remove - True - GTK_RELIEF_NORMAL - True - - - - - 0 - 1 - 1 - 2 - fill - - - - - - 5 - True - 2 - 2 - False - 4 - 5 - - - - True - Value: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Value Label: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - True - True - True - 0 - - True - * - False - - - 1 - 2 - 1 - 2 - - - - - - - True - False - 0 - - - - 85 - True - True - True - True - 0 - - True - * - False - - - 1 - False - False - - - - - 1 - 2 - 0 - 1 - fill - fill - - - - - 0 - 2 - 0 - 1 - fill - - - - - - True - True - GTK_POLICY_NEVER - GTK_POLICY_AUTOMATIC - GTK_SHADOW_ETCHED_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - False - False - False - False - - - - - 1 - 2 - 1 - 2 - fill - fill - - - - - - - - - - True - Value Labels - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 10 - True - True - - - - - - 5 - True - GTK_BUTTONBOX_START - 5 - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-help - True - GTK_RELIEF_NORMAL - True - - - - - 0 - False - False - GTK_PACK_END - - - - - - - - 10 - Missing Values - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - False - False - True - True - True - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - 2 - 2 - False - 0 - 0 - - - - 5 - True - GTK_BUTTONBOX_START - 5 - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-help - True - GTK_RELIEF_NORMAL - True - - - - - 1 - 2 - 0 - 1 - - - - - - True - False - 12 - - - - True - True - _No missing values - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - False - False - - - - - - True - False - 0 - - - - True - True - _Discrete missing values - True - GTK_RELIEF_NORMAL - False - False - False - True - no_missing - - - 0 - False - False - - - - - - True - False - 0 - - - - 5 - True - True - 5 - - - - 75 - True - True - True - True - 0 - - True - * - False - - - 0 - False - False - - - - - - 75 - True - True - True - True - 0 - - True - * - False - - - 0 - False - False - - - - - - 75 - True - True - True - True - 0 - - True - * - False - - - 0 - False - False - - - - - 20 - True - True - - - - - 0 - True - True - - - - - 0 - False - False - - - - - 0 - 1 - 0 - 1 - fill - - - - - - True - False - 0 - - - - True - True - _Range plus one optional discrete missing value - True - GTK_RELIEF_NORMAL - False - False - False - True - no_missing - - - 0 - False - False - - - - - - True - False - 5 - - - - True - False - 0 - - - - True - False - 0 - - - - True - _Low: - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - mv-low - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 20 - False - False - - - - - - 75 - True - True - True - True - 0 - - True - * - False - - - 0 - False - True - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - _High: - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - mv-high - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 75 - True - True - True - True - 0 - - True - * - False - - - 5 - True - True - - - - - 20 - True - False - - - - - - - - - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - Di_screte value: - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - mv-discrete - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 20 - False - False - - - - - - 75 - True - True - True - True - 0 - - True - * - False - - - 0 - False - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - 2 - 1 - 2 - fill - - - - - - - - Go To Case - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - False - False - True - True - True - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - False - 3 - - - - True - Case Number: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 50 - True - True - True - True - 0 - - True - * - False - - - 0 - True - True - - - - - 0 - True - True - - - - - - - - 10 - True - Sort Cases - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - True - False - True - True - True - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 9 - - - - 10 - True - True - GTK_POLICY_NEVER - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - True - True - True - False - False - - - - - 0 - True - True - - - - - - True - 0.5 - 0.25 - 0.460000008345 - 0.0799999982119 - 0 - 0 - 0 - 0 - - - - True - True - GTK_RELIEF_NORMAL - True - - - - True - GTK_ARROW_RIGHT - GTK_SHADOW_OUT - 0.5 - 0.5 - 0 - 0 - - - - - - - 0 - True - True - - - - - - True - False - 4 - - - - 75 - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - 12 - 66 - True - True - 5 - - - - True - True - Ascending - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Descending - True - GTK_RELIEF_NORMAL - True - False - False - True - sort-cases-button-ascending - - - 0 - False - False - - - - - - - - True - Sort Order - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - False - 0 - - - - True - Sort by: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - GTK_POLICY_NEVER - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - True - True - False - False - - - - - 0 - True - True - - - - - 0 - True - True - GTK_PACK_END - - - - - 0 - True - True - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - - - - - - True - False - True - True - gtk-paste - True - GTK_RELIEF_NORMAL - True - - - - - - True - True - True - gtk-refresh - True - GTK_RELIEF_NORMAL - True - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - True - True - True - gtk-help - True - GTK_RELIEF_NORMAL - True - - - - - 6 - True - False - - - - - - + + Psppire Data Editor + 975 + 480 + + + True + + + True + + + True + _File + True + + + + + True + gtk-new + True + True + + + + + True + _Syntax + True + + + + + True + _Data + True + + + + + + + + + True + gtk-open + True + True + + + + + True + _Syntax + True + + + + + True + _Data + True + + + + + + + + + True + False + gtk-save + True + True + + + + + + True + False + gtk-save-as + True + True + + + + + + True + + + + + True + gtk-quit + True + True + + + + + + + + + + True + _Edit + True + + + + + True + False + gtk-cut + True + True + + + + + True + False + gtk-copy + True + True + + + + + True + False + gtk-paste + True + True + + + + + True + False + Paste _Variables + True + + + + + True + False + Cl_ear + True + + + + + True + + + + + True + False + _Find + True + + + + + + + + + True + _View + True + + + + + True + Status Bar + True + True + + + + + Toolbars + True + + + + + True + + + + + True + Fonts + True + + + + + True + Grid Lines + True + True + + + + + True + Value Labels + True + + + + + True + + + + + True + Data + True + + + + + True + Variables + True + + + + + + + + + True + _Data + True + + + + + True + False + Insert Variable + True + + + + + + True + False + Insert Cases + True + + + + + + True + False + Go To Case + True + + + + + + True + False + + + + + True + False + Sort Cases + True + + + + + + True + False + Transpose + True + + + + + True + False + Restructure + True + + + + + True + False + Merge Files + True + + + + + True + False + Aggregate + True + + + + + True + False + + + + + True + False + Split File + True + + + + + True + False + Select Cases + True + + + + + True + False + Weight Cases + True + + + + + + + + + True + _Windows + True + + + + + + True + _Minimise All Windows + True + + + + + + + + + + True + _Help + True + + + + + True + _Reference Manual + True + + + + + True + _About + True + + + + + + + + + + False + False + + + + + True + GTK_SHADOW_OUT + + + True + + + True + False + Open + gtk-open + + + False + + + + + True + False + Save + gtk-save + + + + False + + + + + True + False + Print + gtk-print + + + False + + + + + True + + + False + False + + + + + True + False + Undo + gtk-undo + + + False + + + + + True + False + Redo + gtk-redo + + + False + + + + + True + + + False + False + + + + + True + False + Go To Case + gtk-jump-to + + + + False + + + + + True + False + Variables + True + pspp-goto-variable + + + False + + + + + True + + + False + False + + + + + True + False + Find + gtk-find + + + False + + + + + True + + + False + False + + + + + True + False + Insert Case + True + pspp-insert-case + + + + False + + + + + True + False + Insert Variable + True + pspp-insert-variable + + + False + + + + + True + + + False + False + + + + + True + False + Split File + True + pspp-split-file + + + False + + + + + True + False + Weight Cases + True + pspp-weight-cases + + + False + + + + + True + False + Select Cases + True + pspp-select-cases + + + False + + + + + True + + + False + False + + + + + True + Value Labels + True + pspp-value-labels + + + + False + + + + + True + False + Use Sets + True + + + False + + + + + + + False + False + 1 + + + + + True + True + GTK_POS_BOTTOM + True + True + + + True + + + True + 1 + 2 + + + True + False + False + 25 + + + GTK_FILL + + + + + + True + True + + + 1 + 2 + + + + + + False + False + + + + + True + + + True + psppire_data_sheet_create + + + + + 1 + + + + + False + + + + + True + Data View + + + tab + False + False + + + + + True + True + + + True + psppire_variable_sheet_create + + + + + 1 + False + + + + + True + Variable View + + + tab + 1 + False + False + + + + + 2 + + + + + + + + True + 5 + 5 + + + True + 0 + GTK_SHADOW_IN + + + True + Information Area + + + True + True + + + + + + + + + True + 0 + GTK_SHADOW_IN + + + True + Processor Area + + + True + 35 + True + + + + + + + False + False + 1 + + + + + True + 0 + GTK_SHADOW_IN + + + True + OMS Area + + + True + 3 + True + + + + + + + False + False + 2 + + + + + True + 0 + GTK_SHADOW_IN + + + True + Case Counter Area + + + True + 10 + True + + + + + + + False + False + 3 + + + + + True + 0 + GTK_SHADOW_IN + + + True + Filter Use Status Area + + + True + 10 + True + + + + + + + False + False + 4 + + + + + True + 0 + GTK_SHADOW_IN + + + True + Weight Status Area + + + True + PANGO_ELLIPSIZE_START + 10 + True + + + + + + + False + False + 5 + + + + + True + 0 + GTK_SHADOW_IN + + + True + Split File Status Area + + + True + 10 + True + + + + + + + False + False + 6 + + + + + False + False + 4 + + + + + + + 6 + Variable Type + False + True + 485 + GDK_WINDOW_TYPE_HINT_DIALOG + True + True + + + True + 5 + 5 + + + True + 13 + True + + + True + True + Numeric + True + True + True + + + False + False + + + + + True + True + Comma + True + True + radiobutton1 + + + False + False + 1 + + + + + True + True + Dot + True + True + radiobutton1 + + + False + False + 2 + + + + + True + True + Scientific notation + True + True + radiobutton1 + + + False + False + 3 + + + + + True + True + Date + True + True + radiobutton1 + + + False + False + 4 + + + + + True + True + Dollar + True + True + radiobutton1 + + + False + False + 5 + + + + + True + True + Custom currency + True + True + radiobutton1 + + + False + False + 6 + + + + + True + True + String + True + True + radiobutton1 + + + False + False + 7 + + + + + False + False + + + + + True + 10 + + + 20 + 194 + True + GTK_POLICY_NEVER + GTK_SHADOW_IN + + + True + True + False + + + + + False + False + + + + + 15 + + + 1 + 120 + True + True + GTK_POLICY_NEVER + GTK_POLICY_NEVER + GTK_SHADOW_IN + + + True + True + False + + + + + + + True + 0 + + + True + 12 + + + True + True + + + True + positive + + + + + True + negative + + + 1 + + + + + + + + + True + Sample + True + + + label_item + + + + + GTK_PACK_END + 1 + + + + + 1 + + + + + True + GTK_POLICY_NEVER + GTK_SHADOW_IN + + + True + True + False + + + + + 2 + + + + + 100 + 50 + True + 2 + 2 + 2 + 1 + + + True + + + True + Width: + GTK_JUSTIFY_RIGHT + + + False + False + GTK_PACK_END + + + + + GTK_FILL + GTK_FILL + + + + + 25 + True + True + + + 1 + 2 + 1 + 2 + + + + + + 25 + True + + + 1 + 2 + + + + + + True + 0 + Decimal Places: + GTK_JUSTIFY_RIGHT + + + 1 + 2 + GTK_FILL + + + + + + 3 + + + + + False + 1 + + + + + True + 5 + GTK_BUTTONBOX_START + + + True + True + True + gtk-ok + True + + + + + True + True + True + gtk-cancel + True + + + + 1 + + + + + True + True + True + gtk-help + True + + + 2 + + + + + 2 + + + + + + + Value Labels + False + True + GDK_WINDOW_TYPE_HINT_DIALOG + True + True + + + True + 5 + + + True + 0 + + + True + 8 + 12 + + + True + 2 + 2 + 5 + + + True + True + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_SHADOW_ETCHED_IN + + + True + True + False + False + + + + + 1 + 2 + 1 + 2 + GTK_FILL + GTK_FILL + + + + + True + 5 + 2 + 2 + 5 + 4 + + + True + + + 85 + True + True + + + False + False + 1 + + + + + 1 + 2 + GTK_FILL + GTK_FILL + + + + + True + True + + + 1 + 2 + 1 + 2 + + + + + + True + 0 + Value Label: + + + 1 + 2 + GTK_FILL + + + + + + True + 0 + Value: + + + GTK_FILL + + + + + + 2 + GTK_FILL + + + + + True + 5 + + + True + False + True + True + gtk-add + True + + + + + True + False + True + True + gtk-apply + True + + + 1 + + + + + True + False + True + True + gtk-remove + True + + + 2 + + + + + 1 + 2 + GTK_FILL + + + + + + + + + True + Value Labels + True + + + label_item + + + + + 10 + + + + + True + 5 + 5 + GTK_BUTTONBOX_START + + + True + True + True + gtk-ok + True + + + + + + True + True + True + gtk-cancel + True + + + + 1 + + + + + True + True + True + gtk-help + True + + + 2 + + + + + False + False + GTK_PACK_END + 1 + + + + + + + 10 + Missing Values + False + True + GDK_WINDOW_TYPE_HINT_DIALOG + True + True + + + True + 2 + 2 + + + True + + + True + True + _Range plus one optional discrete missing value + True + False + True + no_missing + + + False + False + + + + + True + 5 + + + True + + + True + + + True + _Low: + True + mv-low + + + False + False + 20 + + + + + 75 + True + True + + + False + 1 + + + + + + + True + + + True + _High: + True + mv-high + + + False + False + + + + + 75 + True + True + + + 5 + 1 + + + + + False + 20 + 1 + + + + + + + + + + + + + True + + + True + Di_screte value: + True + mv-discrete + + + False + False + 20 + + + + + 75 + True + True + + + False + 1 + + + + + 1 + + + + + 1 + + + + + 2 + 1 + 2 + GTK_FILL + + + + + True + 12 + + + True + True + _No missing values + True + True + True + + + False + False + + + + + True + + + True + True + _Discrete missing values + True + False + True + no_missing + + + False + False + + + + + True + + + True + 5 + 5 + True + + + 75 + True + True + + + False + False + + + + + 75 + True + True + + + False + False + 1 + + + + + 75 + True + True + + + False + False + 2 + + + + + 20 + + + + + 1 + + + + + False + False + 1 + + + + + GTK_FILL + + + + + True + 5 + 5 + GTK_BUTTONBOX_START + + + True + True + True + gtk-ok + True + + + + + + True + True + True + gtk-cancel + True + + + + 1 + + + + + True + True + True + gtk-help + True + + + 2 + + + + + 1 + 2 + + + + + + + Go To Case + False + True + GDK_WINDOW_TYPE_HINT_DIALOG + True + True + False + + + True + + + True + 3 + + + True + Case Number: + + + False + False + + + + + 50 + True + True + + + 1 + + + + + 1 + + + + + True + GTK_BUTTONBOX_END + + + True + True + True + gtk-ok + True + -5 + + + + + False + GTK_PACK_END + + + + + + + True + 10 + Sort Cases + True + GDK_WINDOW_TYPE_HINT_DIALOG + True + True + + + True + 9 + + + True + True + 10 + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + + + True + True + False + True + True + + + + + + + True + 0.25 + 0.46000000834465027 + 0.079999998211860657 + + + True + True + + + True + + + + + + + 1 + + + + + True + 4 + + + True + + + True + 0 + Sort by: + + + False + False + + + + + True + True + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + + + True + True + False + True + + + + + 1 + + + + + GTK_PACK_END + 1 + + + + + 75 + True + 0 + + + 66 + True + 12 + 5 + True + + + True + True + Ascending + True + True + + + False + False + + + + + True + True + Descending + True + True + sort-cases-button-ascending + + + False + False + 1 + + + + + + + True + Sort Order + True + + + label_item + + + + + False + GTK_PACK_END + + + + + 2 + + + + + True + + + True + True + True + gtk-ok + True + + + + + True + False + True + True + gtk-paste + True + + + 1 + + + + + True + True + True + gtk-refresh + True + + + 2 + + + + + True + True + True + gtk-cancel + True + + + 3 + + + + + True + True + True + gtk-help + True + + + 4 + + + + + False + 6 + 3 + + + + + diff --git a/src/ui/gui/psppire-dict.c b/src/ui/gui/psppire-dict.c index bba51501..6391222c 100644 --- a/src/ui/gui/psppire-dict.c +++ b/src/ui/gui/psppire-dict.c @@ -49,6 +49,7 @@ enum {VARIABLE_CHANGED, VARIABLE_RESIZED, VARIABLE_INSERTED, VARIABLES_DELETED, + WEIGHT_CHANGED, n_SIGNALS}; static guint signal[n_SIGNALS]; @@ -158,6 +159,17 @@ psppire_dict_class_init (PsppireDictClass *class) G_TYPE_INT, G_TYPE_INT); + + signal [WEIGHT_CHANGED] = + g_signal_new ("weight-changed", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_FIRST, + 0, + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, + 1, + G_TYPE_INT); } static void @@ -190,11 +202,19 @@ mutcb (struct dictionary *d, int idx, void *pd) g_signal_emit (pd, signal[VARIABLE_CHANGED], 0, idx); } +static void +weight_changed_callback (struct dictionary *d, int idx, void *pd) +{ + g_signal_emit (pd, signal [WEIGHT_CHANGED], 0, idx); +} + + static const struct dict_callbacks gui_callbacks = { addcb, delcb, - mutcb + mutcb, + weight_changed_callback }; static void