Esempio n. 1
0
        private void picture_MouseClick(object sender, MouseEventArgs e)
        {
            if (creator != null)
            {
                if (creator.mouseClick)
                {
                    if (e.Button == MouseButtons.Left)
                    {
                        startPoint.X = e.X;
                        startPoint.Y = e.Y;

                        if (!drawing)
                        {
                            figyru = creator.GetFigyru(penThickness, penColor, fillColor);

                            points.Clear();
                            points.Add(startPoint);
                            points.Add(startPoint);
                            drawing = !drawing;
                        }
                        else
                        {
                            points.Add(startPoint);
                        }
                    }
                    else if (e.Button == MouseButtons.Right)
                    {
                        drawing = !drawing;
                        listFigure.Add(figyru);
                        figureStack.CleanStack();
                    }
                }
            }
        }
Esempio n. 2
0
        public Figyru Remove()
        {
            Figyru temp = figureList.Last();

            figureList.Remove(figureList.Last());
            return(temp);
        }
Esempio n. 3
0
        private void picture_MouseDown(object sender, MouseEventArgs e)
        {
            if (creator != null)
            {
                if (!drawing && !creator.mouseClick)
                {
                    figyru = creator.GetFigyru(penThickness, penColor, fillColor);

                    if (creator.corners)
                    {
                        (figyru as Polygon).numOfCorners = numOfCorners;
                    }

                    drawing      = !drawing;
                    startPoint.X = e.X;
                    startPoint.Y = e.Y;
                    points.Clear();
                    points.Add(startPoint);
                    points.Add(startPoint);
                }
            }
        }
Esempio n. 4
0
 public void Push(Figyru figyru)
 {
     figureStack.Push(figyru);
 }
Esempio n. 5
0
 public void Add(Figyru figyru)
 {
     figureList.Add(figyru);
 }