HeapScroller.OnButtonPressEvent C# (CSharp) Méthode

OnButtonPressEvent() protected méthode

protected OnButtonPressEvent ( Gdk args ) : bool
args Gdk
Résultat bool
    protected override bool OnButtonPressEvent(Gdk.EventButton args)
    {
        double x = args.X + Allocation.X;
                double y = args.Y + Allocation.Y;

        if (glass.IsInside (x, y))
            glass.StartDrag (x, y, args.Time);
        else {
            int x_new = (int) x - background.X;

            if (x_new < 0)
                x_new = 0;
            else if (x_new + glass.Width > background.Width)
                x_new = background.Width - glass.Width;

            glass.Position = x_new;

            ScrollChanged ();
        }

        return base.OnButtonPressEvent (args);
    }