fixed treating .lpr as source in project, fixed splitter anchored to multiple controls

git-svn-id: trunk@8182 -
This commit is contained in:
mattias 2005-11-17 19:06:13 +00:00
parent c7ee52ef9c
commit a62ae95299
6 changed files with 38 additions and 13 deletions

View File

@ -5009,6 +5009,7 @@ begin
PkgBoss.OpenProjectDependencies(Project1,true);
Project1.DefineTemplates.AllChanged;
//DebugLn('TMainIDE.DoCompleteLoadingProjectInfo ',Project1.IDAsString);
Project1.DefineTemplates.Active:=true;
Result:=mrOk;
end;

View File

@ -799,7 +799,7 @@ end;
function TUnitInfo.CreateUnitName: string;
begin
Result:=UnitName;
if (Result='') and FilenameIsPascalUnit(Filename) then
if (Result='') and FilenameIsPascalSource(Filename) then
Result:=ExtractFilenameOnly(Filename);
end;
@ -1093,7 +1093,7 @@ end;
procedure TUnitInfo.UpdateSourceDirectoryReference;
begin
FSourceDirNeedReference:=IsPartOfProject and (FilenameIsPascalUnit(Filename));
FSourceDirNeedReference:=IsPartOfProject and (FilenameIsPascalSource(Filename));
if (not AutoReferenceSourceDir) or (FProject=nil) then exit;
if FSourceDirNeedReference then begin
if not SourceDirectoryReferenced then begin

View File

@ -3121,11 +3121,12 @@ begin
// create new float dock site and dock this control into it.
if Result then begin
FloatHost := CreateFloatingDockSite(TheScreenRect);
FloatHost.Visible := true;
//debugln('TControl.ManualFloat A '+Name,':',ClassName,' ',dbgs(TheScreenRect),' FloatHost=',dbgs(FloatHost<>nil));
if FloatHost<>nil then
if FloatHost<>nil then begin
// => dock this control into it.
FloatHost.Visible := true;
Dock(FloatHost,Rect(0,0,FloatHost.ClientWidth,FloatHost.ClientHeight))
else
end else
Dock(nil,TheScreenRect);
end;
end;

View File

@ -507,7 +507,9 @@ begin
// calculate how much the CurResizeControl can be enlarged
CurMaxEnlarge:=Max(0,GetControlConstraintsMaxSize(CurResizeControl)
-GetControlSize(CurResizeControl));
//debugln('TCustomSplitter.MouseMove ',DbgSName(Self),' CurResizeControl=',DbgSName(CurResizeControl),' CurMaxShrink=',dbgs(CurMaxShrink),' CurMaxEnlarge=',dbgs(CurMaxEnlarge));
if CurMaxEnlarge=0 then
CurMaxEnlarge:=GetParentsClientSize;
//debugln('TCustomSplitter.MouseMove ',DbgSName(Self),' CurResizeControl=',DbgSName(CurResizeControl),' CurMaxShrink=',dbgs(CurMaxShrink),' CurMaxEnlarge=',dbgs(CurMaxEnlarge),' ',dbgs(GetControlConstraintsMaxSize(CurResizeControl)));
// apply to the offset boundaries
if (CurResizeControl.AnchorSide[akLeft].Control=Self)

View File

@ -198,7 +198,7 @@ begin
// enable Undock button, if Control is docked
Dlg.UndockGroupBox.Enabled:=(Control.Parent<>nil)
and (Control.Parent<>Control.HostDockSite);
and (Control.Parent.ControlCount>1);
if Dlg.ShowModal=mrOk then begin
// dock or undock

View File

