OSDN Git Service

Dialog implemented
authornaru <bottle@mikage.to>
Sat, 6 Mar 2004 02:25:28 +0000 (02:25 +0000)
committernaru <bottle@mikage.to>
Sat, 6 Mar 2004 02:25:28 +0000 (02:25 +0000)
bottleclient/SearchLog.dfm
bottleclient/SearchLog.pas

index 5fc639e..fe9d613 100644 (file)
@@ -1,8 +1,8 @@
-object TfrmSearchLog: TTfrmSearchLog
-  Left = 534
-  Top = 388
-  Width = 448
-  Height = 359
+object frmSearchLog: TfrmSearchLog
+  Left = 1080
+  Top = 732
+  Width = 446
+  Height = 357
   Caption = #12525#12464#12398#26908#32034
   Color = clBtnFace
   Font.Charset = SHIFTJIS_CHARSET
@@ -11,15 +11,15 @@ object TfrmSearchLog: TTfrmSearchLog
   Font.Name = #65325#65331' '#65328#12468#12471#12483#12463
   Font.Style = []
   OldCreateOrder = False
-  Position = poOwnerFormCenter
+  Position = poDesktopCenter
   DesignSize = (
-    440
-    325)
+    438
+    323)
   PixelsPerInch = 96
   TextHeight = 12
   object btnOk: TButton
-    Left = 351
-    Top = 289
+    Left = 349
+    Top = 287
     Width = 83
     Height = 25
     Anchors = [akRight, akBottom]
@@ -29,8 +29,8 @@ object TfrmSearchLog: TTfrmSearchLog
     OnClick = btnOkClick
   end
   object btnCancel: TButton
-    Left = 255
-    Top = 289
+    Left = 253
+    Top = 287
     Width = 91
     Height = 25
     Anchors = [akRight, akBottom]
@@ -42,13 +42,13 @@ object TfrmSearchLog: TTfrmSearchLog
   object gbxCondition: TGroupBox
     Left = 8
     Top = 8
-    Width = 425
+    Width = 423
     Height = 201
     Anchors = [akLeft, akTop, akRight]
     Caption = #26908#32034#26465#20214
     TabOrder = 2
     DesignSize = (
-      425
+      423
       201)
     object lblScriptPattern: TLabel
       Left = 8
@@ -88,7 +88,7 @@ object TfrmSearchLog: TTfrmSearchLog
     object edtScriptPattern: TEdit
       Left = 88
       Top = 16
-      Width = 329
+      Width = 327
       Height = 20
       Anchors = [akLeft, akTop, akRight]
       TabOrder = 0
@@ -104,7 +104,7 @@ object TfrmSearchLog: TTfrmSearchLog
     object cbxGhost: TComboBox
       Left = 88
       Top = 101
-      Width = 329
+      Width = 327
       Height = 20
       Anchors = [akLeft, akTop, akRight]
       ItemHeight = 12
@@ -118,7 +118,7 @@ object TfrmSearchLog: TTfrmSearchLog
       ItemHeight = 12
       TabOrder = 3
     end
-    object SpinEdit1: TSpinEdit
+    object spnMinVote: TSpinEdit
       Left = 88
       Top = 136
       Width = 81
@@ -128,7 +128,7 @@ object TfrmSearchLog: TTfrmSearchLog
       TabOrder = 4
       Value = 0
     end
-    object SpinEdit2: TSpinEdit
+    object spnMinAgree: TSpinEdit
       Left = 88
       Top = 168
       Width = 81
index c42b545..55d61c1 100644 (file)
@@ -1,5 +1,7 @@
 unit SearchLog;
 
+// \81u\83\8d\83O\82Ì\8c\9f\8dõ\81v\83t\83H\81[\83\80\82Æ\81A\82»\82Ì\8c\9f\8dõ\8fð\8c\8f
+
 interface
 
 uses
@@ -7,7 +9,10 @@ uses
   Dialogs, StdCtrls, ExtCtrls, Spin;
 
 type
-  // \8c\9f\8dõ\8fð\8c\8f\82ð\95\\82·\83N\83\89\83X
+  // \8c\9f\8dõ\8fð\8c\8f\82ð\95\\82·\83N\83\89\83X\81B
+  // \8cã\82Å\89½\82ç\82©\82Ì\95û\96@\82Å\89i\91±\89»\82·\82é\82©\82à\82µ\82ê\82È\82¢\82Ì\82Å\95Ê\83N\83\89\83X\82É\82·\82é
+  TSearchLogRange = (srSelectedLogList, srAboveSelectedLog, srAllLogLists);
+
   TSearchCond = class(TComponent)
   private
     FScriptRegExp: boolean;
@@ -16,12 +21,18 @@ type
     FGhost: String;
     FChannel: String;
     FScriptPattern: String;
+    FMinVote: integer;
+    FMinAgree: integer;
+    FSearchLogRange: TSearchLogRange;
     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);
+    procedure SetMinAgree(const Value: integer);
+    procedure SetMinVote(const Value: integer);
+    procedure SetSearchLogRange(const Value: TSearchLogRange);
   public
     procedure Assign(Source: TPersistent); override;
   published
