mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-12 05:20:17 +00:00
further justify gtk_tree_model_get_flags by adding a second flag for atk.
Tue Jun 12 12:41:27 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtktreemodel.h (GTK_TREE_MODEL_LIST_ONLY): further justify gtk_tree_model_get_flags by adding a second flag for atk. * gtk/gtktreemodel.c: make cursor behavior interact better with mouse presses.
This commit is contained in:
parent
5f437331f1
commit
5c60d1cf77
@ -1,3 +1,11 @@
|
||||
Tue Jun 12 12:41:27 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreemodel.h (GTK_TREE_MODEL_LIST_ONLY): further justify
|
||||
gtk_tree_model_get_flags by adding a second flag for atk.
|
||||
|
||||
* gtk/gtktreemodel.c: make cursor behavior interact better with
|
||||
mouse presses.
|
||||
|
||||
Mon Jun 11 12:43:08 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_class_init): changed
|
||||
|
@ -1,3 +1,11 @@
|
||||
Tue Jun 12 12:41:27 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreemodel.h (GTK_TREE_MODEL_LIST_ONLY): further justify
|
||||
gtk_tree_model_get_flags by adding a second flag for atk.
|
||||
|
||||
* gtk/gtktreemodel.c: make cursor behavior interact better with
|
||||
mouse presses.
|
||||
|
||||
Mon Jun 11 12:43:08 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_class_init): changed
|
||||
|
@ -1,3 +1,11 @@
|
||||
Tue Jun 12 12:41:27 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreemodel.h (GTK_TREE_MODEL_LIST_ONLY): further justify
|
||||
gtk_tree_model_get_flags by adding a second flag for atk.
|
||||
|
||||
* gtk/gtktreemodel.c: make cursor behavior interact better with
|
||||
mouse presses.
|
||||
|
||||
Mon Jun 11 12:43:08 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_class_init): changed
|
||||
|
@ -1,3 +1,11 @@
|
||||
Tue Jun 12 12:41:27 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreemodel.h (GTK_TREE_MODEL_LIST_ONLY): further justify
|
||||
gtk_tree_model_get_flags by adding a second flag for atk.
|
||||
|
||||
* gtk/gtktreemodel.c: make cursor behavior interact better with
|
||||
mouse presses.
|
||||
|
||||
Mon Jun 11 12:43:08 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_class_init): changed
|
||||
|
@ -1,3 +1,11 @@
|
||||
Tue Jun 12 12:41:27 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreemodel.h (GTK_TREE_MODEL_LIST_ONLY): further justify
|
||||
gtk_tree_model_get_flags by adding a second flag for atk.
|
||||
|
||||
* gtk/gtktreemodel.c: make cursor behavior interact better with
|
||||
mouse presses.
|
||||
|
||||
Mon Jun 11 12:43:08 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_class_init): changed
|
||||
|
@ -1,3 +1,11 @@
|
||||
Tue Jun 12 12:41:27 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreemodel.h (GTK_TREE_MODEL_LIST_ONLY): further justify
|
||||
gtk_tree_model_get_flags by adding a second flag for atk.
|
||||
|
||||
* gtk/gtktreemodel.c: make cursor behavior interact better with
|
||||
mouse presses.
|
||||
|
||||
Mon Jun 11 12:43:08 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_class_init): changed
|
||||
|
@ -1,3 +1,11 @@
|
||||
Tue Jun 12 12:41:27 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreemodel.h (GTK_TREE_MODEL_LIST_ONLY): further justify
|
||||
gtk_tree_model_get_flags by adding a second flag for atk.
|
||||
|
||||
* gtk/gtktreemodel.c: make cursor behavior interact better with
|
||||
mouse presses.
|
||||
|
||||
Mon Jun 11 12:43:08 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_class_init): changed
|
||||
|
@ -375,7 +375,7 @@ gtk_list_store_get_flags (GtkTreeModel *tree_model)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_LIST_STORE (tree_model), 0);
|
||||
|
||||
return GTK_TREE_MODEL_ITERS_PERSIST;
|
||||
return GTK_TREE_MODEL_ITERS_PERSIST | GTK_TREE_MODEL_LIST_ONLY;
|
||||
}
|
||||
|
||||
static gint
|
||||
|
@ -40,7 +40,8 @@ typedef struct _GtkTreeModelIface GtkTreeModelIface;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GTK_TREE_MODEL_ITERS_PERSIST = 1 << 0
|
||||
GTK_TREE_MODEL_ITERS_PERSIST = 1 << 0,
|
||||
GTK_TREE_MODEL_LIST_ONLY = 1 << 1,
|
||||
} GtkTreeModelFlags;
|
||||
|
||||
struct _GtkTreeIter
|
||||
|
@ -234,6 +234,7 @@ struct _GtkTreeViewPrivate
|
||||
}; }G_STMT_END
|
||||
#endif
|
||||
|
||||
|
||||
/* functions that shouldn't be exported */
|
||||
void _gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
|
||||
GtkRBNode *node,
|
||||
|
@ -162,7 +162,6 @@ _gtk_tree_selection_set_tree_view (GtkTreeSelection *selection,
|
||||
selection->tree_view = tree_view;
|
||||
}
|
||||
|
||||
/* FIXME explain what the anchor is */
|
||||
/**
|
||||
* gtk_tree_selection_set_mode:
|
||||
* @selection: A #GtkTreeSelection.
|
||||
|
@ -339,9 +339,10 @@ static gboolean gtk_tree_view_real_expand_row (GtkTreeView *tree_view,
|
||||
GtkRBTree *tree,
|
||||
GtkRBNode *node,
|
||||
gboolean open_all);
|
||||
static void gtk_tree_view_real_set_cursor (GtkTreeView *tree_view,
|
||||
GtkTreePath *path,
|
||||
gboolean clear_and_select);
|
||||
static void gtk_tree_view_real_set_cursor (GtkTreeView *tree_view,
|
||||
GtkTreePath *path,
|
||||
gboolean clear_and_select,
|
||||
GdkModifierType state);
|
||||
|
||||
|
||||
static GtkContainerClass *parent_class = NULL;
|
||||
@ -1499,8 +1500,8 @@ gtk_tree_view_button_press (GtkWidget *widget,
|
||||
background_area.y = y_offset + event->y + vertical_separator;
|
||||
background_area.height = GTK_RBNODE_GET_HEIGHT (node) - vertical_separator;
|
||||
background_area.x = 0;
|
||||
/* Let the cell have a chance at selecting it. */
|
||||
|
||||
/* Let the column have a chance at selecting it. */
|
||||
for (i = 0, list = tree_view->priv->columns; i < tree_view->priv->n_columns; i++, list = list->next)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
@ -1532,9 +1533,7 @@ gtk_tree_view_button_press (GtkWidget *widget,
|
||||
continue;
|
||||
}
|
||||
|
||||
gtk_tree_model_get_iter (tree_view->priv->model,
|
||||
&iter,
|
||||
path);
|
||||
gtk_tree_model_get_iter (tree_view->priv->model, &iter, path);
|
||||
gtk_tree_view_column_cell_set_cell_data (column,
|
||||
tree_view->priv->model,
|
||||
&iter);
|
||||
@ -1561,6 +1560,8 @@ gtk_tree_view_button_press (GtkWidget *widget,
|
||||
if (column == NULL)
|
||||
return FALSE;
|
||||
|
||||
/* The columns didn't want the event. We handle it */
|
||||
|
||||
/* Save press to possibly begin a drag
|
||||
*/
|
||||
if (tree_view->priv->pressed_button < 0)
|
||||
@ -1570,19 +1571,29 @@ gtk_tree_view_button_press (GtkWidget *widget,
|
||||
tree_view->priv->press_start_y = event->y;
|
||||
}
|
||||
|
||||
_gtk_tree_selection_internal_select_node (tree_view->priv->selection,
|
||||
node,
|
||||
tree,
|
||||
path,
|
||||
event->state);
|
||||
g_print ("%d\n", event->state);
|
||||
gtk_tree_view_real_set_cursor (tree_view, path, TRUE, event->state);
|
||||
|
||||
if (event->button == 1 && event->type == GDK_2BUTTON_PRESS)
|
||||
{
|
||||
if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_PARENT))
|
||||
{
|
||||
if (node->children == NULL)
|
||||
gtk_tree_view_real_expand_row (tree_view, path,
|
||||
tree, node, FALSE);
|
||||
else
|
||||
gtk_tree_view_real_collapse_row (GTK_TREE_VIEW (widget), path,
|
||||
tree, node);
|
||||
}
|
||||
gtk_tree_view_row_activated (tree_view, path, column);
|
||||
|
||||
}
|
||||
gtk_tree_path_free (path);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* We didn't click in the window. Let's check to see if we clicked on a column resize window.
|
||||
*/
|
||||
for (i = 0, list = tree_view->priv->columns; list; list = list->next, i++)
|
||||
{
|
||||
column = list->data;
|
||||
@ -5609,9 +5620,9 @@ gtk_tree_view_focus_to_cursor (GtkTreeView *tree_view)
|
||||
}
|
||||
|
||||
if (tree_view->priv->selection->type == GTK_TREE_SELECTION_SINGLE)
|
||||
gtk_tree_view_real_set_cursor (tree_view, cursor_path, TRUE);
|
||||
gtk_tree_view_real_set_cursor (tree_view, cursor_path, TRUE, 0);
|
||||
else
|
||||
gtk_tree_view_real_set_cursor (tree_view, cursor_path, FALSE);
|
||||
gtk_tree_view_real_set_cursor (tree_view, cursor_path, FALSE, 0);
|
||||
gtk_tree_path_free (cursor_path);
|
||||
|
||||
}
|
||||
@ -5820,7 +5831,6 @@ gtk_tree_view_real_expand_collapse_cursor_row (GtkTreeView *tree_view,
|
||||
{
|
||||
GtkTreePath *cursor_path = NULL;
|
||||
|
||||
g_print ("in gtk_tree_view_real_expand_collapse_cursor_row\n");
|
||||
cursor_path = NULL;
|
||||
if (tree_view->priv->cursor)
|
||||
cursor_path = gtk_tree_row_reference_get_path (tree_view->priv->cursor);
|
||||
@ -7306,9 +7316,10 @@ gtk_tree_view_set_reorderable (GtkTreeView *tree_view,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_tree_view_real_set_cursor (GtkTreeView *tree_view,
|
||||
GtkTreePath *path,
|
||||
gboolean clear_and_select)
|
||||
gtk_tree_view_real_set_cursor (GtkTreeView *tree_view,
|
||||
GtkTreePath *path,
|
||||
gboolean clear_and_select,
|
||||
GdkModifierType state)
|
||||
{
|
||||
GtkRBTree *tree = NULL;
|
||||
GtkRBNode *node = NULL;
|
||||
@ -7327,29 +7338,22 @@ gtk_tree_view_real_set_cursor (GtkTreeView *tree_view,
|
||||
gtk_tree_selection_unselect_all (tree_view->priv->selection);
|
||||
_gtk_tree_selection_internal_select_node (tree_view->priv->selection,
|
||||
node, tree,
|
||||
path, 0);
|
||||
path, state);
|
||||
}
|
||||
gtk_tree_view_clamp_node_visible (tree_view, tree, node);
|
||||
gtk_tree_view_queue_draw_node (tree_view, tree, node, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_tree_view_set_anchor (GtkTreeView *tree_view,
|
||||
GtkTreePath *path)
|
||||
{
|
||||
if (tree_view->priv->anchor)
|
||||
gtk_tree_row_reference_free (tree_view->priv->anchor);
|
||||
tree_view->priv->anchor = gtk_tree_row_reference_new_proxy (G_OBJECT (tree_view),
|
||||
tree_view->priv->model,
|
||||
path);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_tree_view_set_cursor:
|
||||
* @tree_view: A #GtkTreeView
|
||||
* @path: A #GtkTreePath
|
||||
*
|
||||
* Sets the current keyboard focus to be at @path.
|
||||
* Sets the current keyboard focus to be at @path, and selects it. This is
|
||||
* useful when you want to focus the user's attention on a particular row. If
|
||||
* you want to give the user keyboard focus in the tree_view, you should use
|
||||
* this function to set the correct path, and gtk_widget_grab_focus (GTK_WIDGET
|
||||
* (tree_view)) to actually give focus to the @tree_view.
|
||||
**/
|
||||
void
|
||||
gtk_tree_view_set_cursor (GtkTreeView *tree_view,
|
||||
@ -7358,8 +7362,7 @@ gtk_tree_view_set_cursor (GtkTreeView *tree_view,
|
||||
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
|
||||
g_return_if_fail (path != NULL);
|
||||
|
||||
gtk_tree_view_real_set_cursor (tree_view, path, TRUE);
|
||||
gtk_widget_grab_focus (GTK_WIDGET (tree_view));
|
||||
gtk_tree_view_real_set_cursor (tree_view, path, TRUE, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -175,8 +175,6 @@ void gtk_tree_view_column_set_sort_order (GtkTreeViewCol
|
||||
GtkTreeSortOrder gtk_tree_view_column_get_sort_order (GtkTreeViewColumn *tree_column);
|
||||
|
||||
|
||||
|
||||
|
||||
/* These functions are meant primarily for interaction between the GtkTreeView and the column.
|
||||
*/
|
||||
void gtk_tree_view_column_cell_set_cell_data (GtkTreeViewColumn *tree_column,
|
||||
|
Loading…
Reference in New Issue
Block a user