Главная Случайная страница Контакты | Мы поможем в написании вашей работы! | ||
|
lineto(x+faset, y+faset); // скос кнопки
moveto(x+width,y);
lineto(x+width-faset, y+faset); // скос кнопки
moveto(x,y +height);
lineto(x+faset, y+height-faset); // скос кнопки
moveto(x+width,y +height);
lineto(x+width-faset, y+height-faset); // скос кнопки
setfillstyle(1, DARKGRAY); // цвет заливки темно- серый
floodfill(x+width-3,y+10,WHITE); // заполнить замкнутую фигуру темно-серым цветом,
// очертить границу фигуры белым цветом
floodfill(x+10,y+height-3,WHITE);
}
class Button1:public Button // производный класс – кнопка с номером
{
public:
Button1(int xi, int yi): Button(xi,yi) { draw("1");}
Void virtual action ();
Int selected (char c);
};
void Button1:: action () // функция обработки нажатия на кнопку
{
bar (10,100,150,110); // заполняет цветом заливки область, не обводя ее,
// используется, чтобы стереть предыдущую надпись
outtextxy(10,100,"Pressed button 1"); // выводится надпись
}
int Button1::selected (char c)
{return (c= ='1');}
class Button2:public Button {
public:
Button2(int xi, int yi): Button(xi,yi) { draw("2");}
Void action ();
Int selected (char c);
};
void Button2::action ()
{bar (10,100,150,110);
outtextxy(10,100,"Pressed button 2"); }
int Button2::selected (char c)
{return((c=='2')?1:0);}
class Button3:public Button {
public:
Button3(int xi, int yi): Button(xi,yi) { draw("3");}
Void action ();
Дата публикования: 2014-11-28; Прочитано: 247 | Нарушение авторского права страницы | Мы поможем в написании вашей работы!