UNIT Mbouton; interface uses crt,dos,graph,fondimag,soursime; type string10=string; bouton=object x,y,long,haut:word; etat,taille:integer; p:pointer; function init(ex,ey,elong,ehaut:word;donne:string10):boolean; function position(sx,sy:word):boolean; procedure inverse_b(e:integer); FUNCTION b_run(k:char):boolean; Procedure done; end; PROCEDURE simulekey(acsi:char); implementation PROCEDURE simulekey(acsi:char); var scanc:byte; reg:registers; begin with reg do begin reg.ah:=$05; reg.cx:=ord(acsi); intr($16,reg); end; end; function bouton.init(ex,ey,elong,ehaut:word;donne:string10):boolean; var i,j,k:integer ; begin x:=ex; y:=ey; long:=elong; haut:=ehaut; etat:=normalput; init:=false; taille:=imagesize(x,y,x+long,y+haut); if maxavail<=taille then exit; init:=true; hide; SetTextStyle(defaultfont , HorizDir, 1); setcolor(0); setfillstyle(1,lightgray); bar(x,y,x+long,y+haut); rectangle(x,y,x+long,y+haut); setcolor(white); for i:=1 to 3 do line(x+i,y+i,x+long-i,y+i); for i:=1 to 3 do line(x+i,y+i,x+i,y-i+haut); setcolor(darkgray); for i:=1 to 3 do line(x+i,y-i+haut,x+long-i,y-i+haut); for i:=1 to 3 do line(x-i+long,y+i,x-i+long,y-i+haut); k:=long div 8; if k<=7 then k:=8; outtextxy(x+k,y+haut div 3,donne); getmem(p,taille); getimage(x,y,x+long,y+haut,p^); shows; end; Procedure bouton.done; begin freemem(p,taille); end; FUNCTION bouton.position(sx,sy:word):boolean; begin position:=false; if ((sx>x) and (sxy) and (sy