mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 19:40:20 +02:00
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:
parent
f84bcb8db6
commit
928292514b
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user