Skip to content
This repository has been archived by the owner on Mar 7, 2018. It is now read-only.

Commit

Permalink
[Gtk] adjust mouse event positions
Browse files Browse the repository at this point in the history
the mouse coordinates in events emitted by
the Gtk.TreeView do not include the column headers
and have an offset to the frontend bounds.
  • Loading branch information
sevoku committed Jul 1, 2015
1 parent 3635640 commit 736864b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Xwt.Gtk/Xwt.GtkBackend/TableViewBackend.cs
Expand Up @@ -408,6 +408,33 @@ protected Gtk.TreePath GetPathAtPosition (Point p)
return null;
}

protected override ButtonEventArgs GetButtonPressEventArgs (ButtonPressEventArgs args)
{
int x, y;
Widget.ConvertBinWindowToWidgetCoords ((int)args.Event.X, (int)args.Event.Y, out x, out y);
var xwt_args = base.GetButtonPressEventArgs (args);
xwt_args.X = x;
xwt_args.Y = y;
return xwt_args;
}

protected override ButtonEventArgs GetButtonReleaseEventArgs (ButtonReleaseEventArgs args)
{
int x, y;
Widget.ConvertBinWindowToWidgetCoords ((int)args.Event.X, (int)args.Event.Y, out x, out y);
var xwt_args = base.GetButtonReleaseEventArgs (args);
xwt_args.X = x;
xwt_args.Y = y;
return xwt_args;
}

protected override MouseMovedEventArgs GetMouseMovedEventArgs (MotionNotifyEventArgs args)
{
int x, y;
Widget.ConvertBinWindowToWidgetCoords ((int)args.Event.X, (int)args.Event.Y, out x, out y);
return new MouseMovedEventArgs ((long) args.Event.Time, x, y);
}

public virtual void SetCurrentEventRow (string path)
{
}
Expand Down

0 comments on commit 736864b

Please sign in to comment.