Выбрать главу

                  current.Show(graphic, clearPen, clearBrush)

                  current.Move(-20,0);

                  current.Show(graphic, pen, brush);

              }

              private void menuItem20_Click(object sender, System.EventArgs e)

              {

                   moveRight ();

              }

              void moveRight()

              {

                    //Move right

                     current.Show(graphic, clearPen, clearBrush)

                     current.Move(20,0);

                     current.Show(graphic, pen, brush);

              }

              private void menuItem21_Click(object sender, System.EventArgs e)

              {

                    moveTop ();

              }

              void moveTop()

              {

                    //Move top

                    current.Show(graphic, clearPen, clearBrush)

                    current.Move(0,-20);

                    current.Show(graphic, pen, brush);

              }

              private void menuItem22_Click(object sender, System.EventArgs e)

              {

                    moveDown ();

              }

              void moveDown()

              {

                    //Move down

                    current.Show(graphic, clearPen, clearBrush)

                    current.Move(0, 20);

                    current.Show(graphic, pen, brush);

              }

              private void menuItem23_Click(object sender, System.EventArgs e)

              {

                    //choose color

                    ColorDialog dialog = new ColorDialog();

                    if (dialog.ShowDialog() ==DialogResult.OK) color =dialog.Color;

                    pen = new Pen (color); brush = new SolidBrush(color);

              }

              private void menuItem24_Click(object sender, System.EventArgs e)

              {

                    //Red color

                    color =Color.Red;

                    pen = new Pen(color); brush = new SolidBrush(color);

              }

              private void menuItem25_Click(object sender, System.EventArgs e)

              {

                    //Green color

                    color =Color.Green;

                    pen = new Pen(color); brush = new SolidBrush(color);

              }

              private void menuItem26_Click(object sender, System.EventArgs e)

              {

                    //Blue color

                    color =Color.Blue;

                    pen = new Pen(color); brush = new SolidBrush(color);

              }

              private void menuItem27_Click(object sender, System.EventArgs e)

              {

                    //Black color

                    color =Color.Black;

                    pen = new Pen (color); brush = new SolidBrush(color);

              }

              private void menuItem28_Click(object sender, System.EventArgs e)

              {

                    //Gold color

                    color =Color.Gold;

                    pen = new Pen(color); brush = new SolidBrush(color);

              }

              private void menuItem29_Click(object sender, System.EventArgs e)

              {

                    //put_left: добавление фигуры в список

                    listFigure.put_left(current);

              }

              private void menuItem30_Click(object sender, System.EventArgs e)

              {

                    //put_right: добавление фигуры в список

                    listFigure.put_right(current);

              }

              private void menuItem31_Click(object sender, System.EventArgs e)

              {

                   //remove: удаление фигуры из списка

                   if(!listFigure.empty()) listFigure.remove ();

              }

              private void menuItem32_Click (object sender, System.EventArgs e)

              {

                    goPrev();

              }

              void goPrev()

              {

                    //go_prev: передвинуть курсор влево

                    if(!(listFigure.Index == 1))

                    {

                         listFigure.go_prev();

                         current = listFigure.item();

                     }

               }

               private void menuItem33_Click(object sender, System.EventArgs e)

               {

                      goNext();

               }

               void goNext()

               {

                     //go_next: передвинуть курсор вправо

                     if(!(listFigure.Index == listFigure.Count))

                     {

                          listFigure.go_next();

                          current = listFigure.item();

                     }

               }

               private void menuItem34_Click(object sender, System.EventArgs e)

               {