Commit 64e33eb6 authored by Kristian Rietveld's avatar Kristian Rietveld Committed by Kristian Rietveld
Browse files

Fixes #78110

Tue Apr  9 21:41:24 2002  Kristian Rietveld  <kris@gtk.org>

        Fixes #78110

        * gtk/gtktreeselection.c (_gtk_tree_selection_internal_select_node):
        add override_browse_mode argument and implement,
        (gtk_tree_selection_unselect_path): always unselect the path,
        (toplevel): update uses of _gtk_tree_selection_internal_select_node

        * gtk/gtktreeview.c: update uses of
        _gtk_tree_selection_internal_select_node

        * gtk/gtktreeprivate.h (_gtk_tree_selection_internal_select_node):
        update prototype

Tue Apr  9 21:39:44 2002  Kristian Rietveld  <kris@gtk.org>

        Fixes #77862

        * gtk/gtktreeprivate.h: add _gtk_tree_view_column_has_editable_cell

        * gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_has_editable_cell):
        new function

        * gtk/gtktreeview.c (gtk_tree_view_button_press): send cell event
        on first click when cell isn't editable

Tue Apr  9 21:37:31 2002  Kristian Rietveld  <kris@gtk.org>

        * gtk/gtktreedatalist.c (_gtk_tree_data_list_check_type): add some
        types which were missing and useful to use (fixes #77870)
parent 2e85b314
Tue Apr 9 21:41:24 2002 Kristian Rietveld <kris@gtk.org>
Fixes #78110
* gtk/gtktreeselection.c (_gtk_tree_selection_internal_select_node):
add override_browse_mode argument and implement,
(gtk_tree_selection_unselect_path): always unselect the path,
(toplevel): update uses of _gtk_tree_selection_internal_select_node
* gtk/gtktreeview.c: update uses of
_gtk_tree_selection_internal_select_node
* gtk/gtktreeprivate.h (_gtk_tree_selection_internal_select_node):
update prototype
Tue Apr 9 21:39:44 2002 Kristian Rietveld <kris@gtk.org>
Fixes #77862
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_has_editable_cell
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_has_editable_cell):
new function
* gtk/gtktreeview.c (gtk_tree_view_button_press): send cell event
on first click when cell isn't editable
Tue Apr 9 21:37:31 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreedatalist.c (_gtk_tree_data_list_check_type): add some
types which were missing and useful to use (fixes #77870)
2002-04-09 Anders Carlsson <andersca@gnu.org>
* gtk/gtkfilesel.c (open_new_dir): Initialize error to NULL.
......
Tue Apr 9 21:41:24 2002 Kristian Rietveld <kris@gtk.org>
Fixes #78110
* gtk/gtktreeselection.c (_gtk_tree_selection_internal_select_node):
add override_browse_mode argument and implement,
(gtk_tree_selection_unselect_path): always unselect the path,
(toplevel): update uses of _gtk_tree_selection_internal_select_node
* gtk/gtktreeview.c: update uses of
_gtk_tree_selection_internal_select_node
* gtk/gtktreeprivate.h (_gtk_tree_selection_internal_select_node):
update prototype
Tue Apr 9 21:39:44 2002 Kristian Rietveld <kris@gtk.org>
Fixes #77862
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_has_editable_cell
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_has_editable_cell):
new function
* gtk/gtktreeview.c (gtk_tree_view_button_press): send cell event
on first click when cell isn't editable
Tue Apr 9 21:37:31 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreedatalist.c (_gtk_tree_data_list_check_type): add some
types which were missing and useful to use (fixes #77870)
2002-04-09 Anders Carlsson <andersca@gnu.org>
* gtk/gtkfilesel.c (open_new_dir): Initialize error to NULL.
......
Tue Apr 9 21:41:24 2002 Kristian Rietveld <kris@gtk.org>
Fixes #78110
* gtk/gtktreeselection.c (_gtk_tree_selection_internal_select_node):
add override_browse_mode argument and implement,
(gtk_tree_selection_unselect_path): always unselect the path,
(toplevel): update uses of _gtk_tree_selection_internal_select_node
* gtk/gtktreeview.c: update uses of
_gtk_tree_selection_internal_select_node
* gtk/gtktreeprivate.h (_gtk_tree_selection_internal_select_node):
update prototype
Tue Apr 9 21:39:44 2002 Kristian Rietveld <kris@gtk.org>
Fixes #77862
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_has_editable_cell
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_has_editable_cell):
new function
* gtk/gtktreeview.c (gtk_tree_view_button_press): send cell event
on first click when cell isn't editable
Tue Apr 9 21:37:31 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreedatalist.c (_gtk_tree_data_list_check_type): add some
types which were missing and useful to use (fixes #77870)
2002-04-09 Anders Carlsson <andersca@gnu.org>
* gtk/gtkfilesel.c (open_new_dir): Initialize error to NULL.
......
Tue Apr 9 21:41:24 2002 Kristian Rietveld <kris@gtk.org>
Fixes #78110
* gtk/gtktreeselection.c (_gtk_tree_selection_internal_select_node):
add override_browse_mode argument and implement,
(gtk_tree_selection_unselect_path): always unselect the path,
(toplevel): update uses of _gtk_tree_selection_internal_select_node
* gtk/gtktreeview.c: update uses of
_gtk_tree_selection_internal_select_node
* gtk/gtktreeprivate.h (_gtk_tree_selection_internal_select_node):
update prototype
Tue Apr 9 21:39:44 2002 Kristian Rietveld <kris@gtk.org>
Fixes #77862
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_has_editable_cell
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_has_editable_cell):
new function
* gtk/gtktreeview.c (gtk_tree_view_button_press): send cell event
on first click when cell isn't editable
Tue Apr 9 21:37:31 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreedatalist.c (_gtk_tree_data_list_check_type): add some
types which were missing and useful to use (fixes #77870)
2002-04-09 Anders Carlsson <andersca@gnu.org>
* gtk/gtkfilesel.c (open_new_dir): Initialize error to NULL.
......
Tue Apr 9 21:41:24 2002 Kristian Rietveld <kris@gtk.org>
Fixes #78110
* gtk/gtktreeselection.c (_gtk_tree_selection_internal_select_node):
add override_browse_mode argument and implement,
(gtk_tree_selection_unselect_path): always unselect the path,
(toplevel): update uses of _gtk_tree_selection_internal_select_node
* gtk/gtktreeview.c: update uses of
_gtk_tree_selection_internal_select_node
* gtk/gtktreeprivate.h (_gtk_tree_selection_internal_select_node):
update prototype
Tue Apr 9 21:39:44 2002 Kristian Rietveld <kris@gtk.org>
Fixes #77862
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_has_editable_cell
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_has_editable_cell):
new function
* gtk/gtktreeview.c (gtk_tree_view_button_press): send cell event
on first click when cell isn't editable
Tue Apr 9 21:37:31 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreedatalist.c (_gtk_tree_data_list_check_type): add some
types which were missing and useful to use (fixes #77870)
2002-04-09 Anders Carlsson <andersca@gnu.org>
* gtk/gtkfilesel.c (open_new_dir): Initialize error to NULL.
......
Tue Apr 9 21:41:24 2002 Kristian Rietveld <kris@gtk.org>
Fixes #78110
* gtk/gtktreeselection.c (_gtk_tree_selection_internal_select_node):
add override_browse_mode argument and implement,
(gtk_tree_selection_unselect_path): always unselect the path,
(toplevel): update uses of _gtk_tree_selection_internal_select_node
* gtk/gtktreeview.c: update uses of
_gtk_tree_selection_internal_select_node
* gtk/gtktreeprivate.h (_gtk_tree_selection_internal_select_node):
update prototype
Tue Apr 9 21:39:44 2002 Kristian Rietveld <kris@gtk.org>
Fixes #77862
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_has_editable_cell
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_has_editable_cell):
new function
* gtk/gtktreeview.c (gtk_tree_view_button_press): send cell event
on first click when cell isn't editable
Tue Apr 9 21:37:31 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreedatalist.c (_gtk_tree_data_list_check_type): add some
types which were missing and useful to use (fixes #77870)
2002-04-09 Anders Carlsson <andersca@gnu.org>
* gtk/gtkfilesel.c (open_new_dir): Initialize error to NULL.
......
......@@ -80,6 +80,10 @@ _gtk_tree_data_list_check_type (GType type)
G_TYPE_UCHAR,
G_TYPE_INT,
G_TYPE_UINT,
G_TYPE_LONG,
G_TYPE_ULONG,
G_TYPE_INT64,
G_TYPE_UINT64,
G_TYPE_ENUM,
G_TYPE_FLAGS,
G_TYPE_FLOAT,
......
......@@ -272,7 +272,8 @@ void _gtk_tree_selection_internal_select_node (GtkTreeSelection *select
GtkRBNode *node,
GtkRBTree *tree,
GtkTreePath *path,
GdkModifierType state);
GdkModifierType state,
gboolean override_browse_mode);
gboolean _gtk_tree_view_find_node (GtkTreeView *tree_view,
GtkTreePath *path,
GtkRBTree **tree,
......@@ -311,6 +312,7 @@ void _gtk_tree_view_column_start_editing (GtkTreeViewColumn *tree_column,
GtkCellEditable *editable_widget);
void _gtk_tree_view_column_stop_editing (GtkTreeViewColumn *tree_column);
void _gtk_tree_view_install_mark_rows_col_dirty (GtkTreeView *tree_view);
gboolean _gtk_tree_view_column_has_editable_cell (GtkTreeViewColumn *column);
GtkTreeSelection* _gtk_tree_selection_new (void);
GtkTreeSelection* _gtk_tree_selection_new_with_tree_view (GtkTreeView *tree_view);
......
......@@ -239,7 +239,8 @@ gtk_tree_selection_set_mode (GtkTreeSelection *selection,
node,
tree,
anchor_path,
0);
0,
FALSE);
if (anchor_path)
gtk_tree_path_free (anchor_path);
}
......@@ -549,7 +550,8 @@ gtk_tree_selection_select_path (GtkTreeSelection *selection,
node,
tree,
path,
state);
state,
FALSE);
}
/**
......@@ -584,7 +586,8 @@ gtk_tree_selection_unselect_path (GtkTreeSelection *selection,
node,
tree,
path,
GDK_CONTROL_MASK);
GDK_CONTROL_MASK,
TRUE);
}
/**
......@@ -986,12 +989,19 @@ gtk_tree_selection_select_range (GtkTreeSelection *selection,
/* Called internally by gtktreeview.c It handles actually selecting the tree.
*/
/**
* docs about the 'override_browse_mode', we set this flag when we want to
* unset select the node and override the select browse mode behaviour (that is
* 'one node should *always* be selected').
*/
void
_gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
GtkRBNode *node,
GtkRBTree *tree,
GtkTreePath *path,
GdkModifierType state)
GdkModifierType state,
gboolean override_browse_mode)
{
gint flags;
gint dirty = FALSE;
......@@ -1006,9 +1016,14 @@ _gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
if (selection->type == GTK_SELECTION_SINGLE ||
selection->type == GTK_SELECTION_BROWSE)
{
/* just unselect */
if (selection->type == GTK_SELECTION_BROWSE && override_browse_mode)
{
dirty = gtk_tree_selection_real_unselect_all (selection);
}
/* Did we try to select the same node again? */
if (selection->type == GTK_SELECTION_SINGLE &&
anchor_path && gtk_tree_path_compare (path, anchor_path) == 0)
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)
{
......
......@@ -1794,7 +1794,8 @@ gtk_tree_view_button_press (GtkWidget *widget,
{
GtkTreePath *cursor = gtk_tree_row_reference_get_path (tree_view->priv->cursor);
if (cursor && !gtk_tree_path_compare (cursor, path))
if ((cursor && !gtk_tree_path_compare (cursor, path))
|| !_gtk_tree_view_column_has_editable_cell (column))
{
GtkCellEditable *cell_editable = NULL;
......@@ -7165,7 +7166,8 @@ gtk_tree_view_real_select_cursor_row (GtkTreeView *tree_view,
cursor_node,
cursor_tree,
cursor_path,
state);
state,
FALSE);
gtk_tree_view_clamp_node_visible (tree_view, cursor_tree, cursor_node);
......@@ -7207,7 +7209,8 @@ gtk_tree_view_real_toggle_cursor_row (GtkTreeView *tree_view)
cursor_node,
cursor_tree,
cursor_path,
GDK_CONTROL_MASK);
GDK_CONTROL_MASK,
FALSE);
gtk_tree_view_clamp_node_visible (tree_view, cursor_tree, cursor_node);
......@@ -7290,7 +7293,8 @@ gtk_tree_view_real_select_cursor_parent (GtkTreeView *tree_view)
cursor_node,
cursor_tree,
cursor_path,
0);
0,
FALSE);
}
gtk_tree_view_clamp_node_visible (tree_view, cursor_tree, cursor_node);
......@@ -9127,7 +9131,7 @@ gtk_tree_view_real_set_cursor (GtkTreeView *tree_view,
if (clear_and_select && !((state & GDK_CONTROL_MASK) == GDK_CONTROL_MASK))
_gtk_tree_selection_internal_select_node (tree_view->priv->selection,
node, tree, path,
state);
state, FALSE);
gtk_tree_view_clamp_node_visible (tree_view, tree, node);
_gtk_tree_view_queue_draw_node (tree_view, tree, node, NULL);
}
......
......@@ -1040,6 +1040,19 @@ _gtk_tree_view_column_unset_tree_view (GtkTreeViewColumn *column)
column->button = NULL;
}
gboolean
_gtk_tree_view_column_has_editable_cell (GtkTreeViewColumn *column)
{
GList *list;
for (list = column->cell_list; list; list = list ->next)
if (((GtkTreeViewColumnCellInfo *)list->data)->cell->mode ==
GTK_CELL_RENDERER_MODE_EDITABLE)
return TRUE;
return FALSE;
}
/* Public Functions */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment