Ejemplo n.º 1
0
        private void PictureBox1_MouseUp(object sender, MouseEventArgs e)
        {
            //ОТРИСОВКА ФИГУРЫ
            manipulator.Detach();
            if (currentTool != null)
            {
                currentTool.Create(x, e.X, y, e.Y).Draw(gr);
                figureList.Add(currentTool.Create(x, e.X, y, e.Y));
                currentTool = null;
            }

            //МОЙ SELECT
            else
            {
                fig = null;
                foreach (Figure f in figureList)
                {
                    if (f.Select(e.X, e.Y))
                    {
                        fig = f;
                        //Связываю манипулятор
                        manipulator.Attach(fig);
                    }
                }
                if (fig != null)
                {
                    //Прорверка на какой угол нажал
                    manipulator.Touch(e.X, e.Y);
                    toolStripStatusLabel1.Text = "Клацнул на: " + fig.ToString().Substring(6);
                }
            }
            //Обновляю полотно
            pictureBox1.Refresh();
            DrawAll(gr);
        }
Ejemplo n.º 2
0
 private void toolStripButton1_Click(object sender, EventArgs e)
 {
     //Квадрат
     currentTool = tools[1];
 }
Ejemplo n.º 3
0
 private void toolStripButton2_Click(object sender, EventArgs e)
 {
     //Треугольник
     currentTool = tools[2];
 }
Ejemplo n.º 4
0
 //Выбор пункта меню
 private void toolStripButton3_Click(object sender, EventArgs e)
 {
     //Круг
     currentTool = tools[0];
 }