示例#1
0
 private void OnElementMouseDown(ElementMouseEventArgs e)
 {
     if (ElementMouseDown != null)
     {
         ElementMouseDown(this, e);
     }
 }
示例#2
0
 private void OnElementMouseUp(ElementMouseEventArgs e)
 {
     if (ElementMouseUp != null)
     {
         ElementMouseUp(this, e);
     }
 }
示例#3
0
 protected virtual void OnElementMouseUp(ElementMouseEventArgs e)
 {
     if (ElementMouseUp != null)
     {
         ElementMouseUp(this, e);
     }
 }
示例#4
0
        protected override void OnMouseDoubleClick(MouseEventArgs e)
        {
            if (SelectedElement == null)
            {
                return;
            }
            var eventClickArg = new ElementEventArgs(SelectedElement);

            OnElementDoubleClick(eventClickArg);

            if (_moveAction == null)
            {
                return;
            }
            _moveAction.End();
            _moveAction = null;

            var eventMouseUpArg = new ElementMouseEventArgs(SelectedElement, e.X, e.Y);

            OnElementMouseUp(eventMouseUpArg);

            if (Changed)
            {
                AddUndo();
            }

            RestartInitValues();
            base.Invalidate();
            base.OnMouseUp(e);
        }
示例#5
0
        protected override void OnMouseUp(MouseEventArgs e)
        {
            var selectionRectangle = _selectionArea.GetUnsignedRectangle();

            if ((_moveAction != null) && _moveAction.IsMoving)
            {
                var eventClickArg = new ElementEventArgs(_selectedElement);
                OnElementClick(eventClickArg);

                _moveAction.End();
                _moveAction = null;

                var eventMouseUpArg = new ElementMouseEventArgs(_selectedElement, e.X, e.Y);
                OnElementMouseUp(eventMouseUpArg);

                if (_changed)
                {
                    AddUndo();
                }
            }

            // Select
            if (_isMultiSelection)
            {
                EndSelectElements(selectionRectangle);
            }
            // Add element
            else if (_isAddSelection)
            {
                EndAddElement(selectionRectangle);
            }

            // Add link
            else if (_isAddLink)
            {
                EndAddLink();
                AddUndo();
            }

            // Resize
            if (_resizeAction != null)
            {
                if (_resizeAction.IsResizing)
                {
                    var mousePoint = Gsc2Goc(new Point(e.X, e.Y));
                    _resizeAction.End(mousePoint);

                    AddUndo();
                }
                _resizeAction.UpdateResizeCorner();
            }

            RestartInitValues();

            base.Invalidate();

            base.OnMouseUp(e);
        }
示例#6
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            Point mousePoint;

            //ShowSelectionCorner((document.Action==DesignerAction.Select));

            switch (Document.Action)
            {
            // SELECT
            case DesignerAction.Connect:
            case DesignerAction.Select:
                if (e.Button == MouseButtons.Left)
                {
                    mousePoint = Gsc2Goc(new Point(e.X, e.Y));

                    //Verify resize action
                    StartResizeElement(mousePoint);
                    if ((_resizeAction != null) && _resizeAction.IsResizing)
                    {
                        break;
                    }

                    //Verify LabelElement editing
                    if (_isEditLabel)
                    {
                        EndEditLabel();
                    }

                    // Search element by click
                    _selectedElement = Document.FindElement(mousePoint);

                    if (_selectedElement != null)
                    {
                        //Events
                        var eventMouseDownArg = new ElementMouseEventArgs(_selectedElement, e.X, e.Y);
                        OnElementMouseDown(eventMouseDownArg);

                        // Double-click to edit Label
                        if ((e.Clicks == 2) && _selectedElement is ILabelElement)
                        {
                            StartEditLabel();
                            break;
                        }

                        // Element selected
                        if (_selectedElement is ConnectorElement)
                        {
                            StartAddLink((ConnectorElement)_selectedElement, mousePoint);
                            _selectedElement = null;
                        }
                        else
                        {
                            StartSelectElements(_selectedElement, mousePoint);
                        }
                    }
                    else
                    {
                        // If click is on neutral area, clear selection
                        Document.ClearSelection();
                        var p = Gsc2Goc(new Point(e.X, e.Y));
                        ;
                        _isMultiSelection       = true;
                        _selectionArea.Location = p;
                        _selectionArea.Size     = new Size(0, 0);
                    }
                    base.Invalidate();
                }
                break;

            // ADD
            case DesignerAction.Add:

                if (e.Button == MouseButtons.Left)
                {
                    mousePoint = Gsc2Goc(new Point(e.X, e.Y));
                    StartAddElement(mousePoint);
                }
                break;

            // DELETE
            case DesignerAction.Delete:
                if (e.Button == MouseButtons.Left)
                {
                    mousePoint = Gsc2Goc(new Point(e.X, e.Y));
                    DeleteElement(mousePoint);
                }
                break;
            }

            base.OnMouseDown(e);
        }
        private void EET_MouseClick(object eventSender, ElementMouseEventArgs args)
        {
            try
            {
                XTextTableElement d_table = (XTextTableElement)args.Element;
                try
                {
                    string d_name = d_table.ID;

                    if (d_name == "reportinfotable")
                    {

                    }
                    else if (d_name == "reportendtable")
                    {

                    }
                    else
                    {

                    }
                }
                catch { }
            }
            catch { }

        }