gtk_widget_queue_draw (GTK_WIDGET (de));
}
+static void
+insert_new_variable (PsppireDataEditor *de)
+{
+ gint item = GPOINTER_TO_INT (g_object_get_data
+ (G_OBJECT (de->data_sheet_cases_column_popup),
+ "item"));
+
+ const struct variable *v = psppire_dict_insert_variable (de->dict, item, NULL);
+ psppire_data_store_insert_value (de->data_store, var_get_width(v),
+ var_get_case_index (v));
+
+ gtk_widget_queue_draw (GTK_WIDGET (de));
+}
+
+
static GtkWidget *
create_row_header_popup_menu (PsppireDataEditor *de)
{
GtkWidget *item =
gtk_menu_item_new_with_mnemonic (_("_Insert Variable"));
+ g_signal_connect_swapped (item, "activate", G_CALLBACK (insert_new_variable), de);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
item = gtk_separator_menu_item_new ();
item =
gtk_menu_item_new_with_mnemonic (_("Cl_ear Variables"));
+ gtk_widget_set_sensitive (item, FALSE);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
item = gtk_separator_menu_item_new ();
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-
item =
gtk_menu_item_new_with_mnemonic (_("Sort _Ascending"));
+ gtk_widget_set_sensitive (item, FALSE);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
item =
gtk_menu_item_new_with_mnemonic (_("Sort _Descending"));
+ gtk_widget_set_sensitive (item, FALSE);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
gtk_widget_show_all (menu);
struct ccase *cc = datasheet_get_row (store->datasheet, row);
- const union value *val = case_data_idx (cc, column);
+ const union value *val = case_data_idx (cc, var_get_case_index (variable));
GVariant *vv = value_variant_new (val, var_get_width (variable));
-static gboolean
-psppire_data_store_insert_value (PsppireDataStore *ds,
- gint width, gint where);
-
casenumber
psppire_data_store_get_case_count (const PsppireDataStore *store)
{
given WIDTH into every one of them at the position immediately
preceding WHERE.
*/
-static gboolean
+gboolean
psppire_data_store_insert_value (PsppireDataStore *ds,
gint width, gint where)
{
gboolean psppire_data_store_insert_new_case (PsppireDataStore *ds, casenumber posn);
+gboolean psppire_data_store_insert_value (PsppireDataStore *ds,
+ gint width, gint where);
gboolean psppire_data_store_delete_cases (PsppireDataStore *ds, casenumber first, casenumber count);