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); PkgBoss.OpenProjectDependencies(Project1,true);
Project1.DefineTemplates.AllChanged; Project1.DefineTemplates.AllChanged;
//DebugLn('TMainIDE.DoCompleteLoadingProjectInfo ',Project1.IDAsString);
Project1.DefineTemplates.Active:=true; Project1.DefineTemplates.Active:=true;
Result:=mrOk; Result:=mrOk;
end; end;

View File

@ -799,7 +799,7 @@ end;
function TUnitInfo.CreateUnitName: string; function TUnitInfo.CreateUnitName: string;
begin begin
Result:=UnitName; Result:=UnitName;
if (Result='') and FilenameIsPascalUnit(Filename) then if (Result='') and FilenameIsPascalSource(Filename) then
Result:=ExtractFilenameOnly(Filename); Result:=ExtractFilenameOnly(Filename);
end; end;
@ -1093,7 +1093,7 @@ end;
procedure TUnitInfo.UpdateSourceDirectoryReference; procedure TUnitInfo.UpdateSourceDirectoryReference;
begin begin
FSourceDirNeedReference:=IsPartOfProject and (FilenameIsPascalUnit(Filename)); FSourceDirNeedReference:=IsPartOfProject and (FilenameIsPascalSource(Filename));
if (not AutoReferenceSourceDir) or (FProject=nil) then exit; if (not AutoReferenceSourceDir) or (FProject=nil) then exit;
if FSourceDirNeedReference then begin if FSourceDirNeedReference then begin
if not SourceDirectoryReferenced 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. // create new float dock site and dock this control into it.
if Result then begin if Result then begin
FloatHost := CreateFloatingDockSite(TheScreenRect); FloatHost := CreateFloatingDockSite(TheScreenRect);
FloatHost.Visible := true;
//debugln('TControl.ManualFloat A '+Name,':',ClassName,' ',dbgs(TheScreenRect),' FloatHost=',dbgs(FloatHost<>nil)); //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)) Dock(FloatHost,Rect(0,0,FloatHost.ClientWidth,FloatHost.ClientHeight))
else end else
Dock(nil,TheScreenRect); Dock(nil,TheScreenRect);
end; end;
end; end;

View File

@ -507,7 +507,9 @@ begin
// calculate how much the CurResizeControl can be enlarged // calculate how much the CurResizeControl can be enlarged
CurMaxEnlarge:=Max(0,GetControlConstraintsMaxSize(CurResizeControl) CurMaxEnlarge:=Max(0,GetControlConstraintsMaxSize(CurResizeControl)
-GetControlSize(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 // apply to the offset boundaries
if (CurResizeControl.AnchorSide[akLeft].Control=Self) if (CurResizeControl.AnchorSide[akLeft].Control=Self)

View File

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

View File

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