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> <SearchPaths>
<IncludeFiles Value="$(ProjOutDir)\"/> <IncludeFiles Value="$(ProjOutDir)\"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
<LCLWidgetType Value="win32"/>
</SearchPaths> </SearchPaths>
<CodeGeneration>
<TargetOS Value="Win32"/>
</CodeGeneration>
<Other> <Other>
<CompilerPath Value="$(CompPath)"/> <CompilerPath Value="$(CompPath)"/>
</Other> </Other>

View File

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

View File

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

View File

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

View File

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