From: Jim Evins Date: Fri, 23 Aug 2002 03:03:30 +0000 (+0000) Subject: Changed event->button.* to event->motion.* when handling GTK_MOTION_NOTIFY events. X-Git-Tag: glabels-2_3_0~838 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=84a5fe2c73ed0ecd311133364f5e53d336cdc122;p=glabels Changed event->button.* to event->motion.* when handling GTK_MOTION_NOTIFY events. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@44 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- diff --git a/glabels2/src/view-barcode.c b/glabels2/src/view-barcode.c index 49bae837..364b24fe 100644 --- a/glabels2/src/view-barcode.c +++ b/glabels2/src/view-barcode.c @@ -681,8 +681,8 @@ gl_view_barcode_create_event_handler (GnomeCanvas *canvas, gl_debug (DEBUG_VIEW, "MOTION_NOTIFY"); if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) { gnome_canvas_window_to_world (canvas, - event->button.x, - event->button.y, &x, &y); + event->motion.x, + event->motion.y, &x, &y); gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); return TRUE; diff --git a/glabels2/src/view-box.c b/glabels2/src/view-box.c index 545fd8db..6fe809dd 100644 --- a/glabels2/src/view-box.c +++ b/glabels2/src/view-box.c @@ -686,8 +686,8 @@ gl_view_box_create_event_handler (GnomeCanvas *canvas, case GDK_MOTION_NOTIFY: if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) { gnome_canvas_window_to_world (canvas, - event->button.x, - event->button.y, &x, &y); + event->motion.x, + event->motion.y, &x, &y); gl_label_object_set_position (GL_LABEL_OBJECT(object), MIN (x, x0), MIN (y, y0)); gl_debug (DEBUG_VIEW, "BUTTON_MOTION (%f, %f) -> (%f, %f)", event->button.x, event->button.y, x, y); diff --git a/glabels2/src/view-ellipse.c b/glabels2/src/view-ellipse.c index b21c646f..fe6100a3 100644 --- a/glabels2/src/view-ellipse.c +++ b/glabels2/src/view-ellipse.c @@ -686,8 +686,8 @@ gl_view_ellipse_create_event_handler (GnomeCanvas *canvas, case GDK_MOTION_NOTIFY: if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) { gnome_canvas_window_to_world (canvas, - event->button.x, - event->button.y, &x, &y); + event->motion.x, + event->motion.y, &x, &y); gl_label_object_set_position (GL_LABEL_OBJECT(object), MIN (x, x0), MIN (y, y0)); w = MAX (x, x0) - MIN (x, x0); diff --git a/glabels2/src/view-highlight.c b/glabels2/src/view-highlight.c index 5c148b72..64a4df80 100644 --- a/glabels2/src/view-highlight.c +++ b/glabels2/src/view-highlight.c @@ -746,10 +746,10 @@ tl_resize_event_handler (GnomeCanvasItem * handle_item, case GDK_MOTION_NOTIFY: if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) { - x = MIN (event->button.x, x2 - MIN_ITEM_SIZE); - y = MIN (event->button.y, y2 - MIN_ITEM_SIZE); - w = MAX (x2 - event->button.x, MIN_ITEM_SIZE); - h = MAX (y2 - event->button.y, MIN_ITEM_SIZE); + x = MIN (event->motion.x, x2 - MIN_ITEM_SIZE); + y = MIN (event->motion.y, y2 - MIN_ITEM_SIZE); + w = MAX (x2 - event->motion.x, MIN_ITEM_SIZE); + h = MAX (y2 - event->motion.y, MIN_ITEM_SIZE); gl_label_object_set_position (object, x, y); gl_label_object_set_size (object, w, h); return TRUE; @@ -843,9 +843,9 @@ tr_resize_event_handler (GnomeCanvasItem * handle_item, case GDK_MOTION_NOTIFY: if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) { x = x1; - y = MIN (event->button.y, y2 - MIN_ITEM_SIZE); - w = MAX (event->button.x - x1, MIN_ITEM_SIZE); - h = MAX (y2 - event->button.y, MIN_ITEM_SIZE); + y = MIN (event->motion.y, y2 - MIN_ITEM_SIZE); + w = MAX (event->motion.x - x1, MIN_ITEM_SIZE); + h = MAX (y2 - event->motion.y, MIN_ITEM_SIZE); gl_label_object_set_position (object, x, y); gl_label_object_set_size (object, w, h); return TRUE; @@ -938,10 +938,10 @@ bl_resize_event_handler (GnomeCanvasItem * handle_item, case GDK_MOTION_NOTIFY: if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) { - x = MIN (event->button.x, x2 - MIN_ITEM_SIZE); + x = MIN (event->motion.x, x2 - MIN_ITEM_SIZE); y = y1; - w = MAX (x2 - event->button.x, MIN_ITEM_SIZE); - h = MAX (event->button.y - y1, MIN_ITEM_SIZE); + w = MAX (x2 - event->motion.x, MIN_ITEM_SIZE); + h = MAX (event->motion.y - y1, MIN_ITEM_SIZE); gl_label_object_set_position (object, x, y); gl_label_object_set_size (object, w, h); return TRUE; @@ -1036,8 +1036,8 @@ br_resize_event_handler (GnomeCanvasItem * handle_item, if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) { x = x1; y = y1; - w = MAX (event->button.x - x1, MIN_ITEM_SIZE); - h = MAX (event->button.y - y1, MIN_ITEM_SIZE); + w = MAX (event->motion.x - x1, MIN_ITEM_SIZE); + h = MAX (event->motion.y - y1, MIN_ITEM_SIZE); gl_label_object_set_position (object, x, y); gl_label_object_set_size (object, w, h); return TRUE; @@ -1127,8 +1127,8 @@ sl_resize_event_handler (GnomeCanvasItem * handle_item, case GDK_MOTION_NOTIFY: if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) { - x = MIN (event->button.x, x2 - MIN_ITEM_SIZE); - w = MAX (x2 - event->button.x, MIN_ITEM_SIZE); + x = MIN (event->motion.x, x2 - MIN_ITEM_SIZE); + w = MAX (x2 - event->motion.x, MIN_ITEM_SIZE); gl_label_object_set_position (object, x, y); gl_label_object_set_size (object, w, h); return TRUE; @@ -1219,7 +1219,7 @@ sr_resize_event_handler (GnomeCanvasItem * handle_item, case GDK_MOTION_NOTIFY: if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) { x = x1; - w = MAX (event->button.x - x1, MIN_ITEM_SIZE); + w = MAX (event->motion.x - x1, MIN_ITEM_SIZE); gl_label_object_set_position (object, x, y); gl_label_object_set_size (object, w, h); return TRUE; @@ -1309,8 +1309,8 @@ st_resize_event_handler (GnomeCanvasItem * handle_item, case GDK_MOTION_NOTIFY: if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) { - y = MIN (event->button.y, y2 - MIN_ITEM_SIZE); - h = MAX (y2 - event->button.y, MIN_ITEM_SIZE); + y = MIN (event->motion.y, y2 - MIN_ITEM_SIZE); + h = MAX (y2 - event->motion.y, MIN_ITEM_SIZE); gl_label_object_set_position (object, x, y); gl_label_object_set_size (object, w, h); return TRUE; @@ -1401,7 +1401,7 @@ sb_resize_event_handler (GnomeCanvasItem * handle_item, case GDK_MOTION_NOTIFY: if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) { y = y1; - h = MAX (event->button.y - y1, MIN_ITEM_SIZE); + h = MAX (event->motion.y - y1, MIN_ITEM_SIZE); gl_label_object_set_position (object, x, y); gl_label_object_set_size (object, w, h); return TRUE; @@ -1496,8 +1496,8 @@ p1_resize_event_handler (GnomeCanvasItem * handle_item, if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) { x = x0; y = y0; - dx = (event->button.x - x0); - dy = (event->button.y - y0); + dx = (event->motion.x - x0); + dy = (event->motion.y - y0); gl_label_object_set_position (object, x, y); gl_label_object_set_size (object, dx, dy); return TRUE; @@ -1592,8 +1592,8 @@ p2_resize_event_handler (GnomeCanvasItem * handle_item, if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) { x = x0; y = y0; - dx = (event->button.x - x0); - dy = (event->button.y - y0); + dx = (event->motion.x - x0); + dy = (event->motion.y - y0); gl_label_object_set_position (object, x, y); gl_label_object_set_size (object, dx, dy); return TRUE; diff --git a/glabels2/src/view-image.c b/glabels2/src/view-image.c index a00db395..a9c8741f 100644 --- a/glabels2/src/view-image.c +++ b/glabels2/src/view-image.c @@ -665,8 +665,8 @@ gl_view_image_create_event_handler (GnomeCanvas *canvas, case GDK_MOTION_NOTIFY: if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) { gnome_canvas_window_to_world (canvas, - event->button.x, - event->button.y, &x, &y); + event->motion.x, + event->motion.y, &x, &y); gl_label_object_set_position (GL_LABEL_OBJECT(object), MIN (x, x0), MIN (y, y0)); w = MAX (x, x0) - MIN (x, x0); diff --git a/glabels2/src/view-line.c b/glabels2/src/view-line.c index 27dc8003..511f6c99 100644 --- a/glabels2/src/view-line.c +++ b/glabels2/src/view-line.c @@ -634,8 +634,8 @@ gl_view_line_create_event_handler (GnomeCanvas *canvas, case GDK_MOTION_NOTIFY: if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) { gnome_canvas_window_to_world (canvas, - event->button.x, - event->button.y, &x, &y); + event->motion.x, + event->motion.y, &x, &y); w = x - x0; h = y - y0; gl_label_object_set_size (GL_LABEL_OBJECT(object), diff --git a/glabels2/src/view-text.c b/glabels2/src/view-text.c index 228f0c76..f38c4ae3 100644 --- a/glabels2/src/view-text.c +++ b/glabels2/src/view-text.c @@ -638,8 +638,8 @@ gl_view_text_create_event_handler (GnomeCanvas *canvas, gl_debug (DEBUG_VIEW, "MOTION_NOTIFY"); if (dragging && (event->motion.state & GDK_BUTTON1_MASK)) { gnome_canvas_window_to_world (canvas, - event->button.x, - event->button.y, &x, &y); + event->motion.x, + event->motion.y, &x, &y); gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); return TRUE;