Cazax
2009-02-03 09:59:32
The idea is to debug the progress report in the screen. How? here is an example:
program New;
{.include SRL/SRL.scar}
Var
Bmp : Integer;
Procedure DebugTime;
var
Canvas : TCanvas;
W, H : Integer;
Begin
bmp := BitmapFromString(0, 0, '');
Canvas := GetClientCanvas;
Bmp := CreateBitmapMaskFromText('Time running: ' + TimeRunning, UpChars);
FastReplaceColor(Bmp, ClBlack, 10799322);
GetBitmapSize(Bmp, W, H);
SafeCopyCanvas(GetBitmapCanvas(Bmp), Canvas, 0, 0, W, H, 205, 387, 205 + W, 387 + H);
FreeBitmap(Bmp);
SetTimeout(1, 'DebugTime');
End;
begin
ActivateClient;
SetupSRL;
Wait(500);
DebugTime;
Repeat
MMouse(Random(500), Random(500), Random(100), Random(100));
Wait(500 + Random(500));
Until False;
end.It will debug the time running while moving the mouse. It doesn't affect the mouse movements as you can see. It will replace the rs canvas with a text, and it sets a timout to call it every 1 seconds(canvas change). What do you think? Here is a picture: