mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-01 23:37:48 +02:00
SourceEditor: Refactor, Clean-up
git-svn-id: trunk@24769 -
This commit is contained in:
parent
c0c2421905
commit
c1060830fd
@ -1948,7 +1948,7 @@ end;
|
||||
procedure TMainIDE.SetupSourceNotebook;
|
||||
begin
|
||||
TSourceEditorManager.Create(OwningComponent);
|
||||
SourceEditorManager.OnWindowActivate := @OnSrcNoteBookActivated;
|
||||
SourceEditorManager.RegisterChangeEvent(semWindowFocused, @OnSrcNoteBookActivated);
|
||||
SourceEditorManager.OnAddJumpPoint := @OnSrcNoteBookAddJumpPoint;
|
||||
SourceEditorManager.OnCloseClicked := @OnSrcNotebookFileClose;
|
||||
SourceEditorManager.OnClickLink := @OnSrcNoteBookClickLink;
|
||||
|
@ -845,6 +845,7 @@ type
|
||||
function GetActiveSourceWindow: TSourceEditorWindowInterface; override;
|
||||
procedure SetActiveSourceWindow(const AValue: TSourceEditorWindowInterface); override;
|
||||
function GetSourceWindows(Index: integer): TSourceEditorWindowInterface; override;
|
||||
procedure DoWindowFocused(AWindow: TSourceNotebook); // Includes Focus to ChildControl (aka Activated)
|
||||
function GetActiveEditor: TSourceEditorInterface; override;
|
||||
procedure SetActiveEditor(const AValue: TSourceEditorInterface); override;
|
||||
procedure DoActiveEditorChanged;
|
||||
@ -1054,9 +1055,7 @@ type
|
||||
FOnToggleObjectInspClicked: TNotifyEvent;
|
||||
FOnUserCommandProcessed: TOnUserCommandProcessed;
|
||||
FOnViewJumpHistory: TNotifyEvent;
|
||||
FOnWindowActivate: TNotifyEvent;
|
||||
public
|
||||
property OnWindowActivate: TNotifyEvent read FOnWindowActivate write FOnWindowActivate;
|
||||
property OnAddJumpPoint: TOnAddJumpPoint
|
||||
read FOnAddJumpPoint write FOnAddJumpPoint;
|
||||
property OnCloseClicked: TOnCloseSrcEditor
|
||||
@ -7225,8 +7224,8 @@ begin
|
||||
inherited Activate;
|
||||
if assigned(Manager) then
|
||||
Manager.ActiveSourceWindow := self;
|
||||
if assigned(Manager) and assigned(Manager.OnWindowActivate) then
|
||||
Manager.OnWindowActivate(self);
|
||||
if assigned(Manager) then
|
||||
Manager.DoWindowFocused(Self);
|
||||
end;
|
||||
|
||||
procedure TSourceNotebook.UpdateActiveEditColors(AEditor: TSynEdit);
|
||||
@ -7661,6 +7660,11 @@ begin
|
||||
Result := TSourceEditorWindowInterface(FSourceWindowList[Index]);
|
||||
end;
|
||||
|
||||
procedure TSourceEditorManagerBase.DoWindowFocused(AWindow: TSourceNotebook);
|
||||
begin
|
||||
FChangeNotifyLists[semWindowFocused].CallNotifyEvents(FActiveWindow);
|
||||
end;
|
||||
|
||||
function TSourceEditorManagerBase.GetActiveEditor: TSourceEditorInterface;
|
||||
begin
|
||||
If FActiveWindow <> nil then
|
||||
@ -8785,7 +8789,6 @@ var
|
||||
begin
|
||||
Result := TSourceNotebook.Create(Self);
|
||||
Result.FreeNotification(self);
|
||||
Result.OnActivate := OnWindowActivate;
|
||||
Result.OnDropFiles := @OnFilesDroping;
|
||||
|
||||
for i := 1 to FUpdateLock do
|
||||
|
Loading…
Reference in New Issue
Block a user