diff --git a/components/compilers/c/lazcutil.pas b/components/compilers/c/lazcutil.pas index 1a1f921bb6..b4f75cd1a2 100644 --- a/components/compilers/c/lazcutil.pas +++ b/components/compilers/c/lazcutil.pas @@ -99,7 +99,7 @@ begin Scanner.Name:='GCC'; IDEMsgScanners.RegisterType(Scanner); CSrcEditCompletion:=TCSrcEditCompletion.Create(nil); - SourceEditorWindow.RegisterCompletionPlugin(CSrcEditCompletion); + SourceEditorManagerIntf.RegisterCompletionPlugin(CSrcEditCompletion); end; { TGCCMessageScanner } diff --git a/components/editortoolbar/editortoolbar_impl.pas b/components/editortoolbar/editortoolbar_impl.pas index 1d532b7c54..b07a8c49d2 100644 --- a/components/editortoolbar/editortoolbar_impl.pas +++ b/components/editortoolbar/editortoolbar_impl.pas @@ -141,9 +141,10 @@ procedure TEditorToolbar.InitEditorToolBar; var T: TJumpType; begin - if not Assigned(W) then + if not Assigned(W) and Assigned(SourceEditorManagerIntf.ActiveSourceWindow) then begin - W := SourceEditorWindow; + {$note Todo, hook SourceEditorManager to detect open/close forms} + W := SourceEditorManagerIntf.ActiveSourceWindow; // TODO: each window TB := nil; CfgButton := nil; CreateEditorToolBar(W, TB); @@ -284,7 +285,7 @@ end; procedure Register; begin - if (SourceEditorWindow <> nil) then + if (SourceEditorManagerIntf <> nil) then gEditorToolbar.InitEditorToolBar; end; diff --git a/components/editortoolbar/jumpto_impl.pas b/components/editortoolbar/jumpto_impl.pas index 41f20b06f0..9bfd9e05a2 100644 --- a/components/editortoolbar/jumpto_impl.pas +++ b/components/editortoolbar/jumpto_impl.pas @@ -88,7 +88,7 @@ begin ,[ofRegularFile,ofUseCache]) = mrOk; if Result then begin - SrcEditor := SourceEditorWindow.ActiveEditor; + SrcEditor := SourceEditorManagerIntf.ActiveEditor; if Assigned(SrcEditor) then SrcEditor.EditorControl.SetFocus; end; @@ -108,7 +108,7 @@ begin if not LazarusIDE.BeginCodeTools then Exit; //==> - SrcEditor := SourceEditorWindow.ActiveEditor; + SrcEditor := SourceEditorManagerIntf.ActiveEditor; if not Assigned(SrcEditor) then Exit; //==> diff --git a/components/h2pas/h2pasdlg.pas b/components/h2pas/h2pasdlg.pas index f06754df4c..f11b4f1eb4 100644 --- a/components/h2pas/h2pasdlg.pas +++ b/components/h2pas/h2pasdlg.pas @@ -716,7 +716,7 @@ procedure TH2PasDialog.OnShowSrcEditSection(Sender: TObject); var SrcEdit: TSourceEditorInterface; begin - SrcEdit:=SourceEditorWindow.ActiveEditor; + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; SrcEditSection.Visible:=(SrcEdit<>nil) and Converter.FileIsRelated(SrcEdit.FileName); //DebugLn(['TH2PasDialog.OnShowSrcEditSection ',SrcEditSection.Visible]); @@ -729,7 +729,7 @@ var s: String; begin //DebugLn(['TH2PasDialog.OnAddSearchAndReplaceBeforeH2PasClick']); - SrcEdit:=SourceEditorWindow.ActiveEditor; + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; if SrcEdit=nil then exit; MainPageControl.ActivePage:=PreH2PasTabSheet; ShowOnTop; diff --git a/components/jcf2/IdePlugin/lazarus/jcfidemain.pas b/components/jcf2/IdePlugin/lazarus/jcfidemain.pas index e2ccd53f57..565433b937 100644 --- a/components/jcf2/IdePlugin/lazarus/jcfidemain.pas +++ b/components/jcf2/IdePlugin/lazarus/jcfidemain.pas @@ -114,13 +114,13 @@ end; procedure TJcfIdeMain.DoFormatCurrentIDEWindow(Sender: TObject); begin - if (SourceEditorWindow = nil) or (SourceEditorWindow.ActiveEditor = nil) then + if (SourceEditorManagerIntf= nil) or (SourceEditorManagerIntf.ActiveEditor = nil) then begin LogIdeMessage('', 'No current window', mtInputError, -1, -1); exit; end; - ConvertEditor(SourceEditorWindow.ActiveEditor); + ConvertEditor(SourceEditorManagerIntf.ActiveEditor); end; procedure TJcfIdeMain.ConvertEditor(const pciEditor: TSourceEditorInterface); @@ -169,15 +169,15 @@ var begin MakeEditorConverter; - if (SourceEditorWindow = nil) then + if (SourceEditorManagerIntf = nil) then Exit; ClearToolMessages; fcEditorConverter.BeforeConvert; - for liLoop := 0 to SourceEditorWindow.Count - 1 do + for liLoop := 0 to SourceEditorManagerIntf.SourceEditorCount - 1 do begin - lciEditor := SourceEditorWindow.Items[liLoop]; + lciEditor := SourceEditorManagerIntf.SourceEditors[liLoop]; // check that it's open, and a .pas or .dpr if (lciEditor <> nil) and (FileIsAllowedType(lciEditor.FileName)) then diff --git a/components/lazsvnpkg/lazsvnintf.pas b/components/lazsvnpkg/lazsvnintf.pas index a36832e7ce..ec6d041cd7 100644 --- a/components/lazsvnpkg/lazsvnintf.pas +++ b/components/lazsvnpkg/lazsvnintf.pas @@ -169,7 +169,7 @@ begin if IsActive and (Repo <> '') then begin - SrcFile := SourceEditorWindow.ActiveEditor.FileName; + SrcFile := SourceEditorManagerIntf.ActiveEditor.FileName; if LazarusIDE.ActiveProject.FindFile(SrcFile, [pfsfOnlyEditorFiles]).IsPartOfProject then ShowSVNDiffFrm('-r PREV', '"' + SrcFile + '"') diff --git a/components/messagecomposer/messagecomposer.pas b/components/messagecomposer/messagecomposer.pas index 6eaf49fc81..c8e025758d 100644 --- a/components/messagecomposer/messagecomposer.pas +++ b/components/messagecomposer/messagecomposer.pas @@ -148,8 +148,8 @@ var FormMessagesComposer: TFormMessagesComposer; BaseStart: string; begin BaseStart := EmptyStr; - for indx := 1 to SourceEditorWindow.ActiveEditor.CursorTextXY.x- - Length(SourceEditorWindow.ActiveEditor.Selection)-1 do + for indx := 1 to SourceEditorManagerIntf.ActiveEditor.CursorTextXY.x- + Length(SourceEditorManagerIntf.ActiveEditor.Selection)-1 do BaseStart := BaseStart+#32; ListSrcMessages := TStringList.Create; @@ -168,14 +168,14 @@ var FormMessagesComposer: TFormMessagesComposer; begin Assert(Sender <> nil); // removes compiler warning - if SourceEditorWindow.ActiveEditor = nil then exit; + if SourceEditorManagerIntf.ActiveEditor = nil then exit; FormMessagesComposer := TFormMessagesComposer.Create(nil); try FormMessagesComposer.ShowModal; if FormMessagesComposer.ModalResult = mrOK then begin FormMessagesComposer.GetMessageForSource.Execute; FormatSrcMessage; - SourceEditorWindow.ActiveEditor.Selection := srcMessage; + SourceEditorManagerIntf.ActiveEditor.Selection := srcMessage; end; finally FormMessagesComposer.Free; diff --git a/components/prettyformat/pfidesource.pas b/components/prettyformat/pfidesource.pas index 599c912a3d..de262f04ae 100644 --- a/components/prettyformat/pfidesource.pas +++ b/components/prettyformat/pfidesource.pas @@ -97,7 +97,7 @@ Var begin if Sender=nil then ; - E:=SourceEditorWindow.ActiveEditor; + E:=SourceEditorManagerIntf.ActiveEditor; If (E=Nil) or (Not E.SelectionAvailable) then Exit; S1:=TStringStream.Create(E.Selection); @@ -124,7 +124,7 @@ Var begin if Sender=nil then ; - E:=SourceEditorWindow.ActiveEditor; + E:=SourceEditorManagerIntf.ActiveEditor; If (E=Nil) then Exit; S1:=TMemoryStream.Create; diff --git a/components/prettymessages/hidefpchints.pas b/components/prettymessages/hidefpchints.pas index 361f0b4739..1f0c740dc8 100644 --- a/components/prettymessages/hidefpchints.pas +++ b/components/prettymessages/hidefpchints.pas @@ -161,7 +161,7 @@ begin exit; end; // find the source editor page - SrcEdit:=SourceEditorWindow.SourceEditorIntfWithFilename(Filename); + SrcEdit:=SourceEditorManagerIntf.SourceEditorIntfWithFilename(Filename); if SrcEdit=nil then begin DebugLn(['THideFPCHintWorker.Execute unable to find the file in the source editor of ',Filename]); exit; diff --git a/components/printers/design/ideprinting.pas b/components/printers/design/ideprinting.pas index 0fc7f0601f..ecee1d2767 100644 --- a/components/printers/design/ideprinting.pas +++ b/components/printers/design/ideprinting.pas @@ -84,9 +84,9 @@ var R : TModalResult; begin - If Not Assigned(SourceEditorWindow) or Not Assigned(SourceEditorWindow.ActiveEditor) then + If Not Assigned(SourceEditorManagerIntf) or Not Assigned(SourceEditorManagerIntf.ActiveEditor) then Exit; - If (SourceEditorWindow.ActiveEditor.Selection='') then + If (SourceEditorManagerIntf.ActiveEditor.Selection='') then R:=mrYesToAll else R:=QuestionDlg(SPrintSources,SPrintWhat,mtInformation,[mrYesToAll,SPrintFile,mrYes,SPrintSelection,mrCancel],0); @@ -95,8 +95,8 @@ begin L:=TStringList.Create; try case R of - mrYesToAll : L.Assign(SourceEditorWindow.ActiveEditor.Lines); - mrYes : L.Text:=SourceEditorWindow.ActiveEditor.Selection; + mrYesToAll : L.Assign(SourceEditorManagerIntf.ActiveEditor.Lines); + mrYes : L.Text:=SourceEditorManagerIntf.ActiveEditor.Selection; end; sp := TSourcePrinter.Create; try diff --git a/components/sqldb/sqlstringspropertyeditordlg.pas b/components/sqldb/sqlstringspropertyeditordlg.pas index 5f1212e72f..1fbb2d08cc 100644 --- a/components/sqldb/sqlstringspropertyeditordlg.pas +++ b/components/sqldb/sqlstringspropertyeditordlg.pas @@ -63,8 +63,8 @@ resourcestring constructor TSQLStringsPropertyEditorDlg.Create(AOwner: TComponent); begin inherited Create(AOwner); - SourceEditorWindow.GetEditorControlSettings(SQLEditor); - SourceEditorWindow.GetHighlighterSettings(SQLHighlighter); + SourceEditorManagerIntf.GetEditorControlSettings(SQLEditor); + SourceEditorManagerIntf.GetHighlighterSettings(SQLHighlighter); EditorTabSheet.Caption := SSQLTabCaption; ResultTabSheet.Caption := SResultTabCaption; end; diff --git a/converter/chgencodingdlg.pas b/converter/chgencodingdlg.pas index e9c56890f9..cac5704bc1 100644 --- a/converter/chgencodingdlg.pas +++ b/converter/chgencodingdlg.pas @@ -191,7 +191,7 @@ begin Buf:=CodeToolBoss.LoadFile(Filename,true,false); if not Buf.ReadOnly then begin OldEncoding:=Buf.DiskEncoding; - SrcEdit:=SourceEditorWindow.SourceEditorIntfWithFilename(Filename); + SrcEdit:=SourceEditorManagerIntf.SourceEditorIntfWithFilename(Filename); HasChanged:=true; if SrcEdit<>nil then begin DebugLn(['TChgEncodingDialog.ApplyButtonClick changing in source editor: ',Filename]); diff --git a/examples/codetools/jumptoimplementation/codetoolsexample1.pas b/examples/codetools/jumptoimplementation/codetoolsexample1.pas index ccb0dc4eb4..503a6e6226 100644 --- a/examples/codetools/jumptoimplementation/codetoolsexample1.pas +++ b/examples/codetools/jumptoimplementation/codetoolsexample1.pas @@ -51,7 +51,7 @@ begin if not LazarusIDE.BeginCodeTools then exit; // get active source editor - SrcEditor:=SourceEditorWindow.ActiveEditor; + SrcEditor:=SourceEditorManagerIntf.ActiveEditor; if SrcEditor=nil then exit; CodeBuffer:=SrcEditor.CodeToolsBuffer as TCodeBuffer; diff --git a/ide/abstractsmethodsdlg.pas b/ide/abstractsmethodsdlg.pas index 04095fa616..101b41dec3 100644 --- a/ide/abstractsmethodsdlg.pas +++ b/ide/abstractsmethodsdlg.pas @@ -109,7 +109,7 @@ begin // get cursor position ErrMsg:=lisSAMCursorIsNotInAClassDeclaration; - SrcEdit:=SourceEditorWindow.ActiveEditor; + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; if SrcEdit=nil then exit; Code:=TCodeBuffer(SrcEdit.CodeToolsBuffer); if Code=nil then exit; diff --git a/ide/buildmanager.pas b/ide/buildmanager.pas index 1e0025cd38..2fd6fdbb75 100644 --- a/ide/buildmanager.pas +++ b/ide/buildmanager.pas @@ -1433,8 +1433,8 @@ function TBuildManager.OnRunCompilerWithOptions( ExtTool: TIDEExternalToolOptions; CompOptions: TBaseCompilerOptions ): TModalResult; begin - if SourceEditorWindow<>nil then - SourceEditorWindow.ClearErrorLines; + if SourceEditorManagerIntf<>nil then + SourceEditorManagerIntf.ClearErrorLines; Result:=EnvironmentOptions.ExternalTools.Run(ExtTool,GlobalMacroList, nil,CompOptions); if LazarusIDE<>nil then diff --git a/ide/codebrowser.pas b/ide/codebrowser.pas index 1f1c9a7e54..64e3b895cd 100644 --- a/ide/codebrowser.pas +++ b/ide/codebrowser.pas @@ -603,7 +603,7 @@ begin Format(lisUseUnitInUnit, [CurUnitName, SrcEditUnitName]); if (Node is TCodeBrowserNode) and (Identifier<>'') then begin EnableUseIdentifierInCurUnit:=true; - SrcEdit:=SourceEditorWindow.ActiveEditor; + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; UseIdentifierInCurUnitMenuItem.Caption:= Format(lisUseIdentifierInAt, [Identifier, ExtractFilename( SrcEdit.FileName), dbgs(SrcEdit.CursorScreenXY)]); @@ -983,7 +983,7 @@ begin List:=TFPList.Create; CodeMarker:=nil; try - SrcEdit:=SourceEditorWindow.ActiveEditor; + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; if SrcEdit=nil then exit; InsertStartPos:=SrcEdit.CursorTextXY; Code:=TCodeBuffer(SrcEdit.CodeToolsBuffer); @@ -2567,7 +2567,7 @@ begin FileOwner:=nil; UnitCode:=nil; Result:=false; - SrcEdit:=SourceEditorWindow.ActiveEditor; + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; if SrcEdit=nil then exit; Code:=CodeToolBoss.GetMainCode(TCodeBuffer(SrcEdit.CodeToolsBuffer)); if Code=nil then exit; @@ -2589,7 +2589,7 @@ var i: Integer; begin Result:=nil; - SrcEdit:=SourceEditorWindow.ActiveEditor; + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; if SrcEdit=nil then exit; Owners:=PkgBoss.GetOwnersOfUnit(SrcEdit.FileName); try @@ -2740,7 +2740,7 @@ begin Result:=''; if UseFCLAsDefault then Result:=PackageGraph.FCLPackage.Name; - SrcEdit:=SourceEditorWindow.ActiveEditor; + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; if SrcEdit=nil then exit; Code:=TCodeBuffer(SrcEdit.CodeToolsBuffer); if Code=nil then exit; diff --git a/ide/codecontextform.pas b/ide/codecontextform.pas index fa0d489994..57f8ddf2a4 100644 --- a/ide/codecontextform.pas +++ b/ide/codecontextform.pas @@ -96,7 +96,7 @@ var CodeContexts: TCodeContextInfo; begin Result := False; - LogCaretXY := SourceEditorWindow.ActiveEditor.CursorTextXY; + LogCaretXY := SourceEditorManagerIntf.ActiveEditor.CursorTextXY; CodeContexts := nil; try if not CodeToolBoss.FindCodeContext(Code, LogCaretXY.X, LogCaretXY.Y, CodeContexts) or @@ -138,14 +138,14 @@ var begin if (Key=VK_ESCAPE) and (Shift=[]) then Hide - else if SourceEditorWindow<>nil then begin - SrcEdit:=SourceEditorWindow.ActiveEditor; + else if SourceEditorManagerIntf<>nil then begin + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; if SrcEdit=nil then Hide else begin // redirect keys TWinControlAccess(SrcEdit.EditorControl).KeyDown(Key,Shift); - SetActiveWindow(SourceEditorWindow.Handle); + SetActiveWindow(SourceEditorManagerIntf.ActiveSourceWindow.Handle); end; end; end; @@ -166,7 +166,7 @@ var SrcEdit: TSourceEditorInterface; ASynEdit: TCustomSynEdit; begin - SrcEdit:=SourceEditorWindow.ActiveEditor; + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; if SrcEdit=nil then begin Hide; end else begin @@ -220,8 +220,8 @@ begin NewParameterIndex:=-1; try // check Source Editor - if SourceEditorWindow=nil then exit; - SrcEdit:=SourceEditorWindow.ActiveEditor; + if SourceEditorManagerIntf=nil then exit; + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; if (SrcEdit=nil) or (SrcEdit.CodeToolsBuffer<>ProcNameCodeXYPos.Code) then exit; if SrcEdit.TopLine<>FSourceEditorTopIndex then exit; @@ -543,7 +543,7 @@ var DrawHeight: LongInt; ScreenXY: TPoint; begin - SrcEdit:=SourceEditorWindow.ActiveEditor; + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; if SrcEdit=nil then exit; // calculate the position of the context in the source editor @@ -560,7 +560,7 @@ begin FSourceEditorTopIndex:=SrcEdit.TopLine; // calculate size of hints - DrawWidth:=SourceEditorWindow.ClientWidth; + DrawWidth:=SourceEditorManagerIntf.ActiveSourceWindow.ClientWidth; DrawHeight:=ClientXY.Y; DrawHints(DrawWidth,DrawHeight,false); if DrawWidth<20 then DrawWidth:=20; diff --git a/ide/codeexplorer.pas b/ide/codeexplorer.pas index 329b4be7a0..5184324fec 100644 --- a/ide/codeexplorer.pas +++ b/ide/codeexplorer.pas @@ -529,7 +529,7 @@ begin Refresh(true); exit; end; - ExecuteIDECommand(SourceEditorWindow,ecRenameIdentifier); + ExecuteIDECommand(SourceEditorManagerIntf.ActiveSourceWindow, ecRenameIdentifier); end; procedure TCodeExplorerView.TreePopupmenuPopup(Sender: TObject); @@ -1912,7 +1912,7 @@ begin DebugLn(['TCodeExplorerView.JumpToSelection AAA1']); if Assigned(OnJumpToCode) then OnJumpToCode(Self,Caret.Code.Filename,Point(Caret.X,Caret.Y),NewTopLine); - SrcEdit:=SourceEditorWindow.ActiveEditor; + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; DebugLn(['TCodeExplorerView.JumpToSelection AAA2 ',SrcEdit.FileName,' ',dbgs(SrcEdit.CursorTextXY),' X=',Caret.X,' Y=',Caret.Y]); // check if jump was successful if (SrcEdit.CodeToolsBuffer<>CodeBuffer) @@ -1928,7 +1928,7 @@ var xy: TPoint; begin Result:=false; - SrcEdit:=SourceEditorWindow.ActiveEditor; + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; if SrcEdit=nil then exit; xy:=SrcEdit.CursorTextXY; Result:=SelectCodePosition(TCodeBuffer(SrcEdit.CodeToolsBuffer),xy.x,xy.y); diff --git a/ide/compileroptions.pp b/ide/compileroptions.pp index 04941ab642..5e5f541541 100644 --- a/ide/compileroptions.pp +++ b/ide/compileroptions.pp @@ -3642,8 +3642,8 @@ begin exit; end; - if SourceEditorWindow<>nil then - SourceEditorWindow.ClearErrorLines; + if SourceEditorManagerIntf<>nil then + SourceEditorManagerIntf.ClearErrorLines; SplitCmdLine(Command,ProgramFilename,Params); if not FilenameIsAbsolute(ProgramFilename) then begin diff --git a/ide/debugmanager.pas b/ide/debugmanager.pas index c9a8431e09..af91d20b40 100644 --- a/ide/debugmanager.pas +++ b/ide/debugmanager.pas @@ -1360,7 +1360,7 @@ var SE: TSourceEditor; WatchVar: String; begin - SE := SourceNotebook.GetActiveSE; + SE := SourceEditorManager.GetActiveSE; if Assigned(SE) then begin @@ -1516,24 +1516,24 @@ begin end; // unmark execution line - if (FDebugger.State <> dsPause) and (SourceNotebook <> nil) + if (FDebugger.State <> dsPause) and (SourceEditorManager <> nil) then begin - Editor := SourceNotebook.GetActiveSE; + Editor := SourceEditorManager.GetActiveSE; if Editor <> nil then Editor.ExecutionLine := -1; end; if ((FDebugger.State = dsPause) or ((FDebugger.State = dsRun) and (OldState = dsInit)) - ) and (SourceNotebook <> nil) + ) and (SourceEditorManager <> nil) then begin - Editor := SourceNotebook.GetActiveSE; + Editor := SourceEditorManager.GetActiveSE; if (Editor <> nil) and not Editor.HasExecutionMarks then Editor.FillExecutionMarks; end; - if not (FDebugger.State in [dsRun, dsPause]) and (SourceNotebook <> nil) then - SourceNotebook.ClearExecutionMarks; + if not (FDebugger.State in [dsRun, dsPause]) and (SourceEditorManager <> nil) then + SourceEditorManager.ClearExecutionMarks; case FDebugger.State of dsError: begin @@ -1633,10 +1633,10 @@ begin end; // clear old error and execution lines - if SourceNotebook <> nil + if SourceEditorManager <> nil then begin - SourceNotebook.ClearExecutionLines; - SourceNotebook.ClearErrorLines; + SourceEditorManager.ClearExecutionLines; + SourceEditorManager.ClearErrorLines; end; // jump editor to execution line FocusEditor := (FCurrentBreakPoint = nil) or (FCurrentBreakPoint.AutoContinueTime = 0); @@ -1644,8 +1644,8 @@ begin then exit; // mark execution line - if SourceNotebook <> nil - then Editor := SourceNotebook.GetActiveSE + if SourceEditorManager <> nil + then Editor := SourceEditorManager.GetActiveSE else Editor := nil; if Editor <> nil @@ -1790,10 +1790,10 @@ var TheDialog: TIDEInspectDlg; begin TheDialog := TIDEInspectDlg(FDialogs[ddtInspect]); - if SourceNotebook.GetActiveSE.SelectionAvailable then - TheDialog.Execute(SourceNotebook.GetActiveSE.Selection) + if SourceEditorManager.GetActiveSE.SelectionAvailable then + TheDialog.Execute(SourceEditorManager.GetActiveSE.Selection) else - TheDialog.Execute(SourceNotebook.GetActiveSE.GetOperandAtCurrentCaret); + TheDialog.Execute(SourceEditorManager.GetActiveSE.GetOperandAtCurrentCaret); end; procedure TDebugManager.InitCallStackDlg; @@ -1810,10 +1810,10 @@ var TheDialog: TEvaluateDlg; begin TheDialog := TEvaluateDlg(FDialogs[ddtEvaluate]); - if SourceNotebook.GetActiveSE.SelectionAvailable then - TheDialog.FindText := SourceNotebook.GetActiveSE.Selection + if SourceEditorManager.GetActiveSE.SelectionAvailable then + TheDialog.FindText := SourceEditorManager.GetActiveSE.Selection else - TheDialog.FindText := SourceNotebook.GetActiveSE.GetOperandAtCurrentCaret; + TheDialog.FindText := SourceEditorManager.GetActiveSE.GetOperandAtCurrentCaret; end; constructor TDebugManager.Create(TheOwner: TComponent); @@ -2066,7 +2066,7 @@ var CurBreakPoint: TIDEBreakPoint; SrcFilename: String; begin - if (AnUnitInfo.EditorIndex < 0) or Destroying then exit; + if (AnUnitInfo.EditorComponent = nil) or Destroying then exit; ASrcEdit := TSourceEditor(AnUnitInfo.EditorComponent); // set breakpoints for this unit SrcFilename:=AnUnitInfo.Filename; diff --git a/ide/emptymethodsdlg.pas b/ide/emptymethodsdlg.pas index bebf6475c7..395235a105 100644 --- a/ide/emptymethodsdlg.pas +++ b/ide/emptymethodsdlg.pas @@ -104,7 +104,7 @@ begin // get cursor position ErrMsg:=lisSAMCursorIsNotInAClassDeclaration; - SrcEdit:=SourceEditorWindow.ActiveEditor; + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; if SrcEdit=nil then exit; Code:=TCodeBuffer(SrcEdit.CodeToolsBuffer); if Code=nil then exit; diff --git a/ide/findoverloadsdlg.pas b/ide/findoverloadsdlg.pas index 5eb4b8ca72..834511ceb6 100644 --- a/ide/findoverloadsdlg.pas +++ b/ide/findoverloadsdlg.pas @@ -150,7 +150,7 @@ var Code: TCodeBuffer; XY: TPoint; begin - SrcEdit:=SourceEditorWindow.ActiveEditor; + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; if SrcEdit=nil then exit(mrCancel); Code:=TCodeBuffer(SrcEdit.CodeToolsBuffer); diff --git a/ide/fpdochints.pas b/ide/fpdochints.pas index fb57547728..0bd322f96c 100644 --- a/ide/fpdochints.pas +++ b/ide/fpdochints.pas @@ -103,10 +103,10 @@ begin FHTMLHint:=''; // find current completion item - if (SourceEditorWindow=nil) or (CodeToolBoss=nil) + if (SourceEditorManagerIntf=nil) or (CodeToolBoss=nil) or (CodeToolBoss.IdentifierList=nil) then exit; - Position:=SourceEditorWindow.CompletionBoxPosition; + Position:=SourceEditorManagerIntf.CompletionBoxPosition; if (Position<0) or (Position>=CodeToolBoss.IdentifierList.GetFilteredCount) then exit; Item:=CodeToolBoss.IdentifierList.FilteredItems[Position]; diff --git a/ide/main.pp b/ide/main.pp index 631341853e..9f5783c390 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -3012,10 +3012,10 @@ begin MainIDEBar.itmHelpAboutLazarus.OnClick(Self); ecToggleBreakPoint: - SourceNotebook.ToggleBreakpointClicked(Self); + SourceEditorManager.GetActiveNotebok.ToggleBreakpointClicked(Self); ecRemoveBreakPoint: - SourceNotebook.DeleteBreakpointClicked(Self); + SourceEditorManager.GetActiveNotebok.DeleteBreakpointClicked(Self); ecProcedureList: mnuSearchProcedureList(self); diff --git a/ide/procedurelist.pas b/ide/procedurelist.pas index cb0a60870e..d634a57ce8 100644 --- a/ide/procedurelist.pas +++ b/ide/procedurelist.pas @@ -338,7 +338,7 @@ begin try LV.Items.Clear; { get active source editor } - lSrcEditor := SourceEditorWindow.ActiveEditor; + lSrcEditor := SourceEditorManagerIntf.ActiveEditor; if lSrcEditor = nil then Exit; //==> lCodeBuffer := lSrcEditor.CodeToolsBuffer as TCodeBuffer; @@ -395,7 +395,7 @@ begin cbObjects.Items.Clear; try { get active source editor } - lSrcEditor := SourceEditorWindow.ActiveEditor; + lSrcEditor := SourceEditorManagerIntf.ActiveEditor; if lSrcEditor = nil then Exit; //==> lCodeBuffer := lSrcEditor.CodeToolsBuffer as TCodeBuffer; @@ -541,10 +541,10 @@ end; procedure TProcedureListForm.FormCreate(Sender: TObject); begin - if SourceEditorWindow.ActiveEditor = nil then + if SourceEditorManagerIntf.ActiveEditor = nil then Exit; //==> - FMainFilename := SourceEditorWindow.ActiveEditor.Filename; + FMainFilename := SourceEditorManagerIntf.ActiveEditor.Filename; Caption := Caption + ExtractFileName(FMainFilename); SetupGUI; PopulateObjectsCombo; diff --git a/ide/searchfrm.pas b/ide/searchfrm.pas index fa6e6b195a..be997f62f0 100644 --- a/ide/searchfrm.pas +++ b/ide/searchfrm.pas @@ -255,8 +255,8 @@ var function FileIsOpenInSourceEditor: boolean; begin if not SrcEditValid then begin - if (TheFileName<>'') and (SourceEditorWindow<>nil) then - SrcEdit:=SourceEditorWindow.SourceEditorIntfWithFilename(TheFileName) + if (TheFileName<>'') and (SourceEditorManagerIntf<>nil) then + SrcEdit:=SourceEditorManagerIntf.SourceEditorIntfWithFilename(TheFileName) else SrcEdit:=nil; SrcEditValid:=true; diff --git a/ide/srcedithintfrm.pas b/ide/srcedithintfrm.pas index bda0bbc4ac..7759acf0e7 100644 --- a/ide/srcedithintfrm.pas +++ b/ide/srcedithintfrm.pas @@ -124,14 +124,14 @@ var begin if (Key=VK_ESCAPE) and (Shift=[]) then Hide - else if SourceEditorWindow<>nil then begin - SrcEdit:=SourceEditorWindow.ActiveEditor; + else if SourceEditorManagerIntf<>nil then begin + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; if SrcEdit=nil then Hide else begin // redirect keys TWinControlAccess(SrcEdit.EditorControl).KeyDown(Key,Shift); - SetActiveWindow(SourceEditorWindow.Handle); + SetActiveWindow(SourceEditorManagerIntf.ActiveSourceWindow.Handle); end; end; end; @@ -142,7 +142,7 @@ var SrcEdit: TSourceEditorInterface; ASynEdit: TCustomSynEdit; begin - SrcEdit:=SourceEditorWindow.ActiveEditor; + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; if SrcEdit=nil then begin Hide; end else begin @@ -278,7 +278,7 @@ begin end else begin // place near the source editor caret CurCaret:=SrcEditCaret; - SrcEdit:=SourceEditorWindow.ActiveEditor; + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; if CurCaret.Y<1 then CurCaret:=SrcEdit.CursorScreenXY; CurCaret:=SrcEdit.EditorControl.ClientToScreen(SrcEdit.ScreenToPixelPosition(CurCaret)); @@ -334,8 +334,8 @@ begin if (AnchorForm<>nil) then begin Result:=AnchorForm.Visible; end else begin - Result:=(SourceEditorWindow<>nil) - and (SourceEditorWindow.ActiveEditor<>nil); + Result:=(SourceEditorManagerIntf<>nil) + and (SourceEditorManagerIntf.ActiveEditor<>nil); end; end; diff --git a/ide/unusedunitsdlg.pas b/ide/unusedunitsdlg.pas index 1901ab467c..13f6c0d557 100644 --- a/ide/unusedunitsdlg.pas +++ b/ide/unusedunitsdlg.pas @@ -88,7 +88,7 @@ begin if not LazarusIDE.BeginCodeTools then exit; // get cursor position - SrcEdit:=SourceEditorWindow.ActiveEditor; + SrcEdit:=SourceEditorManagerIntf.ActiveEditor; if SrcEdit=nil then exit; Code:=TCodeBuffer(SrcEdit.CodeToolsBuffer); if Code=nil then exit; diff --git a/packager/packagesystem.pas b/packager/packagesystem.pas index 1ca26d0756..88c5aabf79 100644 --- a/packager/packagesystem.pas +++ b/packager/packagesystem.pas @@ -3129,8 +3129,8 @@ begin PkgCompileTool.CmdLineParams:=EffectiveCompilerParams; // clear old errors - if SourceEditorWindow<>nil then - SourceEditorWindow.ClearErrorLines; + if SourceEditorManagerIntf<>nil then + SourceEditorManagerIntf.ClearErrorLines; // compile package Result:=RunCompilerWithOptions(PkgCompileTool,APackage.CompilerOptions); diff --git a/packager/pkgmanager.pas b/packager/pkgmanager.pas index 90861d5ad9..bd49af7e8e 100644 --- a/packager/pkgmanager.pas +++ b/packager/pkgmanager.pas @@ -1451,7 +1451,7 @@ begin 'FPCDIR='+EnvironmentOptions.GetFPCSourceDirectory); // clear old errors - SourceNotebook.ClearErrorLines; + SourceEditorManager.ClearErrorLines; // compile package Result:=RunExternalTool(FPCMakeTool); @@ -3288,7 +3288,7 @@ function TPkgManager.GetPackageOfCurrentSourceEditor: TPkgFile; var SrcEdit: TSourceEditor; begin - SrcEdit:=SourceNotebook.GetActiveSE; + SrcEdit:=SourceEditorManager.GetActiveSE; if SrcEdit<>nil then begin Result:=SearchFile(SrcEdit.Filename,[],nil); end else