* AddControlToEditor

This commit is contained in:
Michaël Van Canneyt 2024-09-26 18:19:14 +02:00
parent 853cd26124
commit f613a7acf6
2 changed files with 24 additions and 0 deletions

View File

@ -312,6 +312,7 @@ type
// Editor Page Caption update
procedure AddUpdateEditorPageCaptionHandler(AEvent: TNotifyEvent; const AsLast: Boolean = True); virtual; abstract;
procedure RemoveUpdateEditorPageCaptionHandler(AEvent: TNotifyEvent); virtual; abstract;
procedure AddControlToEditor(aSourceEditor : TSourceEditorInterface; aControl : TControl; aAlign : TAlign); virtual; abstract;
property BaseCaption: String read GetBaseCaption write SetBaseCaption;
function AddStatusPanel(AnOwner: TClass; ATag: PtrUInt = 0): TSourceEditorStatusPanelInterface; virtual; abstract;

View File

@ -925,6 +925,7 @@ type
function IndexOfEditorInShareWith(AnOtherEditor: TSourceEditorInterface): Integer; override;
procedure MoveEditor(OldPageIndex, NewPageIndex: integer);
procedure MoveEditor(OldPageIndex, NewWindowIndex, NewPageIndex: integer);
procedure AddControlToEditor(aSourceEditor : TSourceEditorInterface; aControl : TControl; aAlign : TAlign); override;
procedure UpdateStatusBar;
function AddStatusPanel(AnOwner: TClass; ATag: PtrUInt = 0): TSourceEditorStatusPanelInterface; override;
@ -8505,6 +8506,28 @@ begin
Manager.ActiveEditor := Edit;
end;
procedure TSourceNotebook.AddControlToEditor(
aSourceEditor: TSourceEditorInterface; aControl: TControl; aAlign: TAlign);
var
I,lPageIndex : Integer;
TabSheet : TTabSheet;
begin
for i := 0 to EditorCount - 1 do
if Editors[i]=aSourceEditor then
begin
lPageIndex:=Editors[i].PageIndex;
TabSheet:=GetNoteBookPage(lPageIndex);
if Assigned(TabSheet) then
begin
aControl.Parent:=TabSheet;
// Force alignment
aControl.Align:=aAlign;
end;
end;
end;
procedure TSourceNotebook.CopyEditor(OldPageIndex, NewWindowIndex,
NewPageIndex: integer; Focus: Boolean = False);
var