mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 14:19:11 +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 IsVisible: Boolean; virtual;// checks parents too
|
||||||
function IsControlVisible: Boolean; virtual;// does not check parents
|
function IsControlVisible: Boolean; virtual;// does not check parents
|
||||||
function IsEnabled: Boolean; // checks parent too
|
function IsEnabled: Boolean; // checks parent too
|
||||||
|
function IsParentShowHint: Boolean; // checks protected ParentShowHint prop.
|
||||||
function FormIsUpdating: boolean; virtual;
|
function FormIsUpdating: boolean; virtual;
|
||||||
function IsProcessingPaintMsg: boolean;
|
function IsProcessingPaintMsg: boolean;
|
||||||
procedure Hide;
|
procedure Hide;
|
||||||
|
@ -39,9 +39,17 @@ end;
|
|||||||
function GetHintControl(Control: TControl): TControl;
|
function GetHintControl(Control: TControl): TControl;
|
||||||
begin
|
begin
|
||||||
Result := Control;
|
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
|
while (Result <> nil) and (not Result.ShowHint) do
|
||||||
Result := Result.Parent;
|
Result := Result.Parent;
|
||||||
if (Result <> nil)and
|
if (Result <> nil) and
|
||||||
([csDesigning, csDestroying, csLoading] * Result.ComponentState <> []) then
|
([csDesigning, csDestroying, csLoading] * Result.ComponentState <> []) then
|
||||||
Result := nil;
|
Result := nil;
|
||||||
end;
|
end;
|
||||||
|
@ -675,6 +675,22 @@ begin
|
|||||||
until (TheControl = nil) or (not Result);
|
until (TheControl = nil) or (not Result);
|
||||||
end;
|
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;
|
function TControl.FormIsUpdating: boolean;
|
||||||
begin
|
begin
|
||||||
Result := Assigned(Parent) and Parent.FormIsUpdating;
|
Result := Assigned(Parent) and Parent.FormIsUpdating;
|
||||||
|
Loading…
Reference in New Issue
Block a user