diff --git a/ide/main.pp b/ide/main.pp index 4bf2c10638..1dd66f7337 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -5009,6 +5009,7 @@ begin PkgBoss.OpenProjectDependencies(Project1,true); Project1.DefineTemplates.AllChanged; + //DebugLn('TMainIDE.DoCompleteLoadingProjectInfo ',Project1.IDAsString); Project1.DefineTemplates.Active:=true; Result:=mrOk; end; diff --git a/ide/project.pp b/ide/project.pp index 9ada3ea3b4..87816ecc36 100644 --- a/ide/project.pp +++ b/ide/project.pp @@ -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 diff --git a/lcl/include/control.inc b/lcl/include/control.inc index c61e7f8d6d..fbebc52b8d 100644 --- a/lcl/include/control.inc +++ b/lcl/include/control.inc @@ -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; diff --git a/lcl/include/customsplitter.inc b/lcl/include/customsplitter.inc index aeb08fa5b8..d8de01d037 100644 --- a/lcl/include/customsplitter.inc +++ b/lcl/include/customsplitter.inc @@ -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) diff --git a/lcl/ldockctrl.pas b/lcl/ldockctrl.pas index 9365e2030a..8ff226dbc7 100644 --- a/lcl/ldockctrl.pas +++ b/lcl/ldockctrl.pas @@ -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 diff --git a/lcl/ldocktree.pas b/lcl/ldocktree.pas index 8ff2516bda..a2dbf32650 100644 --- a/lcl/ldocktree.pas +++ b/lcl/ldocktree.pas @@ -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