+Tue Feb 2 00:28:44 1999 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkctree.c (gtk_ctree_insert_node): in case of
+ GTK_SELECTION_BROWSE select first inserted row.
+ (resync_selection): select rows in correct order.
+
+ * gtk/gtkclist.c (real_insert_row): in case of GTK_SELECTION_BROWSE
+ select first inserted row.
+ (resync_selection): select rows in correct order.
+
+ * gtk/gtklist.c (gtk_list_end_selection): select rows in correct order.
+
Mon Feb 1 16:47:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk.m4: Pass gthread on to gtk-config.
+Tue Feb 2 00:28:44 1999 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkctree.c (gtk_ctree_insert_node): in case of
+ GTK_SELECTION_BROWSE select first inserted row.
+ (resync_selection): select rows in correct order.
+
+ * gtk/gtkclist.c (real_insert_row): in case of GTK_SELECTION_BROWSE
+ select first inserted row.
+ (resync_selection): select rows in correct order.
+
+ * gtk/gtklist.c (gtk_list_end_selection): select rows in correct order.
+
Mon Feb 1 16:47:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk.m4: Pass gthread on to gtk-config.
+Tue Feb 2 00:28:44 1999 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkctree.c (gtk_ctree_insert_node): in case of
+ GTK_SELECTION_BROWSE select first inserted row.
+ (resync_selection): select rows in correct order.
+
+ * gtk/gtkclist.c (real_insert_row): in case of GTK_SELECTION_BROWSE
+ select first inserted row.
+ (resync_selection): select rows in correct order.
+
+ * gtk/gtklist.c (gtk_list_end_selection): select rows in correct order.
+
Mon Feb 1 16:47:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk.m4: Pass gthread on to gtk-config.
+Tue Feb 2 00:28:44 1999 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkctree.c (gtk_ctree_insert_node): in case of
+ GTK_SELECTION_BROWSE select first inserted row.
+ (resync_selection): select rows in correct order.
+
+ * gtk/gtkclist.c (real_insert_row): in case of GTK_SELECTION_BROWSE
+ select first inserted row.
+ (resync_selection): select rows in correct order.
+
+ * gtk/gtklist.c (gtk_list_end_selection): select rows in correct order.
+
Mon Feb 1 16:47:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk.m4: Pass gthread on to gtk-config.
+Tue Feb 2 00:28:44 1999 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkctree.c (gtk_ctree_insert_node): in case of
+ GTK_SELECTION_BROWSE select first inserted row.
+ (resync_selection): select rows in correct order.
+
+ * gtk/gtkclist.c (real_insert_row): in case of GTK_SELECTION_BROWSE
+ select first inserted row.
+ (resync_selection): select rows in correct order.
+
+ * gtk/gtklist.c (gtk_list_end_selection): select rows in correct order.
+
Mon Feb 1 16:47:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk.m4: Pass gthread on to gtk-config.
+Tue Feb 2 00:28:44 1999 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkctree.c (gtk_ctree_insert_node): in case of
+ GTK_SELECTION_BROWSE select first inserted row.
+ (resync_selection): select rows in correct order.
+
+ * gtk/gtkclist.c (real_insert_row): in case of GTK_SELECTION_BROWSE
+ select first inserted row.
+ (resync_selection): select rows in correct order.
+
+ * gtk/gtklist.c (gtk_list_end_selection): select rows in correct order.
+
Mon Feb 1 16:47:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk.m4: Pass gthread on to gtk-config.
+Tue Feb 2 00:28:44 1999 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkctree.c (gtk_ctree_insert_node): in case of
+ GTK_SELECTION_BROWSE select first inserted row.
+ (resync_selection): select rows in correct order.
+
+ * gtk/gtkclist.c (real_insert_row): in case of GTK_SELECTION_BROWSE
+ select first inserted row.
+ (resync_selection): select rows in correct order.
+
+ * gtk/gtklist.c (gtk_list_end_selection): select rows in correct order.
+
Mon Feb 1 16:47:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk.m4: Pass gthread on to gtk-config.
clist_row))->next;
else
clist->row_list = g_list_insert (clist->row_list, clist_row, row);
+
}
-
clist->rows++;
if (row < ROW_FROM_YPIXEL (clist, 0))
/* syncronize the selection list */
sync_selection (clist, row, SYNC_INSERT);
+ if (clist->rows == 1)
+ {
+ clist->focus_row = 0;
+ if (clist->selection_mode == GTK_SELECTION_BROWSE)
+ gtk_clist_select_row (clist, 0, -1);
+ }
+
/* redraw the list if it isn't frozen */
if (CLIST_UNFROZEN (clist))
{
}
}
- for (list = g_list_nth (clist->row_list, i); i <= e; i++, list = list->next)
- if (GTK_CLIST_ROW (list)->selectable)
- {
- if (g_list_find (clist->selection, GINT_TO_POINTER(i)))
+ if (clist->anchor < clist->drag_pos)
+ {
+ for (list = g_list_nth (clist->row_list, i); i <= e;
+ i++, list = list->next)
+ if (GTK_CLIST_ROW (list)->selectable)
{
- if (GTK_CLIST_ROW (list)->state == GTK_STATE_NORMAL)
+ if (g_list_find (clist->selection, GINT_TO_POINTER(i)))
{
- GTK_CLIST_ROW (list)->state = GTK_STATE_SELECTED;
- gtk_signal_emit (GTK_OBJECT (clist),
- clist_signals[UNSELECT_ROW], i, -1, event);
- clist->undo_selection = g_list_prepend (clist->undo_selection,
- GINT_TO_POINTER (i));
+ if (GTK_CLIST_ROW (list)->state == GTK_STATE_NORMAL)
+ {
+ GTK_CLIST_ROW (list)->state = GTK_STATE_SELECTED;
+ gtk_signal_emit (GTK_OBJECT (clist),
+ clist_signals[UNSELECT_ROW],
+ i, -1, event);
+ clist->undo_selection =
+ g_list_prepend (clist->undo_selection,
+ GINT_TO_POINTER (i));
+ }
+ }
+ else if (GTK_CLIST_ROW (list)->state == GTK_STATE_SELECTED)
+ {
+ GTK_CLIST_ROW (list)->state = GTK_STATE_NORMAL;
+ clist->undo_unselection =
+ g_list_prepend (clist->undo_unselection,
+ GINT_TO_POINTER (i));
}
}
- else if (GTK_CLIST_ROW (list)->state == GTK_STATE_SELECTED)
+ }
+ else
+ {
+ for (list = g_list_nth (clist->row_list, e); i <= e;
+ e--, list = list->prev)
+ if (GTK_CLIST_ROW (list)->selectable)
{
- GTK_CLIST_ROW (list)->state = GTK_STATE_NORMAL;
- clist->undo_unselection = g_list_prepend (clist->undo_unselection,
- GINT_TO_POINTER (i));
+ if (g_list_find (clist->selection, GINT_TO_POINTER(e)))
+ {
+ if (GTK_CLIST_ROW (list)->state == GTK_STATE_NORMAL)
+ {
+ GTK_CLIST_ROW (list)->state = GTK_STATE_SELECTED;
+ gtk_signal_emit (GTK_OBJECT (clist),
+ clist_signals[UNSELECT_ROW],
+ e, -1, event);
+ clist->undo_selection =
+ g_list_prepend (clist->undo_selection,
+ GINT_TO_POINTER (e));
+ }
+ }
+ else if (GTK_CLIST_ROW (list)->state == GTK_STATE_SELECTED)
+ {
+ GTK_CLIST_ROW (list)->state = GTK_STATE_NORMAL;
+ clist->undo_unselection =
+ g_list_prepend (clist->undo_unselection,
+ GINT_TO_POINTER (e));
+ }
}
- }
+ }
- for (list = clist->undo_unselection; list; list = list->next)
+ for (list = g_list_reverse (clist->undo_unselection); list;
+ list = list->next)
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW],
GPOINTER_TO_INT (list->data), -1, event);
column_auto_resize (clist, &(new_row->row), i, 0);
}
+ if (clist->rows == 1)
+ {
+ clist->focus_row = 0;
+ if (clist->selection_mode == GTK_SELECTION_BROWSE)
+ gtk_ctree_select (ctree, node);
+ }
+
+
CLIST_REFRESH (clist);
return node;
}
}
-
- for (node = GTK_CTREE_NODE (g_list_nth (clist->row_list, i)); i <= e;
- i++, node = GTK_CTREE_NODE_NEXT (node))
- if (GTK_CTREE_ROW (node)->row.selectable)
- {
- if (g_list_find (clist->selection, node))
+ if (clist->anchor < clist->drag_pos)
+ {
+ for (node = GTK_CTREE_NODE (g_list_nth (clist->row_list, i)); i <= e;
+ i++, node = GTK_CTREE_NODE_NEXT (node))
+ if (GTK_CTREE_ROW (node)->row.selectable)
{
- if (GTK_CTREE_ROW (node)->row.state == GTK_STATE_NORMAL)
+ if (g_list_find (clist->selection, node))
+ {
+ if (GTK_CTREE_ROW (node)->row.state == GTK_STATE_NORMAL)
+ {
+ GTK_CTREE_ROW (node)->row.state = GTK_STATE_SELECTED;
+ gtk_ctree_unselect (ctree, node);
+ clist->undo_selection =
+ g_list_prepend (clist->undo_selection, node);
+ }
+ }
+ else if (GTK_CTREE_ROW (node)->row.state == GTK_STATE_SELECTED)
{
- GTK_CTREE_ROW (node)->row.state = GTK_STATE_SELECTED;
- gtk_ctree_unselect (ctree, node);
- clist->undo_selection = g_list_prepend (clist->undo_selection,
- node);
+ GTK_CTREE_ROW (node)->row.state = GTK_STATE_NORMAL;
+ clist->undo_unselection =
+ g_list_prepend (clist->undo_unselection, node);
}
}
- else if (GTK_CTREE_ROW (node)->row.state == GTK_STATE_SELECTED)
+ }
+ else
+ {
+ for (node = GTK_CTREE_NODE (g_list_nth (clist->row_list, e)); i <= e;
+ e--, node = GTK_CTREE_NODE_PREV (node))
+ if (GTK_CTREE_ROW (node)->row.selectable)
{
- GTK_CTREE_ROW (node)->row.state = GTK_STATE_NORMAL;
- clist->undo_unselection = g_list_prepend (clist->undo_unselection,
- node);
+ if (g_list_find (clist->selection, node))
+ {
+ if (GTK_CTREE_ROW (node)->row.state == GTK_STATE_NORMAL)
+ {
+ GTK_CTREE_ROW (node)->row.state = GTK_STATE_SELECTED;
+ gtk_ctree_unselect (ctree, node);
+ clist->undo_selection =
+ g_list_prepend (clist->undo_selection, node);
+ }
+ }
+ else if (GTK_CTREE_ROW (node)->row.state == GTK_STATE_SELECTED)
+ {
+ GTK_CTREE_ROW (node)->row.state = GTK_STATE_NORMAL;
+ clist->undo_unselection =
+ g_list_prepend (clist->undo_unselection, node);
+ }
}
- }
+ }
- for (list = clist->undo_unselection; list; list = list->next)
+ for (list = g_list_reverse (clist->undo_unselection); list;
+ list = list->next)
gtk_ctree_select (ctree, list->data);
clist->anchor = -1;
{
gint i;
gint e;
+ gboolean top_down;
GList *work;
GtkWidget *item;
gint item_index;
i = MIN (list->anchor, list->drag_pos);
e = MAX (list->anchor, list->drag_pos);
-
+
+ top_down = (list->anchor < list->drag_pos);
+
list->anchor = -1;
list->drag_pos = -1;
-
+
if (list->undo_selection)
{
work = list->selection;
}
}
- for (work = g_list_nth (list->children, i); i <= e; i++, work = work->next)
+ if (top_down)
{
- item = work->data;
- if (g_list_find (list->selection, item))
- {
- if (item->state == GTK_STATE_NORMAL)
- {
- gtk_widget_set_state (item, GTK_STATE_SELECTED);
- gtk_list_unselect_child (list, item);
- list->undo_selection = g_list_prepend (list->undo_selection,
+ for (work = g_list_nth (list->children, i); i <= e;
+ i++, work = work->next)
+ {
+ item = work->data;
+ if (g_list_find (list->selection, item))
+ {
+ if (item->state == GTK_STATE_NORMAL)
+ {
+ gtk_widget_set_state (item, GTK_STATE_SELECTED);
+ gtk_list_unselect_child (list, item);
+ list->undo_selection = g_list_prepend (list->undo_selection,
+ item);
+ }
+ }
+ else if (item->state == GTK_STATE_SELECTED)
+ {
+ gtk_widget_set_state (item, GTK_STATE_NORMAL);
+ list->undo_unselection = g_list_prepend (list->undo_unselection,
item);
- }
- }
- else if (item->state == GTK_STATE_SELECTED)
+ }
+ }
+ }
+ else
+ {
+ for (work = g_list_nth (list->children, e); i <= e;
+ e--, work = work->prev)
{
- gtk_widget_set_state (item, GTK_STATE_NORMAL);
- list->undo_unselection = g_list_prepend (list->undo_unselection,
- item);
+ item = work->data;
+ if (g_list_find (list->selection, item))
+ {
+ if (item->state == GTK_STATE_NORMAL)
+ {
+ gtk_widget_set_state (item, GTK_STATE_SELECTED);
+ gtk_list_unselect_child (list, item);
+ list->undo_selection = g_list_prepend (list->undo_selection,
+ item);
+ }
+ }
+ else if (item->state == GTK_STATE_SELECTED)
+ {
+ gtk_widget_set_state (item, GTK_STATE_NORMAL);
+ list->undo_unselection = g_list_prepend (list->undo_unselection,
+ item);
+ }
}
}
- for (work = list->undo_unselection; work; work = work->next)
+ for (work = g_list_reverse (list->undo_unselection); work; work = work->next)
gtk_list_select_child (list, GTK_WIDGET (work->data));
+
}
void