Esempio n. 1
0
        private void Form_MouseUp(object sender, MouseEventArgs e)
        {
            GetCursorPosition();
            switch (_action.action)
            {
            case eAction.OnMove:
                _action.ClearLastRectangle();
                //Action.DrawMove(pt);
                _action.DrawLastMove();
                _action.action = eAction.None;
                if (debug)
                {
                    Debug.WriteLine("Form_MouseUp onmove");
                }
                break;

            case eAction.OnResize:
                /*
                 * Action.ClearLastRectangle();
                 * Action.DrawLastResize(pt);
                 * Action.action = eAction.None;
                 */
                if (debug)
                {
                    Debug.WriteLine("Form_MouseUp onresize");
                }
                _action.action = eAction.None;
                break;
            }
        }
Esempio n. 2
0
        public UIDesignTableClass(Control frm, string name, bool show = true, int x = 50, int y = 50)
        {
            Location = new Point(x, y);
            Name     = name;
            _action  = new ActionClass {
                parent = frm
            };
            _action.SetAbsoluteOffset(_absoluteOffset);

            _action.action   = eAction.None;
            PForm            = frm;
            PForm.MouseMove += Form_MouseMove;
            PForm.MouseUp   += Form_MouseUp;

            InitializeComponent();
            _pnlTableBottomRight.MouseUp    += Form_MouseUp;
            _pnlTableBottomRight.MouseMove  += Table_MouseMove;
            _pnlTableBottomRight.MouseClick += PnlTableBottom_MouseClick;
            _pnlTableBottomRight.MouseDown  += PnlTableBottom_MouseDown;
            _action.hotspot   = _pnlTableBottomRight;
            _action.mainctrl  = _gbTable;
            _tsmiMinimize.Tag = eTableType.Autosize;
            _gbTable.Left     = x;
            _gbTable.Top      = y;
            _gbTable.Text     = "";
            _txtCaption.Text  = name;

            _action.last_local_position   = _gbTable.Location;
            _action.last_local_dimensions = _gbTable.Size;
            _action.DrawLastMove();

            if (show)
            {
                _action.Show();
            }
            else
            {
                _action.Hide();
            }
            _pnlTableBottom.Height = 14;
            _gbTable.Refresh();
        }