home *** CD-ROM | disk | FTP | other *** search
- {$F+} { -- far code model is required for any functions that }
- { -- are to be used as Event Handlers }
-
- Uses
- dos,
- tgraph,
-
- virtmem,
- teglfont,
- fastgrph,
- TEGLIntr,
- TEGLICON,
- TEGLUnit,
- TEGLMenu,
- TEGLMain,
- SenseMs,
- DebugUnt;
-
- VAR
- om1, om2 : OptionMPtr;
-
-
- FUNCTION GetMsSense(FS:imagestkptr; Ms: msclickptr) : WORD;
- BEGIN
- SetMouseSense(fs^.x,fs^.y);
- GetMsSense := 1;
- END;
-
-
- FUNCTION InfoOption(FS:imagestkptr; Ms: msclickptr) : WORD;
- VAR
- x,y,x1,y1 : word;
- ifs : ImageStkPtr;
- ax,ay,ax1,ay1 : word;
- option : word;
- BEGIN
- HideMouse;
-
- x := 200;
- y := 120;
- x1 := x+340;
- y1 := y+100;
-
- ax := Ms^.ms.x+FS^.x;
- ay := Ms^.ms.y+FS^.y;
- ax1 := Ms^.ms.x1+FS^.x;
- ay1 := Ms^.ms.y1+FS^.y;
-
- {-- push image creates the frame and saves the background image }
-
- PushImage(x,y,x1,y1);
- IFS := stackptr; {-- stackptr has the most recent frame }
-
- {-- ziptobox creates a xor box that moves from one location to }
- {-- another and changes size. The msclickptr passed to the event }
- {-- has the coordinates of the mouse click area that has activated }
- {-- this event. }
-
- ZipToBox(ax,ay,ax1,ay1,x,y,x1,y1);
-
- SetColor(White);
- ShadowBox(x,y,x1,y1);
-
- SetColor(Black);
- SetTeglFont(@font14);
- OutTEGLtextxy(x+5,y+5,'TEGL Windows Toolkit II');
- OutTEGLtextxy(x+5,y+5+TEGLCharHeight,
- 'Jan. 1, 1990, Program Written by Richard Tom');
-
- {-- next put up an ok button and associated a mouse click with }
- {-- it. No real event is called we just want to detect the mouse }
- {-- click to know when to close the window. }
-
- PutPict(x+280,y+75,@ImageOk,Black);
- DefineMouseClickArea(IFS,280,75,280+35,75+12,TRUE,
- NilUnitProc,MSClick);
- SetMousePosition(x+290,y+85);
- ShowMouse;
-
- {-- wait until mouse action on this frame }
- WHILE CheckforMouseSelect(IFS)=NIL DO;
- {-- then dispose of the frame and zip back to the orginal postion }
- {-- on the screen. }
-
- HideMouse;
- DropStackImage(ifs);
- ZipFromBox(ax,ay,ax1,ay1,ifs^.x,ifs^.y,ifs^.x1,ifs^.y1);
- ShowMouse;
-
- InfoOption := 1;
- END;
-
-
-
- BEGIN
-
- EasyTEGL;
-
-
- om1 := CreateOptionMenu(@Font14);
- DefineOptions(om1,' ~O~pen ', true, NilUnitProc);
- DefineOptions(om1,' ~I~nfo...',true, InfoOption);
- DefineOptions(om1,'-', false,NilUnitProc);
- DefineOptions(om1,' ~Q~uit ', true, Quit);
-
- om2 := CreateOptionMenu(@Font14);
- DefineOptions(om2,' ~M~emory ',true,ShowCoordinates);
- DefineOptions(om2,' ~M~ouse Sensitivity ',true,GetMsSense);
-
- CreateBarMenu(0,0,getmaxx);
- OutBarOption(' ~F~ile ',om1);
- OutBarOption(' ~U~tility ',om2);
-
- { -- control is then passed to the supervisor }
-
- TEGLSupervisor;
- END.
-