lcl: set caption for TCustomPage even it is has not handle allocated but parent has since page caption belongs to pagecontrol, not the page (bug #0011888)

git-svn-id: trunk@18184 -
This commit is contained in:
paul 2009-01-07 09:53:40 +00:00
parent 75f25dfbab
commit 37e866d1ea
2 changed files with 13 additions and 0 deletions

View File

@ -70,6 +70,7 @@ type
procedure DoHide; dynamic;
procedure DoShow; dynamic;
procedure DestroyHandle; override;
procedure RealSetText(const AValue: TCaption); override;
public
constructor Create(TheOwner: TComponent); override;
procedure AdjustClientRect(var ARect: TRect); override;

View File

@ -203,6 +203,18 @@ begin
Exclude(FFlags,pfAdded);
end;
procedure TCustomPage.RealSetText(const AValue: TCaption);
begin
if (Parent <> nil) and Parent.HandleAllocated and (not (csLoading in ComponentState)) then
begin
WSSetText(AValue);
InvalidatePreferredSize;
inherited RealSetText(AValue);
AdjustSize;
end
else inherited RealSetText(AValue);
end;
function TCustomPage.IsControlVisible: Boolean;
begin
if Parent is TCustomNotebook then