LCL: added public TControl.IsParentShowHint:boolean function, to check parentShowHint property, since ParentShowHint is protected.For now it's used only in GetHintControl() in application.inc.Fixes issue #20518.

git-svn-id: trunk@33020 -
This commit is contained in:
zeljko 2011-10-22 12:47:44 +00:00
parent f84bcb8db6
commit 928292514b
3 changed files with 26 additions and 1 deletions

View File

@ -1357,6 +1357,7 @@ type
function IsVisible: Boolean; virtual;// checks parents too
function IsControlVisible: Boolean; virtual;// does not check parents
function IsEnabled: Boolean; // checks parent too
function IsParentShowHint: Boolean; // checks protected ParentShowHint prop.
function FormIsUpdating: boolean; virtual;
function IsProcessingPaintMsg: boolean;
procedure Hide;

View File

@ -39,9 +39,17 @@ end;
function GetHintControl(Control: TControl): TControl;
begin
Result := Control;
if (Result <> nil) and not Result.ShowHint and
not Result.IsParentShowHint then
begin
Result := nil;
exit;
end;
while (Result <> nil) and (not Result.ShowHint) do
Result := Result.Parent;
if (Result <> nil)and
if (Result <> nil) and
([csDesigning, csDestroying, csLoading] * Result.ComponentState <> []) then
Result := nil;
end;

View File

@ -675,6 +675,22 @@ begin
until (TheControl = nil) or (not Result);
end;
{------------------------------------------------------------------------------
Method: TControl.IsParentShowHint
Params: none
Returns: Boolean
Used at places where we need to check ParentShowHint from TControl.
Property is protected, so this function avoids hacking to get
protected property value.
Example of usage is GetHintControl()
from application.inc (issue #20518) .
------------------------------------------------------------------------------}
function TControl.IsParentShowHint: Boolean;
begin
Result := FParentShowHint;
end;
function TControl.FormIsUpdating: boolean;
begin
Result := Assigned(Parent) and Parent.FormIsUpdating;