aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-item.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-05-28 12:25:22 +0800
committerChris Lahey <clahey@src.gnome.org>2000-05-28 12:25:22 +0800
commitf91435fc0c0186d48079dc44d8626135eba92462 (patch)
treee8e3cac32823d3ff377dbebfa72351a0d2e8eb50 /widgets/table/e-table-item.c
parent0473e106f01671731351f69bdf29f3d438b75b05 (diff)
downloadgsoc2013-evolution-f91435fc0c0186d48079dc44d8626135eba92462.tar.gz
gsoc2013-evolution-f91435fc0c0186d48079dc44d8626135eba92462.tar.zst
gsoc2013-evolution-f91435fc0c0186d48079dc44d8626135eba92462.zip
Added double click handling.
2000-05-28 Christopher James Lahey <clahey@helixcode.com> * e-table-group-container.c, e-table-group-leaf.c, e-table-group.c, e-table-group.h, e-table-item.c, e-table-item.h, e-table.c, e-table.h: Added double click handling. svn path=/trunk/; revision=3238
Diffstat (limited to 'widgets/table/e-table-item.c')
-rw-r--r--widgets/table/e-table-item.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 05b722f27c..ad645a8c39 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -28,6 +28,7 @@ static GnomeCanvasItemClass *eti_parent_class;
enum {
ROW_SELECTION,
+ DOUBLE_CLICK,
LAST_SIGNAL
};
@@ -1127,8 +1128,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
switch (e->type){
case GDK_BUTTON_PRESS:
- case GDK_BUTTON_RELEASE:
- case GDK_2BUTTON_PRESS: {
+ case GDK_BUTTON_RELEASE: {
double x1, y1;
int col, row;
@@ -1164,6 +1164,23 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
break;
}
+ case GDK_2BUTTON_PRESS: {
+ double x1, y1;
+ int col, row;
+
+ if (e->button.button == 5 ||
+ e->button.button == 4)
+ return FALSE;
+
+ gnome_canvas_item_w2i (item, &e->button.x, &e->button.y);
+
+ if (!find_cell (eti, e->button.x, e->button.y, &col, &row, &x1, &y1))
+ return TRUE;
+
+ gtk_signal_emit (GTK_OBJECT (eti), eti_signals [DOUBLE_CLICK],
+ GPOINTER_TO_INT (eti->selection->data));
+ break;
+ }
case GDK_MOTION_NOTIFY: {
int col, row;
double x1, y1;
@@ -1317,7 +1334,8 @@ eti_class_init (GtkObjectClass *object_class)
item_class->point = eti_point;
item_class->event = eti_event;
- eti_class->row_selection = eti_row_selection;
+ eti_class->row_selection = eti_row_selection;
+ eti_class->double_click = NULL;
gtk_object_add_arg_type ("ETableItem::ETableHeader", GTK_TYPE_OBJECT,
GTK_ARG_WRITABLE, ARG_TABLE_HEADER);
@@ -1348,7 +1366,15 @@ eti_class_init (GtkObjectClass *object_class)
GTK_SIGNAL_OFFSET (ETableItemClass, row_selection),
gtk_marshal_NONE__INT_INT,
GTK_TYPE_NONE, 2, GTK_TYPE_INT, GTK_TYPE_INT);
-
+
+ eti_signals [DOUBLE_CLICK] =
+ gtk_signal_new ("double_click",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (ETableItemClass, double_click),
+ gtk_marshal_NONE__INT,
+ GTK_TYPE_NONE, 1, GTK_TYPE_INT);
+
gtk_object_class_add_signals (object_class, eti_signals, LAST_SIGNAL);
}