@@ -31,9 +42,13 @@ type
     property Ghost: String read FGhost write SetGhost;
     property MinLength: integer read FMinLength write SetMinLength;
     property MaxLength: integer read FMaxLength write SetMaxLength;
+    property MinVote: integer read FMinVote write SetMinVote;
+    property MinAgree: integer read FMinAgree write SetMinAgree;
+    property SearchLogRange: TSearchLogRange read FSearchLogRange write SetSearchLogRange;
   end;
 
-  TTfrmSearchLog = class(TForm)
+  // \83\8d\83O\82Ì\8c\9f\8dõ\83t\83H\81[\83\80
+  TfrmSearchLog = class(TForm)
     btnOk: TButton;
     btnCancel: TButton;
     gbxCondition: TGroupBox;
@@ -47,21 +62,28 @@ type
     rgpTarget: TRadioGroup;
     lblMinVote: TLabel;
     lblMinAgree: TLabel;
-    SpinEdit1: TSpinEdit;
-    SpinEdit2: TSpinEdit;
+    spnMinVote: TSpinEdit;
+    spnMinAgree: TSpinEdit;
     procedure btnOkClick(Sender: TObject);
     procedure btnCancelClick(Sender: TObject);
   private
     FCondition: TSearchCond;
     procedure SetCondition(const Value: TSearchCond);
-
+    procedure SetChannelList(const Value: TStrings);
+    procedure SetGhostList(const Value: TStrings);
+    function GetChannelList: TStrings;
+    function GetGhostList: TStrings;
   public
+    constructor Create(AOwner: TComponent); override;
+    destructor Destroy; override;
     function Execute: boolean;
     property Condition: TSearchCond read FCondition write SetCondition;
+    property GhostList: TStrings read GetGhostList write SetGhostList;
+    property ChannelList: TStrings read GetChannelList write SetChannelList;
   end;
 
 var
-  TfrmSearchLog: TTfrmSearchLog;
+  frmSearchLog: TfrmSearchLog;
 
 implementation
 
@@ -84,6 +106,9 @@ begin
     FGhost         := Src.Ghost;
     FMinLength     := Src.MinLength;
     FMaxLength     := Src.MaxLength;
+    FMinVote       := Src.MinVote;
+    FMinAgree      := Src.MinAgree;
+    SearchLogRange := Src.SearchLogRange;
   end;
 end;
 
@@ -102,11 +127,21 @@ begin
   FMaxLength := Value;
 end;
 
+procedure TSearchCond.SetMinAgree(const Value: integer);
+begin
+  FMinAgree := Value;
+end;
+
 procedure TSearchCond.SetMinLength(const Value: integer);
 begin
   FMinLength := Value;
 end;
 
+procedure TSearchCond.SetMinVote(const Value: integer);
+begin
+  FMinVote := Value;
+end;
+
 procedure TSearchCond.SetScriptPattern(const Value: String);
 begin
   FScriptPattern := Value;
@@ -119,26 +154,81 @@ end;
 
 { TTfrmSearchLog }
 
-function TTfrmSearchLog.Execute: boolean;
+function TfrmSearchLog.Execute: boolean;
 begin
+  with Condition do
+  begin
+    edtScriptPattern.Text := ScriptPattern;
+    cbxChannel.Text   := Channel;
+    cbxGhost.Text     := Ghost;
+    spnMinVote.Value  := MinVote;
+    spnMinAgree.Value := MinAgree;
+  end;
   Result := ShowModal = mrOk;
+  if not Result then
+    Exit;
+  with Condition do
+  begin
+    ScriptPattern := edtScriptPattern.Text;
+    Channel  := cbxChannel.Text;
+    Ghost    := cbxGhost.Text;
+    MinVote  := spnMinVote.Value;
+    MinAgree := spnMinAgree.Value;
+  end;
 end;
 
-procedure TTfrmSearchLog.SetCondition(const Value: TSearchCond);
+procedure TfrmSearchLog.SetCondition(const Value: TSearchCond);
 begin
   FCondition.Assign(Value);
 end;
 
-procedure TTfrmSearchLog.btnOkClick(Sender: TObject);
+procedure TfrmSearchLog.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);
+procedure TfrmSearchLog.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;
 
+procedure TfrmSearchLog.SetChannelList(const Value: TStrings);
+begin
+  cbxChannel.Items.Assign(Value);
+end;
+
+procedure TfrmSearchLog.SetGhostList(const Value: TStrings);
+begin
+  cbxGhost.Items.Assign(Value);
+end;
+
+constructor TfrmSearchLog.Create(AOwner: TComponent);
+begin
+  inherited;
+  FCondition := TSearchCond.Create(nil);
+end;
+
+destructor TfrmSearchLog.Destroy;
+begin
+  FCondition.Free;
+  inherited;
+end;
+
+function TfrmSearchLog.GetChannelList: TStrings;
+begin
+  Result := cbxChannel.Items;
+end;
+
+function TfrmSearchLog.GetGhostList: TStrings;
+begin
+  Result := cbxGhost.Items;
+end;
+
+procedure TSearchCond.SetSearchLogRange(const Value: TSearchLogRange);
+begin
+  FSearchLogRange := Value;
+end;
+
 end.