From cfd6c96ce70763cc25e98cf2fba0d8bf973df154 Mon Sep 17 00:00:00 2001 From: Victor Blokhin Date: Sat, 4 Jun 2022 00:32:00 +0300 Subject: [PATCH] Fix TDI popup menu items (replace with File (Stream) menu actions) --- Forms/frmMain.pas | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Forms/frmMain.pas b/Forms/frmMain.pas index 98f88f8..db073bc 100644 --- a/Forms/frmMain.pas +++ b/Forms/frmMain.pas @@ -135,6 +135,14 @@ procedure TTPMainForm.ApplicationEvents1Minimize(Sender: TObject); end; procedure TTPMainForm.FormCreate(Sender: TObject); + procedure AddTdiPopupMenuItem(action: TAction); + var + menuItem: TMenuItem; + begin + menuItem := TMenuItem.Create(FTDI.PageControl.PopupMenu); + FTDI.PageControl.PopupMenu.Items.Add(menuItem); + menuItem.Action := action; + end; begin TLogBasicConfigurator.Configure(TLogNullAppender.Create('nulllogger')); TLogLogger.GetRootLogger.Level := Off; @@ -148,6 +156,11 @@ procedure TTPMainForm.FormCreate(Sender: TObject); FTDI := TTDI.CreateWithFactory(Self, StreamFormFactory); FTDI.ShowMenuPopup := True; + FTDI.PageControl.PopupMenu.Items.Clear; + AddTdiPopupMenuItem(actNewStream); + AddTdiPopupMenuItem(actCloseActiveStream); + AddTdiPopupMenuItem(actCloseAllStreams); + {$IFDEF RELEASE} miRunMultipleStreams.Visible := False; {$ENDIF}