Ejemplo n.º 1
0
 public override void HidePanelProp()
 {
     paintBox.Invalidate();
     panelProp.Visible = false;
     panelProp         = new PanelProp();
     panelProp.Text    = "Selection";
 }
Ejemplo n.º 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";
 }
Ejemplo n.º 3
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:");
 }
Ejemplo n.º 4
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);
 }
Ejemplo n.º 5
0
 private void CreatePanelProp()
 {
     panelProp          = new PanelProp();
     panelProp.Text     = "Zoom";
     stepZoom           = new NumericUpDown();
     stepZoom.Location  = new Point(65, 15);
     stepZoom.Size      = new Size(48, 24);
     stepZoom.Minimum   = new decimal(new int[] { 1, 0, 0, 0 });
     stepZoom.Maximum   = new decimal(new int[] { 100, 0, 0, 0 });
     stepZoom.Value     = new decimal(new int[] { 20, 0, 0, 0 });
     stepZoom.Increment = 10;
     panelProp.Controls.Add(stepZoom);
     labelStepZoom          = new Label();
     labelStepZoom.Location = new Point(5, 20);
     labelStepZoom.Text     = "Step:";
     panelProp.Controls.Add(labelStepZoom);
 }
Ejemplo n.º 6
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:");
 }
Ejemplo n.º 7
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);
 }
Ejemplo n.º 8
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);
 }
Ejemplo n.º 9
0
        void DrawPanel()
        {
            int offset = 0;

            intersectProps    = new Dictionary <string, Prop>(5);
            panelProp.Visible = false;
            panelProp         = new PanelProp();
            panelProp.Visible = true;
            panelProp.Text    = "Selection";
            if (figureSelectionArray != null)
            {
                foreach (Figure primitiv in figureSelectionArray)
                {
                    foreach (var prop in primitiv.propArray)
                    {
                        if (figureSelectionArray[0].propArray.ContainsKey(prop.Key))
                        {
                            if (!intersectProps.ContainsKey(prop.Key))
                            {
                                intersectProps.Add(prop.Key, prop.Value);
                            }
                        }
                        else
                        {
                            intersectProps.Remove(prop.Key);
                        }
                    }
                }
                foreach (var prop in intersectProps)
                {
                    prop.Value.Draw(new Point(5, 20 + offset), panelProp, null, paintBox);
                    prop.Value.changeAll = changeAll;
                    if (prop.Value.GetType() == typeof(PropFill))
                    {
                        offset += 50;
                    }
                    else
                    {
                        offset += 30;
                    }
                }
            }
        }
Ejemplo n.º 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:");
 }
Ejemplo n.º 11
0
 public virtual void Draw(Point position, PanelProp panelProp, String text = null, PaintBox paintBox = null)
 {
 }