コード例 #1
0
ファイル: TextRegionCtrl.cs プロジェクト: radtek/epresenter
 protected override void OnMouseLeave(EventArgs e)
 {
     resizing = false;
     moving   = false;
     dragPos  = DragPos.None;
     base.OnMouseLeave(e);
 }
コード例 #2
0
        private void UserControlContainerResizable_MouseDown(object sender, MouseEventArgs e)
        {
            dragstart = Control.MousePosition;
            startpos  = Location;
            startsize = Size;
            dp        = DragType(e);
            dragmoved = false;
            //System.Diagnostics.Debug.WriteLine("Drag start here " + dp);

            ResizeStart?.Invoke(this);
        }
コード例 #3
0
        internal static DragPos_StructInternal ToInternal(DragPos _external_struct)
        {
            var _internal_struct = new DragPos_StructInternal();

            _internal_struct.Pos    = Eina.Position2D_StructConversion.ToInternal(_external_struct.Pos);
            _internal_struct.Action = _external_struct.Action;
            _internal_struct.Format = _external_struct.Format;
            _internal_struct.Item   = _external_struct.Item.NativeHandle;

            return(_internal_struct);
        }
コード例 #4
0
ファイル: TextRegionCtrl.cs プロジェクト: radtek/epresenter
 protected override void OnMouseDown(MouseEventArgs e)
 {
     rStart          = this.Bounds;
     ptLastMouseDown = this.PointToScreen(e.Location);
     if (e.X < 6)
     {
         if (e.Y < 6)
         {
             dragPos = DragPos.TopLeft;
         }
         else if (e.Y > this.ClientSize.Height - 6)
         {
             dragPos = DragPos.BottomLeft;
         }
         else
         {
             dragPos = DragPos.Left;
         }
     }
     else if (e.X > this.ClientSize.Width - 6)
     {
         if (e.Y < 6)
         {
             dragPos = DragPos.TopRight;
         }
         else if (e.Y > this.ClientSize.Height - 6)
         {
             dragPos = DragPos.BottomRight;
         }
         else
         {
             dragPos = DragPos.Right;
         }
     }
     else
     {
         if (e.Y < 6)
         {
             dragPos = DragPos.Top;
         }
         else if (e.Y > this.ClientSize.Height - 6)
         {
             dragPos = DragPos.Bottom;
         }
         else
         {
             dragPos = DragPos.Drag;
         }
     }
     resizing = dragPos != DragPos.Drag;
     moving   = dragPos == DragPos.Drag;
     base.OnMouseDown(e);
 }
コード例 #5
0
ファイル: TextRegionCtrl.cs プロジェクト: radtek/epresenter
        protected override void OnMouseUp(MouseEventArgs e)
        {
            resizing = false;
            moving   = false;
            dragPos  = DragPos.None;

            if (FinishedMove != null)
            {
                FinishedMove(this, null);
            }

            base.OnMouseUp(e);
        }
コード例 #6
0
        internal static DragPos ToManaged(DragPos_StructInternal _internal_struct)
        {
            var _external_struct = new DragPos();

            _external_struct.Pos    = Eina.Position2D_StructConversion.ToManaged(_internal_struct.Pos);
            _external_struct.Action = _internal_struct.Action;
            _external_struct.Format = _internal_struct.Format;

            _external_struct.Item = (Efl.Canvas.Object)System.Activator.CreateInstance(typeof(Efl.Canvas.Object), new System.Object[] { _internal_struct.Item });
            Efl.Eo.Globals.efl_ref(_internal_struct.Item);


            return(_external_struct);
        }
コード例 #7
0
        void StopDrag()
        {
            //System.Diagnostics.Debug.WriteLine("Stop drag " + dp + " " + dragmoved);
            if (dragmoved)
            {
                Cursor.Current = Cursors.Default;
            }

            if (dp != DragPos.None)
            {
                ResizeEnd?.Invoke(this, dragmoved);
            }

            dragmoved = false;
            dp        = DragPos.None;
        }