LCL: getmousecapture: check if handleallocated

git-svn-id: trunk@42305 -
This commit is contained in:
mattias 2013-08-04 09:52:54 +00:00
parent 2fe9905694
commit 533ea4f496
3 changed files with 8 additions and 2 deletions

View File

@ -1133,7 +1133,6 @@ type
function GetClientHeight: Integer;
function GetClientWidth: Integer;
function GetLRDockWidth: Integer;
function GetMouseCapture: Boolean;
function GetTBDockHeight: Integer;
function GetText: TCaption;
function GetUndockHeight: Integer;
@ -1353,6 +1352,7 @@ type
procedure SetParentComponent(NewParentComponent: TComponent); override;
procedure WndProc(var TheMessage: TLMessage); virtual;
procedure ParentFormHandleInitialized; virtual; // called by ChildHandlesCreated of parent form
function GetMouseCapture: Boolean; virtual;
procedure CaptureChanged; virtual;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
function CanTab: Boolean; virtual;
@ -2065,6 +2065,7 @@ type
procedure MainWndProc(var Msg: TLMessage);
procedure ParentFormHandleInitialized; override;
procedure ChildHandlesCreated; virtual;// called after children handles are created
function GetMouseCapture: Boolean; override;
procedure RealSetText(const AValue: TCaption); override;
procedure RemoveFocus(Removing: Boolean);
procedure SendMoveSizeMessages(SizeChanged, PosChanged: boolean); override;

View File

@ -1738,7 +1738,7 @@ end;
------------------------------------------------------------------------------}
function TControl.GetMouseCapture : Boolean;
begin
Result := GetCaptureControl = Self;
Result := (Parent<>nil) and Parent.HandleAllocated and (GetCaptureControl = Self);
end;
function TControl.GetTBDockHeight: Integer;

View File

@ -7509,6 +7509,11 @@ begin
Exclude(FWinControlFlags,wcfCreatingChildHandles);
end;
function TWinControl.GetMouseCapture: Boolean;
begin
Result:=HandleAllocated and (GetCaptureControl=Self);
end;
{------------------------------------------------------------------------------
function TWinControl.ParentHandlesAllocated: boolean;