OSDN Git Service

Replacing richedit, seems work fine
authornaru <bottle@mikage.to>
Wed, 2 Apr 2003 07:31:43 +0000 (07:31 +0000)
committernaru <bottle@mikage.to>
Wed, 2 Apr 2003 07:31:43 +0000 (07:31 +0000)
bottleclient/LogForm.pas
bottleclient/MainForm.dfm
bottleclient/MainForm.pas
bottleclient/SettingForm.dfm
bottleclient/SettingForm.pas

index 4e841b8..92d38b7 100755 (executable)
@@ -580,7 +580,7 @@ end;
 procedure TfrmLog.UpdateWindow;
 var EnabledFlag: boolean;
 begin
-  if Pref.ColorScript then begin
+  if true then begin // ColorScript
     if lvwLog.Color <> Pref.BgColor then lvwLog.Color := Pref.BgColor;
     if lvwLog.Font.Color <> Pref.TalkColorH then lvwLog.Font.Color := Pref.TalkColorH;
   end else begin
@@ -757,7 +757,7 @@ procedure TfrmLog.UpdateScript(const Script: String);
 begin
   if Script <> FLastScript then begin
     if Pref.LogWindowPreviewStyle = psConversation then begin
-      if Pref.ColorScript then begin
+      if true then begin {TODO: ColorScript}
         UpdateScriptConversationColor(Script);
       end else begin
         UpdateScriptConversationNoColor(Script);
@@ -794,7 +794,7 @@ var
   UnyuTalking, InSynchronized: boolean;
   i: integer;
 begin
-  if Pref.ColorScript then begin
+  if true then begin // {TODO: ColorScrpt}
     edtScript.Color := Pref.BgColor;
   end else begin
     edtScript.Color := clWindow;
@@ -808,7 +808,7 @@ begin
   UnyuTalking := false;
   InSynchronized := false;
   for i := 0 to SsParser.Count-1 do begin
-    if Pref.ColorScript then begin
+    if true then begin // {TODO: ColorScript}
       case SsParser.MarkUpType[i] of
         mtStr: begin
           if InSynchronized then
index 0840818..fb8f59a 100755 (executable)
@@ -219,6 +219,7 @@ object frmSender: TfrmSender
       Caret.Style = csDefault
       Caret.TabIndent = False
       Caret.TabSpaceCount = 8
+      Fountain = SakuraScriptFountain
       Font.Charset = SHIFTJIS_CHARSET
       Font.Color = clBlack
       Font.Height = -12
@@ -318,6 +319,9 @@ object frmSender: TfrmSender
       WrapOption.PunctuationStr = #12289#12290#65292#65294',.'#65377#65380
       WrapOption.WordBreak = False
       WrapOption.WrapByte = 80
+      OnChange = memScriptChange
+      OnKeyDown = memScriptKeyDown
+      OnKeyPress = memScriptKeyPress
     end
   end
   object pnlPanel: TPanel
@@ -422,10 +426,10 @@ object frmSender: TfrmSender
     object mnEdit: TMenuItem
       Caption = #32232#38598'(&E)'
       object mnCut: TMenuItem
-        Action = actEditCut
+        Action = actCut
       end
       object mnCopy: TMenuItem
-        Action = actEditCopy
+        Action = actCopy
       end
       object mnCopyAll: TMenuItem
         Action = actCopyAll
@@ -434,10 +438,10 @@ object frmSender: TfrmSender
         Action = actCopyAllNoReturn
       end
       object mnPaste: TMenuItem
-        Action = actEditPaste
+        Action = actPaste
       end
       object mnSelectAll: TMenuItem
-        Action = actEditSelectAll
+        Action = actSelectAll
       end
     end
     object mnRegister: TMenuItem
@@ -561,33 +565,6 @@ object frmSender: TfrmSender
     Images = imgIcon
     Left = 200
     Top = 72
