Пример #1
0
        private void OnButtonPressEvent(object o, ButtonPressEventArgs args)
        {
            if (!CanResize)
            {
                return;
            }

            int x_root = (int)args.Event.XRoot;
            int y_root = (int)args.Event.YRoot;

            int x, y;

            TranslatePosition(args.Event.Window, args.Event.X, args.Event.Y, out x, out y);
            UpdateCursor(x, y, true);

            if (resizing && args.Event.Button == 1)
            {
                window.BeginResizeDrag(last_edge, 1, x_root, y_root, args.Event.Time);
            }
            else if ((resizing && args.Event.Button == 2) ||
                     (args.Event.Button == 1 && y <= TopMoveHeight))
            {
                window.BeginMoveDrag((int)args.Event.Button, x_root, y_root, args.Event.Time);
            }
        }