LCL: call DockManager.ResetBounds on every change bounds

git-svn-id: trunk@24763 -
This commit is contained in:
mattias 2010-04-20 22:40:59 +00:00
parent e10e89337c
commit d55f679aeb
5 changed files with 12 additions and 7 deletions

View File

@ -62,11 +62,7 @@
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)\"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
<LCLWidgetType Value="win32"/>
</SearchPaths>
<CodeGeneration>
<TargetOS Value="Win32"/>
</CodeGeneration>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>

View File

@ -1067,11 +1067,13 @@ procedure TEasyTree.ResetBounds(Force: Boolean);
var
rNew: TRect;
begin
DebugLn(['TEasyTree.ResetBounds ']);
//drop site resized - never called in Lazarus???
if (csLoading in FDockSite.ComponentState) then
exit; //not the right time to do anything
//how to determine old bounds?
rNew := FDockSite.ClientRect;
DebugLn(['TEasyTree.ResetBounds ',dbgs(rNew)]);
//try catch bad calls (Win32)?????
if (rNew.Right <= 0) or (rNew.Bottom <= 0) then
exit;

View File

@ -232,7 +232,7 @@ begin
AForm.EnableAlign;
end;
//function TDockMaster.CreateDockable(const AName: string; site: TWinControl;
//function TDockMaster.CreateDockable(const AName: string; site: TWinControl);
function TDockMaster.CreateDockable(const AName: string;
fMultiInst, DisableUpdate: boolean; fWrap: boolean): TWinControl;
var

View File

@ -1732,6 +1732,7 @@ type
function DoAlignChildControls(TheAlign: TAlign; AControl: TControl;
AControlList: TFPList; var ARect: TRect): Boolean; virtual;
procedure DoChildSizingChange(Sender: TObject); virtual;
procedure DoOnChangeBounds; override;
{$IFDEF OldAutoSize}
procedure ResizeDelayedAutoSizeChildren; virtual;
{$ENDIF}

View File

@ -3172,6 +3172,13 @@ begin
ReAlign;
end;
procedure TWinControl.DoOnChangeBounds;
begin
inherited DoOnChangeBounds;
if FUseDockManager and (DockManager<>nil) then
DockManager.ResetBounds(false);
end;
{$IFDEF OldAutoSize}
procedure TWinControl.ResizeDelayedAutoSizeChildren;
var
@ -7777,8 +7784,7 @@ begin
' -> New=',Dbgs(Bounds(ALeft,ATop,AWidth,AHeight))]);
{$ENDIF}
inherited SetBounds(ALeft, ATop, AWidth, AHeight);
if FUseDockManager and (DockManager <> nil) then
DockManager.ResetBounds(False);
//DebugLn(['TWinControl.SetBounds ',DbgSName(Self),' FUseDockManager=',FUseDockManager,' ',DbgSName(DockManager)]);
finally
{$IFDEF OldAutoSize}
UnlockRealizeBounds;