| Class TSaverBasics (unit savThr) |
TThread
this is the basic class, only change it if you want to change the logic of working
| Constructors |
constructor Create (ACanvas : TCanvas; DrawRect : TRect);Part 1 abstract definition of the TSaverBasics thread} {Part 2 definition of the TSaverThread for this sample\ {Part 3 implementation of the preview window for the TSaverThread clas} {Part 4 implementation of the password change dialog} {I think, the only thing you have to do is to change Part 2 to your new screen saver display options} {Part 1 abstract definition of the TSaverBasics thread
| Functions |
procedure ClearForceRect;only enlare this rectangle, never shrink it
procedure Execute;
procedure AStep;free the background bitmap
procedure CleanUp;and now initialize some thread properties to the appropriate values
procedure SetForceRect (ARect : TRect);| Properties |
property ForceRect : TRect| Events |
| Variables |
Background : TBitmap;
Canvas : TCanvas;
Height : Integer;
Left : Integer;
SleepTime : Integer;
Top : Integer;
Width : Integer;
FForceRect : TRect;| Constructors |
constructor Create (ACanvas : TCanvas; DrawRect : TRect);this makes is called immediately before ending the execute function
Part 1 abstract definition of the TSaverBasics thread} {Part 2 definition of the TSaverThread for this sample\ {Part 3 implementation of the preview window for the TSaverThread clas} {Part 4 implementation of the password change dialog} {I think, the only thing you have to do is to change Part 2 to your new screen saver display options} {Part 1 abstract definition of the TSaverBasics thread
| Functions |
procedure ClearForceRect;don't care about this
only enlare this rectangle, never shrink it
procedure Execute;ACanvas holds the canvas to draw the saver action to and the DrawRect holds the wanted rectangle, usually this is the full canvas
procedure AStep;time to go to sleep for Sleep function
free the background bitmap
procedure CleanUp;override this and implement a step in your screen saver, this gets called again and again until the saver finishes
and now initialize some thread properties to the appropriate values
procedure SetForceRect (ARect : TRect);nothing here, as you see
| Properties |
property ForceRect : TRectcall this if you have redrawn the ForceRect to set it to 0,0,0,0
| Events |
| Variables |
Background : TBitmap;
Canvas : TCanvas;
Height : Integer;the here specified dimensions
Left : Integer;the canvas to draw the saver action to
SleepTime : Integer;bitmap holding the background
Top : Integer;dimensions of the display window
Width : Integer;all drawing must be done inside
FForceRect : TRect;