summaryrefslogtreecommitdiff
path: root/gtk/gtktreeselection.c
diff options
context:
space:
mode:
authorKristian Rietveld <kris@gtk.org>2003-08-25 21:33:00 +0000
committerKristian Rietveld <kristian@src.gnome.org>2003-08-25 21:33:00 +0000
commit43d9992934928e9d1a4ba9cde4a2272762a02351 (patch)
tree4a66b0797bb79f726bb662fc954654e6aa8c400c /gtk/gtktreeselection.c
parentfb6914efe119b4c41242504d355588bd463bc2f3 (diff)
downloadgtk+-43d9992934928e9d1a4ba9cde4a2272762a02351.tar.gz
Merge from stable.
Mon Aug 25 23:21:43 2003 Kristian Rietveld <kris@gtk.org> Merge from stable. Fixes #115871, reported by Michael Natterer. * gtk/gtktreeprivate.h: added GtkTreeSelectMode enum, added ctrl_pressed and shift_pressed bitfields, (_gtk_tree_selection_internal_select_node): replace GdkModifierType arg with GtkTreeSelectMode. * gtk/gtktreeselection.c (gtk_tree_selection_set_mode), (gtk_tree_selection_select_path), (gtk_tree_selection_unselect_path), (_gtk_tree_selection_internal_select_node): all updated for GdkModifierType -> GtkTreeSelectMode move. * gtk/gtktreeview.c (gtk_tree_view_button_press): set ctrl_pressed and shift_pressed around selection handling block, (gtk_tree_view_real_select_cursor_row), (gtk_tree_view_real_toggle_cursor_row), (gtk_tree_view_real_selection_cursor_parent), (gtk_tree_view_real_set_cursor): use ctrl_pressed and shift_pressed, instead of checking the event state. And also updates for the GdkModifierType -> GtkTreeSelectMode move.
Diffstat (limited to 'gtk/gtktreeselection.c')
-rw-r--r--gtk/gtktreeselection.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/gtk/gtktreeselection.c b/gtk/gtktreeselection.c
index 9edac52715..67c37ef359 100644
--- a/gtk/gtktreeselection.c
+++ b/gtk/gtktreeselection.c
@@ -241,7 +241,7 @@ gtk_tree_selection_set_mode (GtkTreeSelection *selection,
node,
tree,
anchor_path,
- 0,
+ 0,
FALSE);
if (anchor_path)
gtk_tree_path_free (anchor_path);
@@ -771,8 +771,8 @@ gtk_tree_selection_select_path (GtkTreeSelection *selection,
{
GtkRBNode *node;
GtkRBTree *tree;
- GdkModifierType state = 0;
gboolean ret;
+ GtkTreeSelectMode mode = 0;
g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
g_return_if_fail (selection->tree_view != NULL);
@@ -788,13 +788,13 @@ gtk_tree_selection_select_path (GtkTreeSelection *selection,
return;
if (selection->type == GTK_SELECTION_MULTIPLE)
- state = GDK_CONTROL_MASK;
+ mode = GTK_TREE_SELECT_MODE_TOGGLE;
_gtk_tree_selection_internal_select_node (selection,
node,
tree,
path,
- state,
+ mode,
FALSE);
}
@@ -830,7 +830,7 @@ gtk_tree_selection_unselect_path (GtkTreeSelection *selection,
node,
tree,
path,
- GDK_CONTROL_MASK,
+ GTK_TREE_SELECT_MODE_TOGGLE,
TRUE);
}
@@ -1289,7 +1289,7 @@ _gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
GtkRBNode *node,
GtkRBTree *tree,
GtkTreePath *path,
- GdkModifierType state,
+ GtkTreeSelectMode mode,
gboolean override_browse_mode)
{
gint flags;
@@ -1314,7 +1314,7 @@ _gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
else if (selection->type == GTK_SELECTION_SINGLE &&
anchor_path && gtk_tree_path_compare (path, anchor_path) == 0)
{
- if ((state & GDK_CONTROL_MASK) == GDK_CONTROL_MASK)
+ if ((mode & GTK_TREE_SELECT_MODE_TOGGLE) == GTK_TREE_SELECT_MODE_TOGGLE)
{
dirty = gtk_tree_selection_real_unselect_all (selection);
}
@@ -1376,7 +1376,8 @@ _gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
}
else if (selection->type == GTK_SELECTION_MULTIPLE)
{
- if (((state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) && (anchor_path == NULL))
+ if ((mode & GTK_TREE_SELECT_MODE_EXTEND) == GTK_TREE_SELECT_MODE_EXTEND
+ && (anchor_path == NULL))
{
if (selection->tree_view->priv->anchor)
gtk_tree_row_reference_free (selection->tree_view->priv->anchor);
@@ -1385,13 +1386,13 @@ _gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
gtk_tree_row_reference_new_proxy (G_OBJECT (selection->tree_view), selection->tree_view->priv->model, path);
dirty = gtk_tree_selection_real_select_node (selection, tree, node, TRUE);
}
- else if ((state & (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) == (GDK_SHIFT_MASK|GDK_CONTROL_MASK))
+ else if ((mode & (GTK_TREE_SELECT_MODE_EXTEND | GTK_TREE_SELECT_MODE_TOGGLE)) == (GTK_TREE_SELECT_MODE_EXTEND | GTK_TREE_SELECT_MODE_TOGGLE))
{
gtk_tree_selection_select_range (selection,
anchor_path,
path);
}
- else if ((state & GDK_CONTROL_MASK) == GDK_CONTROL_MASK)
+ else if ((mode & GTK_TREE_SELECT_MODE_TOGGLE) == GTK_TREE_SELECT_MODE_TOGGLE)
{
flags = node->flags;
if (selection->tree_view->priv->anchor)
@@ -1405,7 +1406,7 @@ _gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
else
dirty |= gtk_tree_selection_real_select_node (selection, tree, node, TRUE);
}
- else if ((state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK)
+ else if ((mode & GTK_TREE_SELECT_MODE_EXTEND) == GTK_TREE_SELECT_MODE_EXTEND)
{
dirty = gtk_tree_selection_real_unselect_all (selection);
dirty |= gtk_tree_selection_real_modify_range (selection,