home *** CD-ROM | disk | FTP | other *** search
- {-- a simple window with a world coordinate system, the items are }
- {-- redrawn and fitted to the window when it is resized. }
-
- {$M 4384,64000,256000}
- {$I switches.inc}
-
- USES
-
- teglfont,
- FastGrph,
- TGraph,
- virtmem,
- teglmain,
- teglunit,
- twcommon,
- twkernel,
- twworld,
- moreicon;
-
- {$F+}
- {$IFDEF wcFloatLInt}
- Function worldredraw(ifs : ImageStkPtr; ms : MsClickPtr): Word;
- VAR wf : WinFramePtr;
- BEGIN
- wf := FindWinFrame(ifs);
- twwDefineWorld(wf,-10000,10000,10000,-10000);
- twwLine(wf,-10000,-10000, 10000,10000);
- twwrectangle(wf,-5000,-5000,5000,5000);
- setfillstyle(solidfill,blue);
- twwbar(wf,-9000,9000,-5000,5000);
- twwarc(wf,0,0,180,360,5000);
- twwellipse(wf,0,0,180,360,4000,4000);
- twwcircle(wf,0,0,6000);
- END;
-
-
- {$ELSE} {-- assume reals }
-
- Function worldredraw(ifs : ImageStkPtr; ms : MsClickPtr): Word;
- VAR wf : WinFramePtr;
- BEGIN
- wf := FindWinFrame(ifs);
- twwDefineWorld(wf,-10.0,10.0,10.0,-10.0);
- twwLine(wf,-10.0,-10.0, 10.0,10.0);
- twwrectangle(wf,-5,-5,5,5);
- setfillstyle(solidfill,blue);
- twwbar(wf,-9,9,-5,5);
- twwarc(wf,0,0,360,180,5.0);
- twwellipse(wf,0,0,180,360,4.0,4.0);
- twwcircle(wf,0,0,6.0);
- END;
-
- {$ENDIF}
-
- VAR wf : WinFramePtr;
-
- BEGIN
- twEasyStart;
- EmergencyExit;
- setautorotate(true);
- SetTeglFont(@Font14);
- {---------}
- New(wf);
- twInit(wf,100,100,400,300);
- twSetThickness(wf,6);
- twSetWinFrameColors(wf,lightgray,darkgray);
- twSetHeader(wf,'World Window');
- twSetRedraw(wf,worldredraw);
- twDrawWindowFrame(wf);
-
- SetAutoRotate(TRUE);
- TeglSuperVisor;
- END.
-