-    object actEditCopy: TEditCopy
-      Category = #32232#38598
-      Caption = #12467#12500#12540'(&C)'
-      Hint = #12467#12500#12540
-      ImageIndex = 2
-      ShortCut = 16451
-    end
-    object actEditCut: TEditCut
-      Category = #32232#38598
-      Caption = #20999#12426#21462#12426'(&T)'
-      Hint = #20999#12426#21462#12426
-      ImageIndex = 4
-      ShortCut = 16472
-    end
-    object actEditPaste: TEditPaste
-      Category = #32232#38598
-      Caption = #36028#12426#20184#12369'(&P)'
-      Hint = #36028#12426#20184#12369
-      ImageIndex = 3
-      ShortCut = 16470
-    end
-    object actEditSelectAll: TEditSelectAll
-      Category = #32232#38598
-      Caption = #12377#12409#12390#12434#36984#25246'(&A)'
-      Hint = #12377#12409#12390#12434#36984#25246
-      ShortCut = 16449
-    end
     object actStart: TAction
       Caption = #12481#12515#12531#12493#12523#21442#21152'(&S)'
       Hint = #12481#12515#12531#12493#12523#21442#21152'|SSTP Bottle'#12469#12540#12496#12395#25509#32154#12375#12289#12481#12515#12531#12493#12523#12395#21442#21152
@@ -738,6 +715,29 @@ object frmSender: TfrmSender
       ImageIndex = 39
       OnExecute = actInsertCueExecute
     end
+    object actCopy: TAction
+      Caption = #12467#12500#12540'(&C)'
+      ImageIndex = 2
+      ShortCut = 16451
+      OnExecute = actCopyExecute
+    end
+    object actPaste: TAction
+      Caption = #36028#12426#20184#12369'(&P)'
+      ImageIndex = 3
+      ShortCut = 16470
+      OnExecute = actPasteExecute
+    end
+    object actCut: TAction
+      Caption = #20999#12426#21462#12426'(&T)'
+      ImageIndex = 4
+      ShortCut = 16472
+      OnExecute = actCutExecute
+    end
+    object actSelectAll: TAction
+      Caption = #12377#12409#12390#12434#36984#25246'(&A)'
+      ShortCut = 16449
+      OnExecute = actSelectAllExecute
+    end
   end
   object mnPopUp: TPopupMenu
     Images = imgIcon
@@ -755,11 +755,11 @@ object frmSender: TfrmSender
     end
     object mnPopCut: TMenuItem
       Tag = -1
-      Action = actEditCut
+      Action = actCut
     end
     object mnPopCopy: TMenuItem
       Tag = -1
-      Action = actEditCopy
+      Action = actCopy
     end
     object mnPopCopyAll: TMenuItem
       Action = actCopyAll
@@ -769,11 +769,11 @@ object frmSender: TfrmSender
     end
     object mnPopPaste: TMenuItem
       Tag = -1
-      Action = actEditPaste
+      Action = actPaste
     end
     object mnPopSelectAll: TMenuItem
       Tag = -1
-      Action = actEditSelectAll
+      Action = actSelectAll
     end
   end
   object TaskTray: TTaskTray
@@ -2350,22 +2350,22 @@ object frmSender: TfrmSender
     Reserve.Color = clNone
     Reserve.Style = []
     Scope0Color.BkColor = clNone
-    Scope0Color.Color = clNone
+    Scope0Color.Color = clBlack
     Scope0Color.Style = []
     Scope1Color.BkColor = clNone
-    Scope1Color.Color = clNone
+    Scope1Color.Color = clMaroon
     Scope1Color.Style = []
     TagColor.BkColor = clNone
-    TagColor.Color = clNone
+    TagColor.Color = clGreen
     TagColor.Style = []
     TagErrorColor.BkColor = clNone
-    TagErrorColor.Color = clNone
+    TagErrorColor.Color = clRed
     TagErrorColor.Style = []
     MetaWordColor.BkColor = clNone
