Ide/Project; SourceEditor: Start using SourceEditorManager (for multi-window handling)

git-svn-id: trunk@24045 -
This commit is contained in:
martin 2010-03-16 16:16:32 +00:00
parent 60698c0253
commit e1290c555d
30 changed files with 95 additions and 94 deletions

View File

@ -99,7 +99,7 @@ begin
Scanner.Name:='GCC';
IDEMsgScanners.RegisterType(Scanner);
CSrcEditCompletion:=TCSrcEditCompletion.Create(nil);
SourceEditorWindow.RegisterCompletionPlugin(CSrcEditCompletion);
SourceEditorManagerIntf.RegisterCompletionPlugin(CSrcEditCompletion);
end;
{ TGCCMessageScanner }

View File

@ -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;

View File

@ -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; //==>

View File

@ -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;

View File

@ -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

View File

@ -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 + '"')

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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]);

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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];

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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