Exemplo n.º 1
0
 // Methods
 public MouseArea()
 {
     this.components = null;
     this.picturePanel = null;
     this.startPoint = PointF.Empty;
     this.defaultCursor = Cursors.Default;
     this.shiftDown = false;
     //			this.filename = string.Empty;
     //			this.selectPath = new GraphicsPath();
     this.graphCenterPoint = PointF.Empty;
     this.currentOperation = ToolOperation.None;
     //			this.undostack = new UndoStack();
     this.oldPoint = Point.Empty;
     this.hori = false;
     this.oldindex = 0;
     this.mousedown = false;
     this.win32 = new Win32();
     this.lineOperation = null;
     this.SelectOperation = null;
     this.DrawOperation = null;
     this.ViewOperation = null;
     this.ColorOperation = null;
     this.BezierOperation = null;
     this.IsDrawing = false;
     this.TextOperation = null;
     this.editingOperation = null;
     this.polyOperation = null;
     this.FlipOperation = null;
     this.SubOperation = null;
     this.InitializeComponent();
     base.SetStyle(ControlStyles.DoubleBuffer | (ControlStyles.AllPaintingInWmPaint | (ControlStyles.SupportsTransparentBackColor | (ControlStyles.Selectable | ControlStyles.UserPaint))), true);
     this.CreateMenus();
 }
Exemplo n.º 2
0
        public PrintSetupDialog(ItopVector.DrawArea.DrawArea vcontrol)
        {
            this.vectorcontrol = vcontrol;

            InitializeComponent();

            this.printerSetup1.PageSettings = vcontrol.PageSettings.Clone() as PageSettings;
            this.paperSetup1.PageSettings = this.printerSetup1.PageSettings;
        }
Exemplo n.º 3
0
        public PrintSetupDialog(ItopVector.DrawArea.DrawArea vcontrol)
        {
            this.vectorcontrol = vcontrol;

            InitializeComponent();

            this.printerSetup1.PageSettings = vcontrol.PageSettings.Clone() as PageSettings;
            this.paperSetup1.PageSettings   = this.printerSetup1.PageSettings;
        }
Exemplo n.º 4
0
 // Methods
 public ExportImageDialog(ItopVector.DrawArea.DrawArea vectorcontrol)
 {
     this.components = null;
     this.savefiledlg1 = new SaveFileDialog();
     this.vectorcontrol = null;
     this.startPoint = Point.Empty;
     this.pos = Point.Empty;
     this.contectBounds = RectangleF.Empty;
     this.oriPoint = Point.Empty;
     this.InitializeComponent();
     base.SetStyle(ControlStyles.DoubleBuffer | (ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint), true);
     this.vectorcontrol = vectorcontrol;
     this.comboFormat.SelectedIndex = 0;
     this.panel1.Cursor = ItopVector.SpecialCursors.handCurosr;
 }
Exemplo n.º 5
0
 // Methods
 public ExportImageDialog(ItopVector.DrawArea.DrawArea vectorcontrol)
 {
     this.components    = null;
     this.savefiledlg1  = new SaveFileDialog();
     this.vectorcontrol = null;
     this.startPoint    = Point.Empty;
     this.pos           = Point.Empty;
     this.contectBounds = RectangleF.Empty;
     this.oriPoint      = Point.Empty;
     this.InitializeComponent();
     base.SetStyle(ControlStyles.DoubleBuffer | (ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint), true);
     this.vectorcontrol             = vectorcontrol;
     this.comboFormat.SelectedIndex = 0;
     this.panel1.Cursor             = ItopVector.SpecialCursors.handCurosr;
 }
Exemplo n.º 6
0
        // Methods
        public ExportSymbolDialog(ItopVector.DrawArea.DrawArea vectorcontrol, string filefilter)
        {
            this.firstload       = true;
            this.components      = null;
            this.vectorcontrol   = null;
            this.allSymbol       = null;
            this.allShape        = null;
            this.selectionSymbol = null;
            this.selectionShape  = null;
            this.document        = null;
            this.InitializeComponent();
            this.saveFileDialog1.Filter = "SVG文件(*.svg)|*.svg";
            if (filefilter.Trim().Length > 0)
            {
                this.saveFileDialog1.Filter = this.saveFileDialog1.Filter + "|" + filefilter;
            }
            this.vectorcontrol = vectorcontrol;

            this.symbolSelector = vectorcontrol.SymbolSelector;
            if (this.symbolSelector != null)
            {
                this.document = vectorcontrol.SymbolSelector.SymbolDoc;
            }
        }
