summaryrefslogtreecommitdiff
path: root/src/corelib
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2011-01-06 17:29:46 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2011-01-06 17:29:46 +0200
commita9f8b9430d3a0c3e694a083cab0671397b30d071 (patch)
tree30fa7d5ebe0f478a82fa5e718b011fbc69df9e08 /src/corelib
parent88734fba2737470015c76103219cf837dc7b3aa8 (diff)
downloadfpGUI-a9f8b9430d3a0c3e694a083cab0671397b30d071.tar.xz
new fpgPause() function.
This function blocks the calling method, but allows for framework messages still to be processed. Could be useful for some developers.
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/fpg_main.pas13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas
index 88143118..8532f959 100644
--- a/src/corelib/fpg_main.pas
+++ b/src/corelib/fpg_main.pas
@@ -399,6 +399,7 @@ procedure fpgCheckTimers;
procedure fpgResetAllTimers;
function fpgClosestTimer(ctime: TDateTime; amaxtime: integer): integer;
function fpgGetTickCount: DWord;
+procedure fpgPause(MilliSeconds: Cardinal);
// Rectangle, Point & Size routines
function InflateRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean;
@@ -601,6 +602,18 @@ begin
Result := DWord(Trunc(Now * MSecsPerDay));
end;
+{ blocking function for the caller, but still processes framework messages }
+procedure fpgPause(MilliSeconds: Cardinal);
+var
+ lStart: TDateTime;
+begin
+ lStart := Now * MSecsPerDay;
+ repeat
+ fpgApplication.ProcessMessages;
+ until ((Now*MSecsPerDay)-lStart) > MilliSeconds;
+end;
+
+
function InflateRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean;
begin
if Assigned(@Rect) then