lcl: AutoSize control (if needed) on child visibility change and on child remove (issue #0010605)

git-svn-id: trunk@14819 -
This commit is contained in:
paul 2008-04-14 16:31:56 +00:00
parent 4b5895c501
commit 47a961ba28
2 changed files with 14 additions and 1 deletions

View File

@ -3241,11 +3241,17 @@ begin
FVisible := Value;
try
Perform(CM_VISIBLECHANGED, WParam(Ord(Value)), 0);
Include(FControlFlags,cfRequestAlignNeeded);
Include(FControlFlags, cfRequestAlignNeeded);
if (Self is TWinControl) then
AsWincontrol := TWinControl(Self)
else
AsWincontrol := nil;
// resize parent if it has autosize
if (Parent <> nil) and Parent.AutoSize then
begin
Parent.InvalidatePreferredSize;
Parent.AdjustSize;
end;
if FVisible then
begin
if AsWincontrol <> nil then

View File

@ -5642,7 +5642,14 @@ begin
AControl.InvalidateControl(AControl.IsVisible, False, True);
Remove(AControl);
if not (csDestroying in ComponentState) then
begin
if AutoSize then
begin
InvalidatePreferredSize;
AdjustSize;
end;
Realign;
end;
end;
{------------------------------------------------------------------------------