home *** CD-ROM | disk | FTP | other *** search
-
- XScrSav
- -------
-
- Here you have a screen-saver that you can use in you Turbo-Vision
- programs. It acts like the one in the Norton-Commander. For link
- it to your program you must make following in a TApplication
- descendant:
-
- TMyApplication = object( TApplication )
- Saver : PScreenSaver;
- constructor Init;
- procedure GetEvent(var Event:TEvent); virtual;
- end;
-
- constructor TMyApplication.Init;
- begin
- TApplication.Init;
- New( Saver, Init( 5 * 60 )); (* equal to five minutes ! *)
- Insert( Saver );
- end;
-
- procedure TMyApplication.GetEvent( var Event:TEvent );
- begin
- TApplication.GetEvent(Event);
- Saver^.GetEvent(Event);
- end;
-
- Thats all you must do. After that check if the saver would be
- activate if you move the mouse-cursor to the upper-right corner.
-
-
- TScreenSaver
- ~~~~~~~~~~~~
-
- This is the object that control the entire screen-saver.
-
- Fields:
- -------
- Activ : Boolean Indicate if the saver is activ
- MaxSecs : Word Number of seconds after that the saver should
- be activate
- SecsGone : Word Seconds that are gone without any events
- MyView : PView The View which hold the active part of the
- screen saver module.
-
- Methods
- -------
- constructor Init( Ticks:word );
- Initialize the screen-saver with the specified number of ticks.
- The position of this invisble view is the upper-right corner.
- By use the Move method of TView you can place it at an other
- position.
-
- procedure GetEvent(var Event:TEvent); virtual;
- All Events of the main application should be reported to this
- method, because here is the part were the screen-saver look
- for his activate timing
-
- function InitSaverView:PView; virtual;
- This function would be use to activate the saver. On default it
- return a norton-commander like screen-saver, but you can use
- this method to install your own modules in it. A view descendant
- that returned to this function, should be use the whole desktop
- aera, and get total control over the handle event method. After
- any event occured and catched by the GetEvent method the
- View was deleted and the original screen would be redrawn
-
-
- Here some tips how the inside views for the norton-commander
- like screen-saver looks like :
-
- PStar = ^TStar;
- TStar = object ( TView )
- StarState : byte;
- constructor Init( R:TRect);
- procedure Draw; virtual;
- procedure HandleEvent( var Event:TEvent ); virtual;
- end;
-
- PSaverView = ^TSaverView;
- TSaverView = object ( TGroup )
- constructor Init;
- procedure HandleEvent( var Event:TEvent ); virtual;
- procedure Draw; virtual;
- end;
-
- The full method code was included in the registriated version.
-
-
-
-
-
-
-