GtkWidget *functions = get_widget_assert (xml, "compute-treeview2");
GtkWidget *keypad = get_widget_assert (xml, "psppire-keypad1");
GtkWidget *target = get_widget_assert (xml, "compute-entry1");
- GtkWidget *syntax_area = get_widget_assert (xml, "compute-textview1");
GtkWidget *var_selector = get_widget_assert (xml, "compute-selector1");
GtkWidget *func_selector = get_widget_assert (xml, "compute-selector2");
GtkWidget *type_and_label = get_widget_assert (xml, "compute-button1");
"selection-mode", GTK_SELECTION_SINGLE,
NULL);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (var_selector),
- insert_source_row_into_text_view,
- NULL,
- NULL);
-
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (var_selector),
+ insert_source_row_into_text_view, NULL);
function_list_populate (GTK_TREE_VIEW (functions));
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (func_selector),
- insert_function_into_syntax_area,
- NULL,
- NULL);
-
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (func_selector),
+ insert_function_into_syntax_area, NULL);
scd.xml = xml;
set_dest_model (GTK_TREE_VIEW (dest_rows), dict);
set_dest_model (GTK_TREE_VIEW (dest_cols), dict);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (row_selector),
- insert_source_row_into_tree_view,
- NULL,
- NULL);
-
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (col_selector),
- insert_source_row_into_tree_view,
- NULL,
- NULL);
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (row_selector),
+ insert_source_row_into_tree_view,
+ NULL);
+
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (col_selector),
+ insert_source_row_into_tree_view,
+ NULL);
cd.row_vars = GTK_TREE_VIEW (dest_rows);
cd.col_vars = GTK_TREE_VIEW (dest_cols);
set_dest_model (GTK_TREE_VIEW (dest), dict);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector),
- insert_source_row_into_tree_view,
- NULL,
- NULL);
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector),
+ insert_source_row_into_tree_view, NULL);
put_checkbox_items_in_treeview (GTK_TREE_VIEW (stats_treeview),
B_DS_DEFAULT,
set_dest_model (GTK_TREE_VIEW (ex_d.dep_list), ex_d.dict);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (dep_selector),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (dep_selector),
insert_source_row_into_tree_view,
- NULL, NULL);
+ NULL);
psppire_selector_set_allow (PSPPIRE_SELECTOR (dep_selector),
numeric_only);
set_dest_model (GTK_TREE_VIEW (ex_d.fct_list), ex_d.dict);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (fct_selector),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (fct_selector),
insert_source_row_into_tree_view,
- NULL, NULL);
+ NULL);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (id_selector),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (id_selector),
insert_source_row_into_entry,
- NULL, NULL);
+ NULL);
g_signal_connect (dialog, "refresh", G_CALLBACK (refresh), &ex_d);
"selection-mode", GTK_SELECTION_SINGLE,
NULL);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector),
- insert_source_row_into_entry,
- is_currently_in_entry,
- NULL
- );
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector),
+ insert_source_row_into_entry,
+ NULL
+ );
+
+ psppire_selector_set_filter_func (PSPPIRE_SELECTOR (selector),
+ is_currently_in_entry);
g_signal_connect (dialog, "refresh", G_CALLBACK (refresh), &fd);
set_dest_model (GTK_TREE_VIEW (dest), fd.dict);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector),
insert_source_row_into_tree_view,
- NULL,
NULL);
set_dest_model (GTK_TREE_VIEW (ow.vars_treeview), ow.dict);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector1),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector1),
insert_source_row_into_tree_view,
- NULL,
NULL);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector2),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector2),
insert_source_row_into_entry,
- is_currently_in_entry,
NULL);
+ psppire_selector_set_filter_func (PSPPIRE_SELECTOR (selector2),
+ is_currently_in_entry);
+
g_signal_connect_swapped (ow.dialog, "refresh", G_CALLBACK (refresh), &ow);
static void
psppire_selector_init (PsppireSelector *selector)
{
+ selector->select_user_data = NULL;
+ selector->select_items = NULL;
+ selector->allow_selection = NULL;
+ selector->filter = NULL;
+
selector->arrow = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE);
selector->filtered_source = NULL;
if ( NULL == selector->dest )
return;
+ if ( selector->filter == NULL)
+ {
+ if (GTK_IS_TREE_VIEW (selector->dest))
+ selector->filter = is_item_in_dest;
+ }
+
if ( NULL == selector->source )
return;
}
-/* Set SELECT_FUNC and FILTER_FUNC for this selector */
+/* Set FILTER_FUNC for this selector */
void
-psppire_selector_set_subjects (PsppireSelector *selector,
- SelectItemsFunc *select_func,
- FilterItemsFunc *filter_func,
- gpointer user_data)
+psppire_selector_set_filter_func (PsppireSelector *selector,
+ FilterItemsFunc *filter_func)
{
selector->filter = filter_func ;
- selector->select_user_data = user_data;
- if ( filter_func == NULL)
+ if ( selector->filter == NULL)
{
if (GTK_IS_TREE_VIEW (selector->dest))
selector->filter = is_item_in_dest;
}
+}
+
+/* Set SELECT_FUNC for this selector */
+void
+psppire_selector_set_select_func (PsppireSelector *selector,
+ SelectItemsFunc *select_func,
+ gpointer user_data)
+{
+ selector->select_user_data = user_data;
selector->select_items = select_func;
}
GType psppire_selector_get_type (void);
GtkWidget* psppire_selector_new (void);
-void psppire_selector_set_subjects (PsppireSelector *,
- SelectItemsFunc *,
- FilterItemsFunc *,
- gpointer );
-void psppire_selector_set_allow (PsppireSelector *, AllowSelectionFunc *);
+
+/* Set FILTER_FUNC for this selector */
+void psppire_selector_set_filter_func (PsppireSelector *selector,
+ FilterItemsFunc *filter_func);
+
+/* Set SELECT_FUNC for this selector */
+void psppire_selector_set_select_func (PsppireSelector *selector,
+ SelectItemsFunc *select_func,
+ gpointer user_data);
+
+
+void psppire_selector_set_allow (PsppireSelector *, AllowSelectionFunc *);
GType psppire_selector_orientation_get_type (void) G_GNUC_CONST;
set_dest_model (GTK_TREE_VIEW (rd.rank_vars), rd.dict);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector1),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector1),
insert_source_row_into_tree_view,
- NULL,
NULL);
set_dest_model (GTK_TREE_VIEW (rd.group_vars), rd.dict);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector2),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector2),
insert_source_row_into_tree_view,
- NULL,
NULL);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector),
insert_source_row_into_tree_view,
- NULL,
NULL);
psppire_selector_set_allow (PSPPIRE_SELECTOR (selector), homogeneous_types);
set_dest_model (GTK_TREE_VIEW (dest_dep), rd.dict);
set_dest_model (GTK_TREE_VIEW (dest_indep), rd.dict);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (dep_selector),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (dep_selector),
insert_source_row_into_tree_view,
- NULL,
NULL);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (indep_selector),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (indep_selector),
insert_source_row_into_tree_view,
- NULL,
NULL);
rd.dep_vars = GTK_TREE_VIEW (dest_dep);
set_dest_model (GTK_TREE_VIEW (rd.variables), rd.dict);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector),
insert_source_row_into_tree_view,
- NULL,
NULL);
{
"selection-mode",
GTK_SELECTION_SINGLE, NULL);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector),
insert_source_row_into_entry,
- is_currently_in_entry,
NULL);
+
+ psppire_selector_set_filter_func (PSPPIRE_SELECTOR (selector),
+ is_currently_in_entry);
+
+
}
set_dest_model (GTK_TREE_VIEW (dest), scd.dict);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector),
insert_source_row_into_tree_view,
- NULL,
NULL);
g_signal_connect (dialog, "refresh", G_CALLBACK (refresh), dest);
set_dest_model (GTK_TREE_VIEW (dest), sfd.dict);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector),
insert_source_row_into_tree_view,
- NULL,
NULL);
g_signal_connect (dialog, "refresh", G_CALLBACK (refresh), &sfd);
set_dest_model (GTK_TREE_VIEW (test_variables_treeview), tt_d.dict);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector1),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector1),
insert_source_row_into_tree_view,
- NULL,
NULL);
psppire_selector_set_allow (PSPPIRE_SELECTOR (selector1),
numeric_only);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector2),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector2),
insert_source_row_into_entry,
- is_currently_in_entry,
NULL);
+ psppire_selector_set_filter_func (PSPPIRE_SELECTOR (selector2),
+ is_currently_in_entry);
+
g_signal_connect_swapped (tt_d.define_groups_button, "clicked",
G_CALLBACK (run_define_groups), &tt_d);
set_dest_model (GTK_TREE_VIEW (tt_d.vars_treeview), tt_d.dict);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector),
insert_source_row_into_tree_view,
- NULL,
NULL);
}
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector),
- select_as_pair_member,
- NULL,
- &tt_d);
-
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector),
+ select_as_pair_member,
+ &tt_d);
g_signal_connect_swapped (dialog, "refresh",
G_CALLBACK (refresh), &tt_d);
set_dest_model (GTK_TREE_VIEW (dest), dict);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector1),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector1),
insert_source_row_into_tree_view,
- NULL,
NULL);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector2),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector2),
insert_source_row_into_entry,
- is_currently_in_entry,
NULL);
+ psppire_selector_set_filter_func (PSPPIRE_SELECTOR (selector2),
+ is_currently_in_entry);
+
g_signal_connect (dialog, "refresh", G_CALLBACK (refresh), xml);
"predicate", var_is_numeric,
NULL);
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector),
+ psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector),
insert_source_row_into_entry,
- is_currently_in_entry,
- NULL
- );
+ NULL);
+
+ psppire_selector_set_filter_func (PSPPIRE_SELECTOR (selector),
+ is_currently_in_entry);
+
wcd.entry = GTK_ENTRY (entry);
wcd.status = GTK_LABEL (status);