1 /* PSPPIRE - a graphical user interface for PSPP.
2 Copyright (C) 2007 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17 /* Some common routines used in the implementation of dialog boxes */
20 #ifndef DIALOG_COMMON_H
21 #define DIALOG_COMMON_H
24 #include "psppire-dict.h"
26 /* Append the names of selected variables to STRING.
27 TREEVIEW is the treeview containing the variables.
28 COLUMN is column in treeview containing the variables.
29 DICT is the dictionary for those variables.
31 gint append_variable_names (GString *string, PsppireDict *dict,
32 GtkTreeView *treeview, gint column);
35 /* Returns the variable currently selected by the iterator
36 pointing to TREEMODEL */
37 struct variable * get_selected_variable (GtkTreeModel *treemodel,
43 /* A (*GtkTreeCellDataFunc) function.
44 This function expects TREEMODEL to hold G_TYPE_INT. The ints it holds
45 are the indices of the variables in the dictionary, which DATA points to.
46 It renders the name of the variable into CELL.
48 void cell_var_name (GtkTreeViewColumn *tree_column,
49 GtkCellRenderer *cell,
50 GtkTreeModel *tree_model,
55 /* Set a model for DEST, which is an GtkListStore of g_int's
56 whose values are the indices into DICT */
57 void set_dest_model (GtkTreeView *dest, PsppireDict *dict);
60 /* Returns FALSE if the variables represented by the union of the rows
61 currently selected by SOURCE widget, and contents of the DEST
62 widget, are of different types.
64 In other words, this function when passed as the argument to
65 psppire_selector_set_allow, ensures that the selector selects only
66 string variables, or only numeric variables, not a mixture.
68 gboolean homogeneous_types (GtkWidget *source, GtkWidget *dest);
70 /* Returns TRUE if all of the variable(s) represented by the rows
71 currently selected by SOURCE widget, are numeric. DEST is ignored.
73 In other words, this function when passed as the argument to
74 psppire_selector_set_allow, ensures that the selector selects only
77 gboolean numeric_only (GtkWidget *source, GtkWidget *dest);