-    MetaWordColor.Color = clNone
+    MetaWordColor.Color = clBlue
     MetaWordColor.Style = []
     SynchronizedColor.BkColor = clNone
-    SynchronizedColor.Color = clNone
+    SynchronizedColor.Color = clFuchsia
     SynchronizedColor.Style = []
     SakuraScriptParser = SsParser
     Left = 112
index eb3d276..f3dfbd4 100755 (executable)
@@ -29,10 +29,6 @@ type
     mnAbout: TMenuItem;
     mnEditConst: TMenuItem;
     ActionList: TActionList;
-    actEditCopy: TEditCopy;
-    actEditCut: TEditCut;
-    actEditPaste: TEditPaste;
-    actEditSelectAll: TEditSelectAll;
     mnPopUp: TPopupMenu;
     mnPopPaste: TMenuItem;
     mnPopCut: TMenuItem;
@@ -148,6 +144,10 @@ type
     actInsertCue: TAction;
     SakuraScriptFountain: TSakuraScriptFountain;
     memScript: TEditor;
+    actCopy: TAction;
+    actPaste: TAction;
+    actCut: TAction;
+    actSelectAll: TAction;
     procedure actConfirmExecute(Sender: TObject);
     procedure FormCreate(Sender: TObject);
     procedure FormDestroy(Sender: TObject);
@@ -225,6 +225,10 @@ type
     procedure actFMOExplorerExecute(Sender: TObject);
     procedure actInsertCueExecute(Sender: TObject);
     procedure FormResize(Sender: TObject);
+    procedure actCopyExecute(Sender: TObject);
+    procedure actPasteExecute(Sender: TObject);
+    procedure actCutExecute(Sender: TObject);
+    procedure actSelectAllExecute(Sender: TObject);
   private
     FSleeping: boolean;
     FStatusText: String;
@@ -436,7 +440,6 @@ begin
     FormStyle := fsNormal;
     mnStayOnTop.Checked := false;
   end;
-  mnColorScript.Checked := Pref.ColorScript;
 
   mnGoToHP.Hint := Pref.HomePage;
   mnGotoGlog.Hint := Pref.GLogPage;
@@ -805,15 +808,14 @@ end;
 
 procedure TfrmSender.actClearExecute(Sender: TObject);
 var TmpScript: String;
-    Pos: Integer;
+    Position: Integer;
 begin
   TmpScript := Pref.DefaultScript;
-  if RegExp.Match('m/^((.|\s)*)\|/', TmpScript) then begin
-    Pos := length(RegExp[1]);
-  end else Pos := 0;
-  RegExp.Subst('s/\|//', TmpScript);
-
+  Position := Pos('|', TmpScript);
+  if Position < 1 then Position := 1;
+  TmpScript := StringReplace(TmpScript, '|', '', []);
   memScript.Lines.Text := TmpScript;
+  memScript.SelStart := Position-1;
 
   if Visible then memScript.SetFocus;
   FScriptModified := false;
@@ -1012,6 +1014,15 @@ end;
 
 procedure TfrmSender.UpdateLayout;
 begin
+  with SakuraScriptFountain do begin
+    TagColor.Color := Pref.MarkUpColor;
+    TagErrorColor.Color := Pref.MarkErrorColor;
+    Scope0Color.Color := Pref.TalkColorH;
+    Scope1Color.Color := Pref.TalkColorU;
+    SynchronizedColor.Color := Pref.TalkColorS;
+  end;
+  memScript.Color := Pref.BgColor;
+
   ToolBar.Visible := Pref.ShowToolBar;
   ConstMenuBar.Visible := Pref.ShowConstBar;
   ToolBar.Top := 0;
@@ -2336,4 +2347,24 @@ begin
   memScript.WrapOption.WrapByte := (memScript.Width - 20) div 6;
 end;
 
