2 unit GUI: IIUWGRAPH class;
4 c_white=15,c_yellow=14,c_rose=13,c_red=12,
5 c_turq=11,c_green=10,c_blue=9,c_darkgrey=8,
6 c_lightgrey=7,c_brown=6,c_violet=5, c_darkred=4,
7 c_darkturq=3,c_darkgreen=2,c_darkblue=1,
10 var res:array_of char, cursor_x,cursor_y:integer;
12 unit GUI_Clear:procedure;
17 unit GUI_ClearArea:procedure(x1,y1,w,h:integer);
19 res:=hfont8(312,x1,y1,w,"",h,0,0);
23 unit GUI_Point:procedure(x,y,col:integer);
29 unit GUI_Move:procedure(x,y:integer);
35 unit GUI_Line:procedure(x1,y1,x2,y2,col:integer);
37 res:=hfont8(310,x1,y1,x2,"",y2,col,0);
40 unit GUI_LineTo:procedure(x,y,col:integer);
42 res:=hfont8(310,cursor_x,cursor_y,x,"",y,col,0);
45 unit GUI_Rect:procedure(x1,y1,x2,y2,fcol,icol:integer);
47 res:=hfont8(311,x1,y1,x2,"",y2,fcol,icol);
50 unit GUI_Ellipse:procedure(x,y,a,b,sa,ea,fcol,icol:integer);
53 call cirb(x,y,a,b,sa,ea,icol,1);
55 call cirb(x,y,a,b,sa,ea,fcol,0);
58 unit GUI_WriteInt:procedure(x,y,i,fcol,bcol:integer);
60 res:=hfont8(300,x,y,i,"",fcol,bcol,0);
63 unit GUI_WriteChar:procedure(x,y:integer;c:char;fcol,bcol:integer);
65 res:=hfont8(301,x,y,ord(c),"",fcol,bcol,0);
69 unit GUI_WriteReal:procedure(x,y:integer;r:real;
71 var rr,i:real,int,frac:integer;
76 while rr-entier(rr)>0 do
80 frac:=entier(r*i-int*i);
81 res:=hfont8(302,x,y,int,"",frac,fcol,bcol);
86 unit GUI_WriteText:procedure(x,y:integer;t:array_of char;
91 res:=hfont8(1000,0,0,0,"",0,0,0);
92 for i:=lower(t) to upper(t) do
93 res:=hfont8(1001,ord(t(i)),0,0,"",0,0,0);
95 res:=hfont8(303,x,y,fcol,"",bcol,0,0);
99 unit GUI_ReadText:function(x,y,
100 fcol,bcol:integer):array_of char;
102 result:=hfont8(-304,x,y,fcol,"",bcol,0,0);
106 unit GUI_ReadInt:function(x,y,fcol,bcol:integer):integer;
108 res:=hfont8(-305,x,y,fcol,"",bcol,0,0);
112 unit GUI_ReadChar:function(x,y,
113 fcol,bcol:integer):char;
115 res:=hfont8(-306,x,y,fcol,"",bcol,0,0);
119 unit GUI_ReadReal:function(x,y,
120 fcol,bcol:integer):real;
123 res:=hfont8(-307,x,y,fcol,"",bcol,0,0);
126 while entier(p2)>0 do
133 unit GUI_PutImgFile:procedure(x,y:integer;fname:string);
135 res:=hfont8(308,x,y,0,fname,0,0,0);
138 unit GUI_GetImg:function(x,y,w,h:integer):array_of integer;
141 result:=getmap(x+w,y+h);
144 unit GUI_PutImg:procedure(x,y:integer;map:array_of integer);
150 unit GUI_KillImg:procedure(map:array_of integer);
153 res:=hfont8(309,map(1),0,0,"",0,0,0);
157 unit GUI_MousePressed:MOUSE
158 procedure(INOUT x,y,btn:integer);
159 var l,p,r:integer,e:boolean;
161 e:=getpress(x,y,l,p,r,btn);
162 end GUI_MousePressed;
164 unit GUI_KeyPressed:function:integer;
170 cursor_x:=0;cursor_y:=0;