Commit f0b9e701 authored by claes's avatar claes

Handling of pointer motion event improved

parent 5e0f481a
/* /*
* Proview $Id: flow_browwidget_gtk.cpp,v 1.5 2007-10-17 07:19:57 claes Exp $ * Proview $Id: flow_browwidget_gtk.cpp,v 1.6 2008-02-05 14:59:43 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -300,7 +300,7 @@ static void browwidgetgtk_realize( GtkWidget *widget) ...@@ -300,7 +300,7 @@ static void browwidgetgtk_realize( GtkWidget *widget)
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_KEY_PRESS_MASK | GDK_KEY_PRESS_MASK |
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_MOTION_MASK | GDK_BUTTON_MOTION_MASK |
GDK_ENTER_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
......
/* /*
* Proview $Id: flow_draw_gtk.cpp,v 1.9 2007-05-11 15:07:21 claes Exp $ * Proview $Id: flow_draw_gtk.cpp,v 1.10 2008-02-05 14:59:43 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -781,6 +781,14 @@ int FlowDrawGtk::event_handler( FlowCtx *ctx, GdkEvent event) ...@@ -781,6 +781,14 @@ int FlowDrawGtk::event_handler( FlowCtx *ctx, GdkEvent event)
} }
break; break;
case GDK_MOTION_NOTIFY: case GDK_MOTION_NOTIFY:
if ( event.motion.is_hint) {
int x, y;
gdk_window_get_pointer( event.any.window, &x, &y, NULL);
event.button.x = x;
event.button.y = y;
}
if ( button3_pressed) { if ( button3_pressed) {
button3_pressed = 0; button3_pressed = 0;
button_pressed = 0; button_pressed = 0;
...@@ -898,6 +906,14 @@ int FlowDrawGtk::event_handler( FlowCtx *ctx, GdkEvent event) ...@@ -898,6 +906,14 @@ int FlowDrawGtk::event_handler( FlowCtx *ctx, GdkEvent event)
sts = ctx->event_handler_nav( flow_eEvent_Exposure, 0, 0); sts = ctx->event_handler_nav( flow_eEvent_Exposure, 0, 0);
break; break;
case GDK_MOTION_NOTIFY: case GDK_MOTION_NOTIFY:
if ( event.motion.is_hint) {
int x, y;
gdk_window_get_pointer( event.any.window, &x, &y, NULL);
event.button.x = x;
event.button.y = y;
}
if ( button1_pressed || button2_pressed || button3_pressed) if ( button1_pressed || button2_pressed || button3_pressed)
sts = ctx->event_handler_nav( flow_eEvent_ButtonMotion, (int)event.button.x, (int)event.button.y); sts = ctx->event_handler_nav( flow_eEvent_ButtonMotion, (int)event.button.x, (int)event.button.y);
else else
......
/* /*
* Proview $Id: flow_widget_gtk.cpp,v 1.6 2007-11-22 09:02:10 claes Exp $ * Proview $Id: flow_widget_gtk.cpp,v 1.7 2008-02-05 14:59:43 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -292,7 +292,7 @@ static void flowwidgetgtk_realize( GtkWidget *widget) ...@@ -292,7 +292,7 @@ static void flowwidgetgtk_realize( GtkWidget *widget)
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_KEY_PRESS_MASK | GDK_KEY_PRESS_MASK |
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_MOTION_MASK | GDK_BUTTON_MOTION_MASK |
GDK_ENTER_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK; GDK_LEAVE_NOTIFY_MASK;
......
/* /*
* Proview $Id: glow_curvewidget_gtk.cpp,v 1.4 2007-11-22 09:02:10 claes Exp $ * Proview $Id: glow_curvewidget_gtk.cpp,v 1.5 2008-02-05 14:59:43 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -307,7 +307,7 @@ static void curvewidgetgtk_realize( GtkWidget *widget) ...@@ -307,7 +307,7 @@ static void curvewidgetgtk_realize( GtkWidget *widget)
GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_KEY_PRESS_MASK | GDK_KEY_PRESS_MASK |
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_MASK |
GDK_BUTTON_MOTION_MASK | GDK_BUTTON_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_ENTER_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK; GDK_LEAVE_NOTIFY_MASK;
attr.visual = gtk_widget_get_visual( widget); attr.visual = gtk_widget_get_visual( widget);
......
/* /*
* Proview $Id: glow_draw_gtk.cpp,v 1.10 2008-01-28 07:32:50 claes Exp $ * Proview $Id: glow_draw_gtk.cpp,v 1.11 2008-02-05 14:59:43 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -971,6 +971,14 @@ int GlowDrawGtk::event_handler( GdkEvent event) ...@@ -971,6 +971,14 @@ int GlowDrawGtk::event_handler( GdkEvent event)
case GDK_MOTION_NOTIFY: case GDK_MOTION_NOTIFY:
// printf( "-- Button1 motion event: (%d,%d)\n", event.button.x, // printf( "-- Button1 motion event: (%d,%d)\n", event.button.x,
// event.button.y); // event.button.y);
if ( event.motion.is_hint) {
int x, y;
gdk_window_get_pointer( event.any.window, &x, &y, NULL);
event.button.x = x;
event.button.y = y;
}
if ( button3_pressed) { if ( button3_pressed) {
button3_pressed = 0; button3_pressed = 0;
button_pressed = 0; button_pressed = 0;
...@@ -1097,6 +1105,14 @@ int GlowDrawGtk::event_handler( GdkEvent event) ...@@ -1097,6 +1105,14 @@ int GlowDrawGtk::event_handler( GdkEvent event)
case GDK_MOTION_NOTIFY: case GDK_MOTION_NOTIFY:
// printf( "-- Button1 motion event nav: (%d,%d)\n", event.button.x, // printf( "-- Button1 motion event nav: (%d,%d)\n", event.button.x,
// event.button.y); // event.button.y);
if ( event.motion.is_hint) {
int x, y;
gdk_window_get_pointer( event.any.window, &x, &y, NULL);
event.button.x = x;
event.button.y = y;
}
if ( button1_pressed || button2_pressed || button3_pressed) if ( button1_pressed || button2_pressed || button3_pressed)
ctx->event_handler_nav( glow_eEvent_ButtonMotion, (int)event.button.x, (int)event.button.y); ctx->event_handler_nav( glow_eEvent_ButtonMotion, (int)event.button.x, (int)event.button.y);
else else
...@@ -2513,7 +2529,7 @@ int GlowDrawGtk::print( char *filename, double x0, double x1, int end) ...@@ -2513,7 +2529,7 @@ int GlowDrawGtk::print( char *filename, double x0, double x1, int end)
if ( new_file) { if ( new_file) {
ps->fp << ps->fp <<
"%!PS-Adobe-2.0 EPSF-1.2" << endl << "%!PS-Adobe-2.0 EPSF-1.2" << endl <<
"%%Creator: Proview $Id: glow_draw_gtk.cpp,v 1.10 2008-01-28 07:32:50 claes Exp $ Glow" << endl << "%%Creator: Proview $Id: glow_draw_gtk.cpp,v 1.11 2008-02-05 14:59:43 claes Exp $ Glow" << endl <<
"%%EndComments" << endl << endl; "%%EndComments" << endl << endl;
} }
else else
......
/* /*
* Proview $Id: glow_growwidget_gtk.cpp,v 1.6 2007-11-22 09:02:10 claes Exp $ * Proview $Id: glow_growwidget_gtk.cpp,v 1.7 2008-02-05 14:59:43 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -339,7 +339,7 @@ static void growwidgetgtk_realize( GtkWidget *widget) ...@@ -339,7 +339,7 @@ static void growwidgetgtk_realize( GtkWidget *widget)
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_KEY_PRESS_MASK | GDK_KEY_PRESS_MASK |
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_MOTION_MASK | GDK_BUTTON_MOTION_MASK |
GDK_ENTER_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK; GDK_LEAVE_NOTIFY_MASK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment