aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-10-26 21:23:14 +0800
committerChris Lahey <clahey@src.gnome.org>2001-10-26 21:23:14 +0800
commit2ea215ff874c94e37b6bbb51757f156c8a8fb629 (patch)
tree883bc1845554f2fe16afcde842e08ca8487b7487
parentecca55ac5a40866be96c3f08527e742ece39acd2 (diff)
downloadgsoc2013-evolution-2ea215ff874c94e37b6bbb51757f156c8a8fb629.tar
gsoc2013-evolution-2ea215ff874c94e37b6bbb51757f156c8a8fb629.tar.gz
gsoc2013-evolution-2ea215ff874c94e37b6bbb51757f156c8a8fb629.tar.bz2
gsoc2013-evolution-2ea215ff874c94e37b6bbb51757f156c8a8fb629.tar.lz
gsoc2013-evolution-2ea215ff874c94e37b6bbb51757f156c8a8fb629.tar.xz
gsoc2013-evolution-2ea215ff874c94e37b6bbb51757f156c8a8fb629.tar.zst
gsoc2013-evolution-2ea215ff874c94e37b6bbb51757f156c8a8fb629.zip
Added cursor_changed handling to set the has_cursor argument of the
2001-10-26 Christopher James Lahey <clahey@ximian.com> * gal/widgets/e-reflow.c, gal/widgets/e-reflow.h: Added cursor_changed handling to set the has_cursor argument of the contained objects. svn path=/trunk/; revision=14136
-rw-r--r--widgets/misc/e-reflow.c39
-rw-r--r--widgets/misc/e-reflow.h3
2 files changed, 42 insertions, 0 deletions
diff --git a/widgets/misc/e-reflow.c b/widgets/misc/e-reflow.c
index 478ddcb3b4..7ec6fc8c07 100644
--- a/widgets/misc/e-reflow.c
+++ b/widgets/misc/e-reflow.c
@@ -144,6 +144,37 @@ selection_changed (ESelectionModel *selection, EReflow *reflow)
}
static void
+cursor_changed (ESelectionModel *selection, int row, int col, EReflow *reflow)
+{
+ int count = reflow->count;
+ int old_cursor = reflow->cursor_row;
+
+ if (old_cursor < count && old_cursor >= 0) {
+ if (reflow->items[old_cursor]) {
+ gtk_object_set (GTK_OBJECT (reflow->items[old_cursor]),
+ "has_cursor", FALSE,
+ NULL);
+ }
+ }
+
+ reflow->cursor_row = row;
+
+ if (row < count && row >= 0) {
+ if (reflow->items[row]) {
+ gtk_object_set (GTK_OBJECT (reflow->items[row]),
+ "has_cursor", TRUE,
+ NULL);
+ } else {
+ reflow->items[row] = e_reflow_model_incarnate (reflow->model, row, GNOME_CANVAS_GROUP (reflow));
+ gtk_object_set (GTK_OBJECT (reflow->items[row]),
+ "has_cursor", TRUE,
+ "width", (double) reflow->column_width,
+ NULL);
+ }
+ }
+}
+
+static void
incarnate (EReflow *reflow)
{
int column_width;
@@ -419,9 +450,12 @@ disconnect_selection (EReflow *reflow)
gtk_signal_disconnect (GTK_OBJECT (reflow->selection),
reflow->selection_changed_id);
+ gtk_signal_disconnect (GTK_OBJECT (reflow->selection),
+ reflow->cursor_changed_id);
gtk_object_unref (GTK_OBJECT (reflow->selection));
reflow->selection_changed_id = 0;
+ reflow->cursor_changed_id = 0;
reflow->selection = NULL;
}
@@ -1231,6 +1265,8 @@ e_reflow_init (EReflow *reflow)
reflow->arrow_cursor = NULL;
reflow->default_cursor = NULL;
+ reflow->cursor_row = -1;
+
reflow->incarnate_idle_id = 0;
reflow->selection = E_SELECTION_MODEL (e_selection_model_simple_new());
@@ -1243,6 +1279,9 @@ e_reflow_init (EReflow *reflow)
reflow->selection_changed_id =
gtk_signal_connect(GTK_OBJECT(reflow->selection), "selection_changed",
GTK_SIGNAL_FUNC(selection_changed), reflow);
+ reflow->cursor_changed_id =
+ gtk_signal_connect(GTK_OBJECT(reflow->selection), "cursor_changed",
+ GTK_SIGNAL_FUNC(cursor_changed), reflow);
e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(reflow), e_reflow_reflow);
}
diff --git a/widgets/misc/e-reflow.h b/widgets/misc/e-reflow.h
index 9ecbb5c529..b190e1e5b7 100644
--- a/widgets/misc/e-reflow.h
+++ b/widgets/misc/e-reflow.h
@@ -66,6 +66,7 @@ struct _EReflow
ESelectionModel *selection;
guint selection_changed_id;
+ guint cursor_changed_id;
ESorterArray *sorter;
GtkAdjustment *adjustment;
@@ -98,6 +99,8 @@ struct _EReflow
double temp_column_width;
double previous_temp_column_width;
+ int cursor_row;
+
guint column_drag : 1;
guint need_height_update : 1;