@ -705,6 +705,7 @@ var
i: Integer;
CurControl: TControl;
begin
DebugLn('TAnchoredDockManager.DeleteSideSplitter Splitter=',DbgSName(Splitter),' Side=',dbgs(ord(Side)),' NewAnchorControl=',DbgSName(NewAnchorControl));
SplitterParent:=Splitter.Parent;
SplitterParent.DisableAlign;
try
@ -771,6 +772,7 @@ var
i: Integer;
CurControl: TControl;
begin
DebugLn('TAnchoredDockManager.CombineSpiralSplitterPair Splitter1=',DbgSName(Splitter1),dbgs(Splitter1.BoundsRect),' Splitter2=',DbgSName(Splitter2),dbgs(Splitter2.BoundsRect));
// check splitters have the same Parent
ParentControl:=Splitter1.Parent;
if (ParentControl=nil) then
@ -820,6 +822,7 @@ procedure TAnchoredDockManager.DeletePage(Page: TLazDockPage);
var
Pages: TLazDockPages;
begin
DebugLn('TAnchoredDockManager.DeletePage Page=',DbgSName(Page));
Pages:=Page.PageControl;
Page.Free;
if Pages.PageCount=0 then
@ -828,6 +831,7 @@ end;
procedure TAnchoredDockManager.DeletePages(Pages: TLazDockPages);
begin
DebugLn('TAnchoredDockManager.DeletePages Pages=',DbgSName(Pages));
if Pages.Parent<>nil then
UndockControl(Pages,false);
Pages.Free;
@ -835,6 +839,7 @@ end;
procedure TAnchoredDockManager.DeleteDockForm(ADockForm: TLazDockForm);
begin
DebugLn('TAnchoredDockManager.DeleteDockForm ADockForm=',DbgSName(ADockForm));
if ADockForm.Parent<>nil then
UndockControl(ADockForm,false);
ADockForm.Free;
@ -923,6 +928,7 @@ var
DropCtlPage: TLazDockPage;
NewPageIndex: Integer;
NewPage: TLazDockPage;
NewParent: TLazDockForm;
begin
if Control.Parent<>nil then
RaiseGDBException('TAnchoredDockManager.InsertControl Control.Parent<>nil');
@ -939,16 +945,25 @@ begin
// make sure, there is a parent HostSite
if DropCtl.Parent=nil then begin
DropCtl.FloatingDockSiteClass:=TLazDockForm;
DropCtl.ManualFloat(DropCtl.BoundsRect);
if DropCtl.Parent=nil then begin
RaiseGDBException('TAnchoredDockManager.InsertControl unable to create HostDockSite for DropCtl');
end;
// create a TLazDockForm as new parent
NewParent:=TLazDockForm.Create(Application);
NewParent.BoundsRect:=DropCtl.BoundsRect;
DropCtl.Parent:=NewParent;
// init anchors of DropCtl
DropCtl.Align:=alNone;
for a:=Low(TAnchorKind) to High(TAnchorKind) do
DropCtl.AnchorParallel(a,0,DropCtl.Parent);
DropCtl.Anchors:=[akLeft,akTop,akRight,akBottom];
NewParent.Visible:=true;
//DebugLn('TAnchoredDockManager.DockControl DropCtl=',DbgSName(DropCtl),' NewParent.BoundsRect=',dbgs(NewParent.BoundsRect));
end else begin
if (DropCtl.Parent is TLazDockForm) then begin
// ok
end else if (DropCtl.Parent is TLazDockPage) then begin
// ok
end else begin
RaiseGDBException('TAnchoredDockManager.InsertControl DropCtl has invalid parent');
end;
end;
DropCtl.Parent.DisableAlign;
@ -1167,9 +1182,14 @@ var
procedure DoFinallyForParent;
var
OldParentControl: TWinControl;
NewBounds: TRect;
NewOrigin: TPoint;
begin
if Float then begin
Control.ManualFloat(Control.BoundsRect);
NewBounds:=Control.BoundsRect;
NewOrigin:=Control.ControlOrigin;
OffsetRect(NewBounds,NewOrigin.X,NewOrigin.Y);
Control.ManualFloat(NewBounds);
end else begin
Control.Parent:=nil;
end;
@ -1214,6 +1234,7 @@ begin
// => this splitter is needed, can not be deleted.
break;
end;
dec(i);
end;
if i<0 then begin
// this splitter is not needed anymore