Exemplo n.º 7
0
        // Methods
        public ExportSymbolDialog(ItopVector.DrawArea.DrawArea  vectorcontrol, string filefilter)
        {
            this.firstload = true;
            this.components = null;
            this.vectorcontrol = null;
            this.allSymbol = null;
            this.allShape = null;
            this.selectionSymbol = null;
            this.selectionShape = null;
            this.document = null;
            this.InitializeComponent();
            this.saveFileDialog1.Filter = "SVG�ļ�(*.svg)|*.svg";
            if (filefilter.Trim().Length > 0)
            {
                this.saveFileDialog1.Filter = this.saveFileDialog1.Filter + "|" + filefilter;
            }
            this.vectorcontrol = vectorcontrol;

            this.symbolSelector = vectorcontrol.SymbolSelector;
            if(this.symbolSelector!=null)
            {
                this.document = vectorcontrol.SymbolSelector.SymbolDoc;
            }
        }
Exemplo n.º 8
0
        public void OnMouseUp(MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                return;
            }
            this.mouseAreaControl.PicturePanel.UpdateRule = true;
            if (this.mouseAreaControl.CurrentOperation == ToolOperation.Roam)
            {
                this.mouseAreaControl.PicturePanel.viewer.EndMove();
                Point point1 = new Point(e.X, e.Y);
                int   num1   = point1.X - this.startPoint.X;
                int   num2   = point1.Y - this.startPoint.Y;
                if (num1 == 0 && num2 == 0)
                {
                    return;
                }
                this.mouseAreaControl.PicturePanel.MovePicture(this.oldleft - num1, this.oldtop - num2, false);
                this.mouseAreaControl.PicturePanel.SetScrollDelta(-num1, -num2);
            }
            else
            {
                float scale = 1.2f;
                float num1  = 0;
                float num2  = 0;

                switch (this.mouseAreaControl.CurrentOperation)
                {
                case ToolOperation.IncreaseView:
                {
                    this.win32.hdc = this.win32.W32GetDC(this.mouseAreaControl.Handle);
                    this.win32.W32SetROP2(7);
                    this.win32.W32PolyDraw(this.reversePath);
                    this.reversePath.Reset();
                    this.win32.ReleaseDC();

                    PointF pf2      = new PointF((float)e.X, (float)e.Y);
                    float  single9  = Math.Min(this.startPoint.X, pf2.X);
                    float  single10 = Math.Min(this.startPoint.Y, pf2.Y);
                    float  single11 = Math.Max(this.startPoint.X, pf2.X);
                    float  single12 = Math.Max(this.startPoint.Y, pf2.Y);
                    PointF point3   = new PointF(this.mouseAreaControl.PicturePanel.Width / 2, this.mouseAreaControl.PicturePanel.Height / 2);
                    PointF point2   = new PointF((single9 + (single11 - single9) / 2), (single10 + (single12 - single10) / 2));

                    num1 = (point3.X - point2.X);
                    num2 = (point3.Y - point2.Y);
                    //this.mouseAreaControl.PicturePanel.GoLocation(point2.X, point2.Y);

                    this.mouseAreaControl.PicturePanel.MovePicture(this.oldleft - num1, this.oldtop - num2, false);
                    ////this.mouseAreaControl.PicturePanel.viewer.MovePic(num1, num2);
                    this.mouseAreaControl.PicturePanel.SetScrollDelta(-(int)num1, -(int)num2);

                    this.mouseAreaControl.PicturePanel.Update();

                    //}
                    float f1       = single11 - single9;
                    float f2       = single12 - single10;
                    float rectArea = Math.Abs((single11 - single9) * (single12 - single10));
                    float rectLen  = (this.mouseAreaControl.PicturePanel.Width - f1) < (this.mouseAreaControl.PicturePanel.Height - f2) ? f1 : f2;
                    if (rectArea <= 10)
                    {
                        scale = 1.2f;
                    }
                    else
                    {
                        if (rectLen == f1)
                        {
                            scale = (this.mouseAreaControl.PicturePanel.Width - 200) / f1;
                        }
                        else if (rectLen == f2)
                        {
                            scale = (this.mouseAreaControl.PicturePanel.Height - 160) / f2;
                        }
                    }
                    if (e.Button == MouseButtons.Left)
                    {
                        goto Label_IncreaseView;
                    }
                    break;
                }

                case ToolOperation.DecreaseView:
                {
                    if (e.Button == MouseButtons.Left)
                    {
                        goto Label_DecreaseView;
                    }
                    break;
                }
                }
                goto Label_Root;
Label_IncreaseView:
                ItopVector.DrawArea.DrawArea area1 = this.mouseAreaControl.PicturePanel;
                area1.ScaleUnit *= scale;
                goto Label_Root;
Label_DecreaseView:
                ItopVector.DrawArea.DrawArea area2 = this.mouseAreaControl.PicturePanel;
                area2.ScaleUnit *= 0.9f;
Label_Root:
                return;
            }
        }