OSDN Git Service

Added SpecialCharEditor
authornaru <bottle@mikage.to>
Wed, 27 Aug 2003 13:17:08 +0000 (13:17 +0000)
committernaru <bottle@mikage.to>
Wed, 27 Aug 2003 13:17:08 +0000 (13:17 +0000)
bottleclient/SpecialCharEditor.dfm [new file with mode: 0644]
bottleclient/SpecialCharEditor.pas [new file with mode: 0644]
bottleclient/SstpBottle.dpr

diff --git a/bottleclient/SpecialCharEditor.dfm b/bottleclient/SpecialCharEditor.dfm
new file mode 100644 (file)
index 0000000..55162d8
--- /dev/null
@@ -0,0 +1,71 @@
+object frmSpecialCharEditor: TfrmSpecialCharEditor
+  Left = 605
+  Top = 413
+  BorderStyle = bsDialog
+  Caption = #25991#23383#12392#38263#12373
+  ClientHeight = 106
+  ClientWidth = 240
+  Color = clBtnFace
+  Font.Charset = SHIFTJIS_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -12
+  Font.Name = #65325#65331' '#65328#12468#12471#12483#12463
+  Font.Style = []
+  OldCreateOrder = False
+  Position = poOwnerFormCenter
+  PixelsPerInch = 96
+  TextHeight = 12
+  object lblChar: TLabel
+    Left = 8
+    Top = 16
+    Width = 41
+    Height = 12
+    Caption = #25991#23383'(&S):'
+    FocusControl = edtChar
+  end
+  object lblCost: TLabel
+    Left = 8
+    Top = 48
+    Width = 40
+    Height = 12
+    Caption = #26178#38291'(&L):'
+    FocusControl = spnCost
+  end
+  object btnOk: TButton
+    Left = 160
+    Top = 72
+    Width = 75
+    Height = 25
+    Caption = '&OK'
+    Default = True
+    TabOrder = 0
+    OnClick = btnOkClick
+  end
+  object btnCancel: TButton
+    Left = 64
+    Top = 72
+    Width = 91
+    Height = 25
+    Cancel = True
+    Caption = #12461#12515#12531#12475#12523'(&C)'
+    TabOrder = 1
+    OnClick = btnCancelClick
+  end
+  object edtChar: TEdit
+    Left = 64
+    Top = 8
+    Width = 97
+    Height = 20
+    TabOrder = 2
+  end
+  object spnCost: TSpinEdit
+    Left = 64
+    Top = 40
+    Width = 97
+    Height = 21
+    MaxValue = 10000
+    MinValue = 0
+    TabOrder = 3
+    Value = 0
+  end
+end
diff --git a/bottleclient/SpecialCharEditor.pas b/bottleclient/SpecialCharEditor.pas
new file mode 100644 (file)
index 0000000..e02cb82
--- /dev/null
@@ -0,0 +1,76 @@
+unit SpecialCharEditor;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, Spin, StdCtrls;
+
+type
+  TfrmSpecialCharEditor = class(TForm)
+    btnOk: TButton;
+    btnCancel: TButton;
+    lblChar: TLabel;
+    edtChar: TEdit;
+    lblCost: TLabel;
+    spnCost: TSpinEdit;
+    procedure btnOkClick(Sender: TObject);
+    procedure btnCancelClick(Sender: TObject);
+  private
+    FCost: integer;
+    FSpecialChar: String;
+    procedure SetCost(const Value: integer);
+    procedure SetSpecialChar(const Value: String);
+    { Private \90é\8c¾ }
+  public
+    property SpecialChar: String read FSpecialChar write SetSpecialChar;
+    property Cost: integer read FCost write SetCost;
+    function Execute: boolean;
+  end;
+
+var
+  frmSpecialCharEditor: TfrmSpecialCharEditor;
+
+implementation
+
+{$R *.dfm}
+
+{ TForm1 }
+
+function TfrmSpecialCharEditor.Execute: boolean;
+begin
+  spnCost.Value := Cost;
+  edtChar.Text := SpecialChar;
+  Result := ShowModal = mrOk;
+end;
+
+procedure TfrmSpecialCharEditor.SetCost(const Value: integer);
+begin
+  FCost := Value;
+end;
+
+procedure TfrmSpecialCharEditor.SetSpecialChar(const Value: String);
+begin
+  FSpecialChar := Value;
+end;
+
+procedure TfrmSpecialCharEditor.btnOkClick(Sender: TObject);
+var
+  OK: boolean;
+begin
+  OK := false;
+  if (Length(edtChar.Text) = 1) and not (edtChar.Text[1] in LeadBytes) then
+    OK := true;
+  if (Length(edtChar.Text) = 2) and (edtChar.Text[1] in LeadBytes) then
+    OK := true;
+  SpecialChar := edtChar.Text;
+  Cost := spnCost.Value;
+  ModalResult := mrOk;
+end;
+
+procedure TfrmSpecialCharEditor.btnCancelClick(Sender: TObject);
+begin
+  ModalResult := mrCancel;
+end;
+
+end.
index b2ce7d1..f2f0c71 100755 (executable)
@@ -54,7 +54,8 @@ uses
   TalkShowFrame in 'TalkShowFrame.pas' {frmTalkShow: TFrame},
   EditorTalkShow in 'EditorTalkShow.pas' {frmEditorTalkShow},
   ProgressWindow in 'ProgressWindow.pas' {frmProgressWindow},
-  Plugins in 'Plugins.pas';
+  Plugins in 'Plugins.pas',
+  SpecialCharEditor in 'SpecialCharEditor.pas' {frmSpecialCharEditor};
 
 // \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