/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2011, 2012, 2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
typedef enum
{
- GTK_TREE_SELECT_MODE_TOGGLE = 1 << 0,
- GTK_TREE_SELECT_MODE_EXTEND = 1 << 1
+ PSPP_SHEET_SELECT_MODE_TOGGLE = 1 << 0,
+ PSPP_SHEET_SELECT_MODE_EXTEND = 1 << 1
}
-GtkTreeSelectMode;
+PsppSheetSelectMode;
enum
{
void _pspp_sheet_selection_internal_select_node (PsppSheetSelection *selection,
int node,
GtkTreePath *path,
- GtkTreeSelectMode mode,
+ PsppSheetSelectMode mode,
gboolean override_browse_mode);
void _pspp_sheet_selection_emit_changed (PsppSheetSelection *selection);
void _pspp_sheet_view_find_node (PsppSheetView *tree_view,
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2011, 2012, 2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
GtkTreePath *path)
{
int node;
- GtkTreeSelectMode mode = 0;
+ PsppSheetSelectMode mode = 0;
g_return_if_fail (PSPP_IS_SHEET_SELECTION (selection));
g_return_if_fail (selection->tree_view != NULL);
if (selection->type == PSPP_SHEET_SELECTION_MULTIPLE ||
selection->type == PSPP_SHEET_SELECTION_RECTANGLE)
- mode = GTK_TREE_SELECT_MODE_TOGGLE;
+ mode = PSPP_SHEET_SELECT_MODE_TOGGLE;
_pspp_sheet_selection_internal_select_node (selection,
node,
_pspp_sheet_selection_internal_select_node (selection,
node,
path,
- GTK_TREE_SELECT_MODE_TOGGLE,
+ PSPP_SHEET_SELECT_MODE_TOGGLE,
TRUE);
}
_pspp_sheet_selection_internal_select_node (PsppSheetSelection *selection,
int node,
GtkTreePath *path,
- GtkTreeSelectMode mode,
+ PsppSheetSelectMode mode,
gboolean override_browse_mode)
{
gint dirty = FALSE;
else if (selection->type == PSPP_SHEET_SELECTION_SINGLE &&
anchor_path && gtk_tree_path_compare (path, anchor_path) == 0)
{
- if ((mode & GTK_TREE_SELECT_MODE_TOGGLE) == GTK_TREE_SELECT_MODE_TOGGLE)
+ if ((mode & PSPP_SHEET_SELECT_MODE_TOGGLE) == PSPP_SHEET_SELECT_MODE_TOGGLE)
{
dirty = pspp_sheet_selection_real_unselect_all (selection);
}
else if (selection->type == PSPP_SHEET_SELECTION_MULTIPLE ||
selection->type == PSPP_SHEET_SELECTION_RECTANGLE)
{
- if ((mode & GTK_TREE_SELECT_MODE_EXTEND) == GTK_TREE_SELECT_MODE_EXTEND
+ if ((mode & PSPP_SHEET_SELECT_MODE_EXTEND) == PSPP_SHEET_SELECT_MODE_EXTEND
&& (anchor_path == NULL))
{
if (selection->tree_view->priv->anchor)
gtk_tree_row_reference_new_proxy (G_OBJECT (selection->tree_view), selection->tree_view->priv->model, path);
dirty = pspp_sheet_selection_real_select_node (selection, node, TRUE);
}
- else if ((mode & (GTK_TREE_SELECT_MODE_EXTEND | GTK_TREE_SELECT_MODE_TOGGLE)) == (GTK_TREE_SELECT_MODE_EXTEND | GTK_TREE_SELECT_MODE_TOGGLE))
+ else if ((mode & (PSPP_SHEET_SELECT_MODE_EXTEND | PSPP_SHEET_SELECT_MODE_TOGGLE)) == (PSPP_SHEET_SELECT_MODE_EXTEND | PSPP_SHEET_SELECT_MODE_TOGGLE))
{
pspp_sheet_selection_select_range (selection,
anchor_path,
path);
}
- else if ((mode & GTK_TREE_SELECT_MODE_TOGGLE) == GTK_TREE_SELECT_MODE_TOGGLE)
+ else if ((mode & PSPP_SHEET_SELECT_MODE_TOGGLE) == PSPP_SHEET_SELECT_MODE_TOGGLE)
{
bool selected = pspp_sheet_view_node_is_selected (selection->tree_view, node);
if (selection->tree_view->priv->anchor)
else
dirty |= pspp_sheet_selection_real_select_node (selection, node, TRUE);
}
- else if ((mode & GTK_TREE_SELECT_MODE_EXTEND) == GTK_TREE_SELECT_MODE_EXTEND)
+ else if ((mode & PSPP_SHEET_SELECT_MODE_EXTEND) == PSPP_SHEET_SELECT_MODE_EXTEND)
{
dirty = pspp_sheet_selection_real_unselect_all (selection);
dirty |= pspp_sheet_selection_real_modify_range (selection,
int new_node = -1;
int cursor_node = -1;
GtkTreePath *cursor_path = NULL;
- GtkTreeSelectMode mode = 0;
+ PsppSheetSelectMode mode = 0;
if (!gtk_widget_has_focus (GTK_WIDGET (tree_view)))
return FALSE;
}
if (tree_view->priv->ctrl_pressed)
- mode |= GTK_TREE_SELECT_MODE_TOGGLE;
+ mode |= PSPP_SHEET_SELECT_MODE_TOGGLE;
if (tree_view->priv->shift_pressed)
- mode |= GTK_TREE_SELECT_MODE_EXTEND;
+ mode |= PSPP_SHEET_SELECT_MODE_EXTEND;
_pspp_sheet_selection_internal_select_node (tree_view->priv->selection,
cursor_node,
_pspp_sheet_selection_internal_select_node (tree_view->priv->selection,
cursor_node,
cursor_path,
- GTK_TREE_SELECT_MODE_TOGGLE,
+ PSPP_SHEET_SELECT_MODE_TOGGLE,
FALSE);
/* We bail out if the original (tree, node) don't exist anymore after
if (clear_and_select && !tree_view->priv->ctrl_pressed)
{
- GtkTreeSelectMode mode = 0;
+ PsppSheetSelectMode mode = 0;
if (tree_view->priv->ctrl_pressed)
- mode |= GTK_TREE_SELECT_MODE_TOGGLE;
+ mode |= PSPP_SHEET_SELECT_MODE_TOGGLE;
if (tree_view->priv->shift_pressed)
- mode |= GTK_TREE_SELECT_MODE_EXTEND;
+ mode |= PSPP_SHEET_SELECT_MODE_EXTEND;
_pspp_sheet_selection_internal_select_node (tree_view->priv->selection,
node, path, mode,