}
void incScale ()
{
//Increase scale
current.Show(graphic, clearPen, clearBrush)
current.Scale (1.5);
current.Show(graphic, pen, brush);
}
private void menuItem18_Click(object sender, System.EventArgs e)
{
decScale ();
}
void decScale()
{
//Decrease scale
current.Show(graphic, clearPen, clearBrush)
current.Scale(2.0/3);
current.Show(graphic, pen, brush);
}
private void menuItem19_Click(object sender, System.EventArgs e)
{
moveLeft ();
}
void moveLeft()
{
//Move left
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)
{
//go_first
listFigure.start();
if(!listFigure.empty())
current = listFigure.item();
}
private void menuItem35_Click(object sender, System.EventArgs e)
{
//go_last
listFigure.finish();
if(!listFigure.empty())
current = listFigure.item();
}
private void menuItem15_Click(object sender, System.EventArgs e)
{
showList ();
}
void showList ()
{
//Show List
listFigure.start();
while(listFigure.Index <= listFigure.Count)
{
current = listFigure.item();
current.Show(graphic,pen,brush);
listFigure.go_next();
}
listFigure.finish ();
}
private void menuItem16_Click(object sender,
System.EventArgs e)
{
clearList ();
}
void clearList ()
{
//Clear List