OSDN Git Service

Added SearchLog (not implemented yet)
[winbottle/winbottle.git] / bottleclient / SearchLog.pas
diff --git a/bottleclient/SearchLog.pas b/bottleclient/SearchLog.pas
new file mode 100644 (file)
index 0000000..c42b545
--- /dev/null
@@ -0,0 +1,144 @@
+unit SearchLog;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, StdCtrls, ExtCtrls, Spin;
+
+type
+  // \8c\9f\8dõ\8fð\8c\8f\82ð\95\\82·\83N\83\89\83X
+  TSearchCond = class(TComponent)
+  private
+    FScriptRegExp: boolean;
+    FMinLength: integer;
+    FMaxLength: integer;
+    FGhost: String;
+    FChannel: String;
+    FScriptPattern: String;
+    procedure SetChannel(const Value: String);
+    procedure SetGhost(const Value: String);
+    procedure SetMaxLength(const Value: integer);
+    procedure SetMinLength(const Value: integer);
+    procedure SetScriptPattern(const Value: String);
+    procedure SetScriptRegExp(const Value: boolean);
+  public
+    procedure Assign(Source: TPersistent); override;
+  published
+    property ScriptPattern: String read FScriptPattern write SetScriptPattern;
+    property ScriptRegExp: boolean read FScriptRegExp write SetScriptRegExp;
+    property Channel: String read FChannel write SetChannel;
+    property Ghost: String read FGhost write SetGhost;
+    property MinLength: integer read FMinLength write SetMinLength;
+    property MaxLength: integer read FMaxLength write SetMaxLength;
+  end;
+
+  TTfrmSearchLog = class(TForm)
+    btnOk: TButton;
+    btnCancel: TButton;
+    gbxCondition: TGroupBox;
+    lblScriptPattern: TLabel;
+    lblChannel: TLabel;
+    lblGhost: TLabel;
+    edtScriptPattern: TEdit;
+    cbxScriptRegExp: TCheckBox;
+    cbxGhost: TComboBox;
+    cbxChannel: TComboBox;
+    rgpTarget: TRadioGroup;
+    lblMinVote: TLabel;
+    lblMinAgree: TLabel;
+    SpinEdit1: TSpinEdit;
+    SpinEdit2: TSpinEdit;
+    procedure btnOkClick(Sender: TObject);
+    procedure btnCancelClick(Sender: TObject);
+  private
+    FCondition: TSearchCond;
+    procedure SetCondition(const Value: TSearchCond);
+
+  public
+    function Execute: boolean;
+    property Condition: TSearchCond read FCondition write SetCondition;
+  end;
+
+var
+  TfrmSearchLog: TTfrmSearchLog;
+
+implementation
+
+{$R *.dfm}
+
+{ TSearchCond }
+
+procedure TSearchCond.Assign(Source: TPersistent);
+var
+  Src: TSearchCond;
+begin
+  if not (Source is TSearchCond) then
+    inherited
+  else
+  begin
+    Src := Source as TSearchCond;
+    FScriptPattern := Src.ScriptPattern;
+    FScriptRegExp  := Src.ScriptRegExp;
+    FChannel       := Src.Channel;
+    FGhost         := Src.Ghost;
+    FMinLength     := Src.MinLength;
+    FMaxLength     := Src.MaxLength;
+  end;
+end;
+
+procedure TSearchCond.SetChannel(const Value: String);
+begin
+  FChannel := Value;
+end;
+
+procedure TSearchCond.SetGhost(const Value: String);
+begin
+  FGhost := Value;
+end;
+
+procedure TSearchCond.SetMaxLength(const Value: integer);
+begin
+  FMaxLength := Value;
+end;
+
+procedure TSearchCond.SetMinLength(const Value: integer);
+begin
+  FMinLength := Value;
+end;
+
+procedure TSearchCond.SetScriptPattern(const Value: String);
+begin
+  FScriptPattern := Value;
+end;
+
+procedure TSearchCond.SetScriptRegExp(const Value: boolean);
+begin
+  FScriptRegExp := Value;
+end;
+
+{ TTfrmSearchLog }
+
+function TTfrmSearchLog.Execute: boolean;
+begin
+  Result := ShowModal = mrOk;
+end;
+
+procedure TTfrmSearchLog.SetCondition(const Value: TSearchCond);
+begin
+  FCondition.Assign(Value);
+end;
+
+procedure TTfrmSearchLog.btnOkClick(Sender: TObject);
+begin
+  // \8c\8b\89ÊOK\82Å\83E\83B\83\93\83h\83E\82ð\95Â\82\82é
+  ModalResult := mrOk;
+end;
+
+procedure TTfrmSearchLog.btnCancelClick(Sender: TObject);
+begin
+  // \8c\8b\89Ê\83L\83\83\83\93\83Z\83\8b\82Å\83E\83B\83\93\83h\83E\82ð\95Â\82\82é
+  ModalResult := mrCancel;
+end;
+
+end.