aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2002-05-10 06:12:01 +0800
committerChris Lahey <clahey@src.gnome.org>2002-05-10 06:12:01 +0800
commit57a877702667674f5ddb845c1c7d4378866c391c (patch)
treeb13644c59f3ea9743bc7dda63944b27d45192356 /widgets/table
parentc670e9d15bdaf3c99a42191e48fa315b80800c69 (diff)
downloadgsoc2013-evolution-57a877702667674f5ddb845c1c7d4378866c391c.tar
gsoc2013-evolution-57a877702667674f5ddb845c1c7d4378866c391c.tar.gz
gsoc2013-evolution-57a877702667674f5ddb845c1c7d4378866c391c.tar.bz2
gsoc2013-evolution-57a877702667674f5ddb845c1c7d4378866c391c.tar.lz
gsoc2013-evolution-57a877702667674f5ddb845c1c7d4378866c391c.tar.xz
gsoc2013-evolution-57a877702667674f5ddb845c1c7d4378866c391c.tar.zst
gsoc2013-evolution-57a877702667674f5ddb845c1c7d4378866c391c.zip
Switch from gnome_canvas_item_grab to e_canvas_item_grab.
2002-05-09 Christopher James Lahey <clahey@ximian.com> * gal/e-text/e-text.c: Switch from gnome_canvas_item_grab to e_canvas_item_grab. * gal/widgets/e-canvas.c, gal/widgets/e-canvas.h (e_canvas_item_grab, e_canvas_item_ungrab): Added these functions. From gal/e-table/ChangeLog: 2002-05-09 Christopher James Lahey <clahey@ximian.com> * e-table-item.c, e-table-item.h: Switched from gnome_canvas_item_grab to e_canvas_item_grab. svn path=/trunk/; revision=16738
Diffstat (limited to 'widgets/table')
-rw-r--r--widgets/table/e-table-item.c35
-rw-r--r--widgets/table/e-table-item.h1
2 files changed, 28 insertions, 8 deletions
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index d92a174f45..80b557251a 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -30,6 +30,8 @@
#include "e-table-item.h"
+#include <X11/Xlib.h>
+
#include <math.h>
#include <stdio.h>
#include <gtk/gtksignal.h>
@@ -168,6 +170,14 @@ view_to_model_col(ETableItem *eti, int col)
return ecol ? ecol->col_idx : -1;
}
+static void
+grab_cancelled (ECanvas *canvas, GnomeCanvasItem *item, gpointer data)
+{
+ ETableItem *eti = data;
+
+ eti->grab_cancelled = TRUE;
+}
+
inline static void
eti_grab (ETableItem *eti, guint32 time)
{
@@ -175,10 +185,14 @@ eti_grab (ETableItem *eti, guint32 time)
d(g_print ("%s: time: %d\n", __FUNCTION__, time));
if (eti->grabbed_count == 0) {
eti->gtk_grabbed = FALSE;
- if (!gnome_canvas_item_grab(item,
- GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | GDK_BUTTON3_MOTION_MASK
- | GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK,
- NULL, time)) {
+ eti->grab_cancelled = FALSE;
+ if (e_canvas_item_grab(E_CANVAS (item->canvas),
+ item,
+ GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | GDK_BUTTON3_MOTION_MASK
+ | GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK,
+ NULL, time,
+ grab_cancelled,
+ eti) != GrabSuccess) {
d(g_print ("%s: gtk_grab_add\n", __FUNCTION__));
gtk_grab_add (GTK_WIDGET (item->canvas));
eti->gtk_grabbed = TRUE;
@@ -194,11 +208,16 @@ eti_ungrab (ETableItem *eti, guint32 time)
d(g_print ("%s: time: %d\n", __FUNCTION__, time));
eti->grabbed_count --;
if (eti->grabbed_count == 0) {
- if (eti->gtk_grabbed) {
- d(g_print ("%s: gtk_grab_remove\n", __FUNCTION__));
- gtk_grab_remove (GTK_WIDGET (item->canvas));
+ if (eti->grab_cancelled) {
+ eti->grab_cancelled = FALSE;
+ } else {
+ if (eti->gtk_grabbed) {
+ d(g_print ("%s: gtk_grab_remove\n", __FUNCTION__));
+ gtk_grab_remove (GTK_WIDGET (item->canvas));
+ eti->gtk_grabbed = FALSE;
+ }
+ gnome_canvas_item_ungrab(item, time);
}
- gnome_canvas_item_ungrab(item, time);
}
}
diff --git a/widgets/table/e-table-item.h b/widgets/table/e-table-item.h
index 793379b837..f1f055f1a1 100644
--- a/widgets/table/e-table-item.h
+++ b/widgets/table/e-table-item.h
@@ -114,6 +114,7 @@ typedef struct {
guint gtk_grabbed : 1;
guint queue_show_cursor : 1;
+ guint grab_cancelled : 1;
int frozen_count;