示例#1
0
 public ToolMoveFigure(Button button, PaintBox paintBox_set)
 {
     paintBox          = paintBox_set;
     cursor            = Cursors.Hand;
     toolButton        = button;
     toolButton.Click += new EventHandler(ToolButtonClick);
 }
示例#2
0
 public ToolSelection(Button button, ref List <Figure> figureArrayFrom, PaintBox paintBox_set)
 {
     paintBox          = paintBox_set;
     figureArray       = figureArrayFrom;
     toolButton        = button;
     toolButton.Click += new EventHandler(ToolButtonClick);
     panelProp         = new PanelProp();
     panelProp.Text    = "Selection";
 }
示例#3
0
 public ToolZoom(Button button, ref List <Figure> figureArrayFrom, PaintBox paintBox_set, NumericUpDown numZoomSet)
 {
     numZoom           = numZoomSet;
     paintBox          = paintBox_set;
     figureArray       = figureArrayFrom;
     toolButton        = button;
     toolButton.Click += new EventHandler(ToolButtonClick);
     CreatePanelProp();
 }
示例#4
0
 public static void Init(Button btnUndo, Button btnRedo, PaintBox paintBox, ref List <Figure> figureArray, MainDrawForm form)
 {
     _btnUndo        = btnUndo;
     _btnUndo.Click += Undo;
     _btnRedo        = btnRedo;
     _btnRedo.Click += Redo;
     _paintBox       = paintBox;
     _figureArray    = figureArray;
     _form           = form;
     ringBuffer.Push(SerializerFigure.SerializeAllFigures(ref _figureArray));
 }
示例#5
0
 public ToolLine(Button button, ref List <Figure> figureArrayFrom, PaintBox paintBox_set)
 {
     paintBox          = paintBox_set;
     figureArray       = figureArrayFrom;
     toolButton        = button;
     toolButton.Click += new EventHandler(ToolButtonClick);
     panelProp         = new PanelProp();
     panelProp.Text    = "Line";
     propColor         = new PropColor(Color.Black);
     propColor.Draw(new Point(5, 20), panelProp, "Color:");
     propPenWidth = new PropPenWidth();
     propPenWidth.Draw(new Point(5, 50), panelProp, "Width:");
 }
示例#6
0
 public override void Draw(Point position, PanelProp panelProp, String text, PaintBox paintBox = null)
 {
     colorButton.SetButtonColor(colorButton.color);
     this.paintBox      = paintBox;
     colorButton.Click += ValChanged;
     if (text == null)
     {
         text = "Color:";
     }
     colorButton.Location = new Point(position.X + 60, position.Y);
     panelProp.Controls.Add(colorButton);
     label = new Label {
         Location = position,
         Text     = text
     };
     panelProp.Controls.Add(label);
 }
示例#7
0
 public ToolRoundedRect(Button button, ref List <Figure> figureArrayFrom, PaintBox paintBox_set)
 {
     paintBox          = paintBox_set;
     figureArray       = figureArrayFrom;
     toolButton        = button;
     toolButton.Click += new EventHandler(ToolButtonClick);
     panelProp         = new PanelProp();
     panelProp.Text    = "Rounded Rect";
     propColor         = new PropColor(Color.Black);
     propColor.Draw(new Point(5, 20), panelProp, "Color:");
     propPenWidth = new PropPenWidth();
     propPenWidth.Draw(new Point(5, 50), panelProp, "Width:");
     propFill = new PropFill(Color.Black);
     propFill.Draw(new Point(5, 80), panelProp, "Fill:");
     propRadius = new PropRadius(25);
     propRadius.Draw(new Point(5, 140), panelProp, "Radius:");
 }
示例#8
0
 public override void Draw(Point position, PanelProp panelProp, String text, PaintBox paintBox = null)
 {
     this.paintBox = paintBox;
     if (text == null)
     {
         text = "Radius:";
     }
     numeric.Location      = new Point(position.X + 60, position.Y);
     numeric.Size          = new Size(48, 26);
     numeric.ValueChanged += ValChanged;
     panelProp.Controls.Add(numeric);
     label = new Label {
         Location = position,
         Text     = text
     };
     panelProp.Controls.Add(label);
 }
示例#9
0
 public override void Draw(Point position, PanelProp panelProp, String text, PaintBox paintBox = null)
 {
     numWidthPen.Value         = (decimal)numWidthPen.penWidth;
     this.paintBox             = paintBox;
     numWidthPen.ValueChanged += ValChanged;
     if (text == null)
     {
         text = "Width:";
     }
     numWidthPen.Location = new Point(position.X + 60, position.Y);
     numWidthPen.Size     = new Size(48, 26);
     panelProp.Controls.Add(numWidthPen);
     label = new Label {
         Location = position,
         Text     = text
     };
     panelProp.Controls.Add(label);
 }
示例#10
0
 public override void Draw(Point position, PanelProp panelProp, String text, PaintBox paintBox = null)
 {
     this.paintBox = paintBox;
     if (text == null)
     {
         text = "Fill:";
     }
     checkBox.Click += ValChanged;
     propColor.colorButton.Click += ValChanged;
     checkBox.Location            = new Point(position.X + 60, position.Y);
     checkBox.Size = new Size(48, 26);
     checkBox.Text = "";
     panelProp.Controls.Add(checkBox);
     label = new Label {
         Location = position,
         Text     = text
     };
     panelProp.Controls.Add(label);
     propColor.Draw(new Point(position.X, position.Y + 25), panelProp, "Clr fill:");
 }
示例#11
0
 public virtual void Draw(Point position, PanelProp panelProp, String text = null, PaintBox paintBox = null)
 {
 }