+procedure TfrmSender.actCopyExecute(Sender: TObject);
+begin
+  memScript.CopyToClipboard;
+end;
+
+procedure TfrmSender.actPasteExecute(Sender: TObject);
+begin
+  memScript.PasteFromClipboard;
+end;
+
+procedure TfrmSender.actCutExecute(Sender: TObject);
+begin
+  memScript.CutToClipboard;
+end;
+
+procedure TfrmSender.actSelectAllExecute(Sender: TObject);
+begin
+  memScript.SelectAll;
+end;
+
 end.
index 1aa872f..5ac9696 100755 (executable)
@@ -27,7 +27,7 @@ object frmSetting: TfrmSetting
     Top = 8
     Width = 379
     Height = 306
-    ActivePage = tstReceive
+    ActivePage = tstColor
     Anchors = [akLeft, akTop, akRight, akBottom]
     TabOrder = 0
     object tstGeneral: TTabSheet
@@ -143,15 +143,6 @@ object frmSetting: TfrmSetting
         Caption = #33394#20998#12369#12473#12500#12540#12489'('#36895#12377#12366#12427#12392#12461#12540#12508#12540#12489#12398#21453#24540#12364#37389#12426#12414#12377')(&D)'
         FocusControl = trkColorSpeed
       end
-      object cbxColorScript: TCheckBox
-        Left = 8
-        Top = 8
-        Width = 201
-        Height = 17
-        Hint = #12481#12455#12483#12463#12434#35299#38500#12377#12427#12392#36895#24230#12399#36895#24230#12399#36895#12367#12394#12427#12364#35211#12389#12425#12356
-        Caption = #12473#12463#12522#12503#12488#33394#20998#12369#12434#34892#12358'(&E)'
-        TabOrder = 0
-      end
       object trkColorTimeLag: TTrackBar
         Left = 16
         Top = 200
@@ -162,7 +153,7 @@ object frmSetting: TfrmSetting
         PageSize = 100
         Frequency = 100
         Position = 500
-        TabOrder = 2
+        TabOrder = 1
         ThumbLength = 15
       end
       object trkColorSpeed: TTrackBar
@@ -174,16 +165,16 @@ object frmSetting: TfrmSetting
         Max = 25
         Min = 5
         Position = 10
-        TabOrder = 3
+        TabOrder = 2
         ThumbLength = 15
       end
       object gbxColor: TGroupBox
         Left = 8
-        Top = 24
+        Top = 16
         Width = 353
         Height = 153
         Caption = #33394'(&O)'
-        TabOrder = 1
+        TabOrder = 0
         inline frmColorSetting: TfrmColorSetting
           Left = 16
           Top = 18
index ee90b50..cc31c2b 100755 (executable)
@@ -21,7 +21,6 @@ type
     memDefaultScript: TMemo;
     lblDefaultScript: TLabel;
     grpLocalConfirm: TGroupBox;
-    cbxColorScript: TCheckBox;
     trkColorTimeLag: TTrackBar;
     trkColorSpeed: TTrackBar;
     cbxIgnoreTimeCritical: TCheckBox;
@@ -93,7 +92,6 @@ begin
   cbxNoSendGhostList.Checked := Pref.NoSendGhostList;
   cbxConfirmOnExit.Checked := Pref.ConfirmOnExit;
   //
-  cbxColorScript.Checked := Pref.ColorScript;
   with frmColorSetting do begin
     Color['H'] := Pref.TalkColorH;
     Color['U'] := Pref.TalkColorU;
@@ -154,7 +152,6 @@ begin
   Pref.NoSendGhostList := cbxNoSendGhostList.Checked;
   Pref.ConfirmOnExit := cbxConfirmOnExit.Checked;
   //
-  Pref.ColorScript := cbxColorScript.Checked;
   with frmColorSetting do begin
     Pref.TalkColorH := Color['H'];
     Pref.TalkColorU := Color['U'];