lcl: implement TCanvas.TryLock (fixes part of issue #0008380)

git-svn-id: trunk@19047 -
This commit is contained in:
paul 2009-03-20 17:46:12 +00:00
parent e8814a27e8
commit 058c9c7149
2 changed files with 8 additions and 0 deletions

View File

@ -1037,6 +1037,7 @@ type
constructor Create;
destructor Destroy; override;
procedure Lock; virtual;
function TryLock: Boolean;
procedure Unlock; virtual;
procedure Refresh; virtual;
procedure Changing; virtual;

View File

@ -1659,6 +1659,13 @@ begin
LockCanvas;
end;
function TCanvas.TryLock: Boolean;
begin
Result := not Locked;
if Result then
Lock;
end;
{------------------------------------------------------------------------------
Function: TCanvas.Unlock
Params: none