Unit szimtpu; Interface Uses Graph; Implementation Const sz_hatter = 1; sz_fejlec = 3; sz_statusz = 3; sz_ablak_hatter = 7; sz_ablak_arnyek = 12; arnyek_pixel = 5; Procedure Grafikusra; Var grDriver: Integer; grMode: Integer; ErrCode: Integer; begin DetectGraph(grDriver, grMode); InitGraph(grDriver, grMode,' '); ErrCode := GraphResult; if not ErrCode = grOk then Writeln('Graphics error:', GraphErrorMsg(ErrCode)); end; Procedure Teglalap(bfx,bfy,jax,jay : integer; szin : byte); Begin SetFillStyle(1,szin); Bar(bfx, bfy, jax, jay); End; Procedure Ablak(bfx,bfy,xm,ym : integer; hatter, szin : byte; nev:string); Begin SetFillStyle(1,sz_ablak_arnyek); { Bar(bfx+1+arnyek_pixel,bfy+arnyek_pixel,bfx+xm-1+arnyek_pixel,bfy+ym+arnyek_pixel); Line(bfx)} Teglalap(bfx+5,bfy+6,bfx+xm+5,bfy+ym+4,12); SetPalette(12,56); Teglalap(bfx+1,bfy,bfx+xm-1,bfy+ym,hatter); Teglalap(bfx,bfy+1,bfx+xm,bfy+ym-1,hatter); { SetFillStyle(1,szin);} SetColor(szin); SetTextStyle(0,0,0); SetTextJustify(1,1); outtextxy(bfx+(xm*2 + 1)shr 2,bfy+(ym*2 + 1)shr 2,nev); End; Procedure RakdKiAzAblakokat; Var Xmin, Ymin, Xmax,Ymax : Integer; x,y : Integer; s,s2 : string; paramx,paramy : Integer; Const koz = 18; diagr : Array [0..9] of Integer = (10,2,3,1,4,2,1,3,4,1); Begin Xmax:=GetMaxX; Ymax:=GetMaxY; Teglalap(0,0,Xmax,Ymax,1); Ymin:=TextHeight('Hj')*2; Teglalap(0,0,Xmax,Ymin,3); SetTextJustify(1,1); OutTextXY(Xmax div 2, TextHeight('Hj'),'Szimulci neve'); Teglalap(0,Ymax-TextHeight('H')-2,Xmax,Ymax,3); Ymax:=Ymax-TextHeight('H')-2; SetTextJustify(0,2); SetColor(0); OutTextXY(0,Ymax+1,'Sttusz-sor - abcdefghijklmnopqrstuvwxyz'); { Ablak(GetMaxX div 3,GetMaxY div 3,GetMaxX div 3,GetMaxY div 3,7,15,'Ablak');} { *** ide mg jn a men ***********} y:=TextHeight('Hj')+3; Ablak(koz, Ymax-y-koz, Xmax-2*koz,y,7,0, 'Men : norml csendes grafikon lpsenknt paramterek kilps'); Ymax:=Ymax-y-koz; YMax:=Ymax-Ymin; y:=(Ymax-3*koz) div 2; x:=(y*207) shr 7; { x:=(Xmax-x) shr 1; y:=Ymin+koz; str(x,s2); str(y,s); s2:=s2+','+s; outtextxy(GetMaxX div 2,GetMaxY div 2,s2);} paramx:=x*2 div 3; paramy:=(paramx*207) shr 7; Ablak((Xmax-x-paramx) div 3,Ymin+koz,x,y,7,15,'Szimulcis tr ablakja'); { diagram((Xmax-x-paramx) div 3+10,Ymin+koz+10,(Xmax-x-paramx) div 3+x-20,Ymin+koz+10+y-20,diagr,9,true,true,9);} { Ablak((Xmax-x)shr 1,Ymin+2*koz+y,x,y,7,15,'Grafikon');} Ablak((Xmax-x-paramx) div 3,Ymin+2*koz+y,x,y,7,3,'Grafikon ablakja kikapcsolva'); Ablak(Xmax-paramx-(Xmax-x-paramx) div 3,Ymin+((Ymax-paramy) shr 1),paramx,paramy,7,0,'Paramterek ablaka'); { Ablak(20,Ymin+220,350,200,7,15,'Grafikon');} End; BEGIN Grafikusra; RakdKiAzAblakokat; END.