OSDN Git Service

Added EditorTalkShow unit
authornaru <bottle@mikage.to>
Sun, 20 Apr 2003 10:24:16 +0000 (10:24 +0000)
committernaru <bottle@mikage.to>
Sun, 20 Apr 2003 10:24:16 +0000 (10:24 +0000)
bottleclient/MainForm.dfm
bottleclient/MainForm.pas
bottleclient/SstpBottle.dpr

index 39f83bd..49965a9 100755 (executable)
@@ -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
index c9790a6..09924d9 100755 (executable)
@@ -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)) + '\83o\83C\83g';
   FScriptModified := true;
+  EditorPreview;
 end;
 
 procedure TfrmSender.mnStayOnTopClick(Sender: TObject);
@@ -2363,6 +2367,8 @@ begin
   end;
   // \92è\8c^\8bå\83\81\83j\83\85\81[\82ð\8dÄ\8d\\92z
   ConstructMenu(true);
+  // \83v\83\8c\83r\83\85\81[\82ª\82 \82é\8fê\8d\87\82Í\83v\83\8c\83r\83\85\81[
+  EditorPreview;
 end;
 
 procedure TfrmSender.PlaySound(const FileName: String);
@@ -2618,4 +2624,25 @@ begin
   ShowHintLabel('\83X\83N\83\8a\83v\83g\82ð\8cÄ\82Ñ\8fo\82µ\82Ü\82µ\82½');
 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.
index 9369ff1..8928505 100755 (executable)
@@ -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};
 
 // \8c^\95t\82«\92è\90\94\82ð\95Ï\8dX\82Å\82«\82é\82æ\82¤\82É\82·\82é\83R\83\93\83p\83C\83\89\83I\83v\83V\83\87\83\93
 // \88ê\95\94\82Ì\83R\83\93\83|\81[\83l\83\93\83g\82É\82±\82ê\82ª\95K\97v
@@ -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);