From 1d7321b5daf0cb8b43745a2ec6d27334d417733d Mon Sep 17 00:00:00 2001 From: naru Date: Sun, 20 Apr 2003 10:24:16 +0000 Subject: [PATCH] Added EditorTalkShow unit --- bottleclient/MainForm.dfm | 7 +++++++ bottleclient/MainForm.pas | 29 ++++++++++++++++++++++++++++- bottleclient/SstpBottle.dpr | 4 +++- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/bottleclient/MainForm.dfm b/bottleclient/MainForm.dfm index 39f83bd..49965a9 100755 --- a/bottleclient/MainForm.dfm +++ b/bottleclient/MainForm.dfm @@ -129,6 +129,13 @@ object frmSender: TfrmSender Top = 0 Action = actFMOExplorer end + object ToolButton1: TToolButton + Left = 246 + Top = 0 + Caption = 'ToolButton1' + ImageIndex = 7 + OnClick = ToolButton1Click + end end object ConstMenuBar: TMenuBar Left = 0 diff --git a/bottleclient/MainForm.pas b/bottleclient/MainForm.pas index c9790a6..09924d9 100755 --- a/bottleclient/MainForm.pas +++ b/bottleclient/MainForm.pas @@ -152,6 +152,7 @@ type actRecallScriptBuffer: TAction; N5: TMenuItem; mnRecallScriptBuffer: TMenuItem; + ToolButton1: TToolButton; procedure actConfirmExecute(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); @@ -234,6 +235,7 @@ type procedure memScriptMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure actRecallScriptBufferExecute(Sender: TObject); + procedure ToolButton1Click(Sender: TObject); private FSleeping: boolean; FStatusText: String; @@ -308,6 +310,7 @@ type TSurfacePreviewType); function GetSurfacePreviewPositionHint(w, h: integer): TPoint; function GetSurfacePreviewPositionScriptPoint(w, h: integer): TPoint; + procedure EditorPreview; public function DoTrans(var Script: String; Options: TScriptTransOptions): String; @@ -352,7 +355,7 @@ function Token(const Str: String; const Delimiter: char; implementation uses SendConfirm, SettingForm, ChannelListForm, LogForm, - MessageBox, FMOExplorer; + MessageBox, FMOExplorer, EditorTalkShow; {$R *.DFM} @@ -890,6 +893,7 @@ begin Script := StringReplace(GetScriptText, #13#10, '', [rfReplaceAll]); StatusBar.Panels[PanelBytes].Text := IntToStr(length(Script)) + 'ƒoƒCƒg'; FScriptModified := true; + EditorPreview; end; procedure TfrmSender.mnStayOnTopClick(Sender: TObject); @@ -2363,6 +2367,8 @@ begin end; // ’èŒ^‹åƒƒjƒ…[‚ðÄ\’z ConstructMenu(true); + // ƒvƒŒƒrƒ…[‚ª‚ ‚éê‡‚̓vƒŒƒrƒ…[ + EditorPreview; end; procedure TfrmSender.PlaySound(const FileName: String); @@ -2618,4 +2624,25 @@ begin ShowHintLabel('ƒXƒNƒŠƒvƒg‚ðŒÄ‚яo‚µ‚Ü‚µ‚½'); end; +procedure TfrmSender.ToolButton1Click(Sender: TObject); +begin + frmEditorTalkShow.Show; +end; + +procedure TfrmSender.EditorPreview; +var Ghost, Script: String; +begin + if frmEditorTalkShow <> nil then + if frmEditorTalkShow.Visible then + begin + Script := StringReplace(GetScriptText, #13#10, '', [rfReplaceAll]); + Ghost := ''; + if cbxTargetGhost.ItemIndex > 0 then + Ghost := cbxTargetGhost.Text + else if FNowChannel <> '' then + Ghost := ChannelList.Channel[FNowChannel].Ghost; + frmEditorTalkShow.TalkShowFrame.View(Script, Ghost); + end; +end; + end. diff --git a/bottleclient/SstpBottle.dpr b/bottleclient/SstpBottle.dpr index 9369ff1..8928505 100755 --- a/bottleclient/SstpBottle.dpr +++ b/bottleclient/SstpBottle.dpr @@ -41,7 +41,8 @@ uses SurfacePreview in 'SurfacePreview.pas' {frmSurfacePreview}, SppList in 'SppList.pas', SppTypes in 'SppTypes.pas', - TalkShowFrame in 'TalkShowFrame.pas' {frmTalkShow: TFrame}; + TalkShowFrame in 'TalkShowFrame.pas' {frmTalkShow: TFrame}, + EditorTalkShow in 'EditorTalkShow.pas' {frmEditorTalkShow}; // Œ^•t‚«’萔‚ð•ÏX‚Å‚«‚é‚悤‚É‚·‚éƒRƒ“ƒpƒCƒ‰ƒIƒvƒVƒ‡ƒ“ // ˆê•”‚̃Rƒ“ƒ|[ƒlƒ“ƒg‚É‚±‚ꂪ•K—v @@ -66,6 +67,7 @@ begin Application.Title := 'SSTP Bottle Client'; Application.ShowMainForm := true; Application.CreateForm(TfrmSender, frmSender); + Application.CreateForm(TfrmEditorTalkShow, frmEditorTalkShow); Application.CreateForm(TfrmLog, frmLog); Application.CreateForm(TfrmChannelList, frmChannelList); Application.CreateForm(TfrmMessageBox, frmMessageBox); -- 2.11.0