Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > Delphi программирование > Паскаль, Turbo Pascal, PascalABC.NET
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 11.12.2010, 22:24   #1
Leshiy1
Форумчанин
 
Аватар для Leshiy1
 
Регистрация: 24.09.2009
Сообщений: 104
По умолчанию Прямоугольник_Т

Код:
Uses CRT, Graph;
 Type TFigure=Object
      x,y:Integer;
      color:Word;
      Constructor Init (ax,ay:Integer;  col:Word);
      Procedure Draw (col:Word); Virtual;
      Procedure Show;
      Procedure Hide;
      Procedure MoveTo (dx, dy:Integer);
 End;
 
 TPoint=Object(Tfigure)
        Procedure Draw (col:Word); Virtual;
 End;
 
 TEllipse=Object(TPoint)
         U1,U2,xr,yr:Integer;
         Constructor Init(ax,ay,axr,ayr,aU1,aU2:Integer;  col:Word);
         Procedure Draw (col:Word); Virtual;
 End;
 
         Constructor  TFigure.Init (ax, ay:Integer;  col:Word);
         Begin x:=ax; y:=ay; color:=col; End;
 
         Procedure TFigure.Draw(col:Word);
         Begin End;
 
         Procedure TFigure.Show;
         Begin Draw (Color); End;
 
         Procedure TFigure.Hide;
         Begin Draw (GetBkColor); End;
 
         Procedure TFigure.MoveTo (dx, dy:Integer);
         Begin Hide; x:=x+dx; y:=y+dy; Show; End;
 
         Procedure TPoint.Draw (col:Word);
         Begin PutPixel (x, y, col); End;
 
         Constructor TEllipse.Init;
         Begin Inherited Init (ax, ay, col); xr:=axr; yr:=ayr; U1:=aU1; U2:=aU2;  End;
 
         Procedure TEllipse.Draw(col:Word);
         Begin   SetColor (col); Ellipse  (x,y,U1,U2,xr,yr);  End;
 {Pryamougolnik}
 Type TBar=object
      a,b,c,d:integer;
      color:word;
      Constructor initt(ea,eb,ec,ed:integer; coll:word);
      Procedure Draww (coll:word); virtual;
      Procedure Showw;
      Procedure Hidee;
      Procedure MoveToo(wa,wb,wc,wd:integer; coll:word);
 End;
 
      Constructor TBar.Initt(ea,eb,ec,ed:integer; coll:word);
      Begin a:=ea; b:=eb; c:=ec; d:=ed; color:=coll end;
 
      Procedure Tbar.Draww(coll:word);
      Begin end;
 
      Procedure Tbar.Showw;
      Begin Draww(color); end;
 
      Procedure Tbar.Hidee;
      Begin Hidee; Draww(GetBkColor); end;
 
      Procedure TBar.MoveToo(wa,wb,wc,wd:integer; coll:word);
      Begin Setcolor(coll); a:=a+wa; b:=b+wb; c:=c+wc; d:=d+wd; showw; end;
 
 Var driver,mode:integer;
     VEllipse:TEllipse;
     VBar:TBar;
 Begin
   Driver:=detect;
   initGraph(Driver,Mode,'C\:Pascal');
   VEllipse.Init (100,300,50,80,11,10,17);
   VEllipse.Show;
   Vbar.initt(100,200,60,33,4);
   Vbar.showw;
   ReadKey;
   CloseGraph;
 End.
Здравствуйте.
Не показывает прямоугольник, а только эллипс
Leshiy1 вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц