2009-10-05 23:10:43 -04:00
|
|
|
program new;
|
|
|
|
|
|
|
|
const
|
|
|
|
dtm_Rectangle = 0;
|
|
|
|
dtm_Cross = 1;
|
|
|
|
dtm_DiagonalCross = 2;
|
|
|
|
dtm_Circle = 3;
|
|
|
|
dtm_Triangle = 4;
|
|
|
|
|
|
|
|
var
|
|
|
|
ppdtm: pdtm;
|
2009-10-05 23:40:44 -04:00
|
|
|
w,h,x,y,dtm,i: integer;
|
|
|
|
|
|
|
|
p,pp: TPointArray;
|
|
|
|
c,t,asz,ash: TIntegerArray;
|
|
|
|
|
2009-10-05 23:10:43 -04:00
|
|
|
begin
|
2009-10-05 23:40:44 -04:00
|
|
|
p := [Point(0,0), Point(1,1)];
|
|
|
|
c := [clWhite, clWhite];
|
|
|
|
t := [0, 0];
|
|
|
|
asz := [0, 0];
|
|
|
|
ash := [dtm_Rectangle, dtm_Rectangle];
|
2009-10-05 23:10:43 -04:00
|
|
|
setlength(ppdtm.p,2);
|
|
|
|
setlength(ppdtm.c,2);
|
|
|
|
setlength(ppdtm.t,2);
|
|
|
|
setlength(ppdtm.asz,2);
|
|
|
|
setlength(ppdtm.ash,2);
|
|
|
|
|
2009-10-05 23:40:44 -04:00
|
|
|
ppdtm.p := p;
|
|
|
|
ppdtm.c := c;
|
|
|
|
ppdtm.t := t;
|
|
|
|
ppdtm.asz := asz;
|
|
|
|
ppdtm.ash := ash;
|
2009-10-05 23:10:43 -04:00
|
|
|
|
|
|
|
dtm := AddpDTM(ppdtm);
|
|
|
|
|
|
|
|
getclientdimensions(w,h);
|
|
|
|
if FindDTM(dtm, x, y, 0, 0, w-1, h-1) then
|
|
|
|
begin
|
|
|
|
writeln('Found DTM at ' + inttostr(x) + ', ' + inttostr(y));
|
|
|
|
movemouse(x,y);
|
|
|
|
end;
|
|
|
|
|
2009-10-05 23:40:44 -04:00
|
|
|
if FindDTMs(dtm, p, 0, 0, w-1, h-1) then
|
|
|
|
begin
|
|
|
|
writeln('Found ' + inttostr(length(p)) + ' DTM(s). First one at ' +
|
|
|
|
inttostr(p[0].x) + ', ' + inttostr(p[0].y));
|
|
|
|
movemouse(p[0].x,p[0].y);
|
|
|
|
end;
|
2009-10-05 23:10:43 -04:00
|
|
|
end.
|