SourceEditor: Refactor, Clean-up

git-svn-id: trunk@24769 -
This commit is contained in:
martin 2010-04-20 23:08:53 +00:00
parent c0c2421905
commit c1060830fd
2 changed files with 9 additions and 6 deletions

View File

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

View File

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