3 //
\81u
\83\8d\83O
\82Ì
\8c\9f\8dõ
\81v
\83t
\83H
\81[
\83\80\82Æ
\81A
\82»
\82Ì
\8c\9f\8dõ
\8fð
\8c\8f
8 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
9 Dialogs, StdCtrls, ExtCtrls, Spin, BottleDef;
12 //
\8c\9f\8dõ
\8fð
\8c\8f\82ð
\95\
\82·
\83N
\83\89\83X
\81B
13 //
\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é
14 TSearchLogRange = (srSelectedLogList, srAboveSelectedLog, srAllLogLists);
16 TSearchCond = class(TComponent)
18 FScriptRegExp: boolean;
23 FScriptPattern: String;
26 FSearchLogRange: TSearchLogRange;
27 procedure SetChannel(const Value: String);
28 procedure SetGhost(const Value: String);
29 procedure SetMaxLength(const Value: integer);
30 procedure SetMinLength(const Value: integer);
31 procedure SetScriptPattern(const Value: String);
32 procedure SetScriptRegExp(const Value: boolean);
33 procedure SetMinAgree(const Value: integer);
34 procedure SetMinVote(const Value: integer);
35 procedure SetSearchLogRange(const Value: TSearchLogRange);
37 procedure Assign(Source: TPersistent); override;
38 function IsInvalidCondition: boolean;
40 property ScriptPattern: String read FScriptPattern write SetScriptPattern;
41 property ScriptRegExp: boolean read FScriptRegExp write SetScriptRegExp;
42 property Channel: String read FChannel write SetChannel;
43 property Ghost: String read FGhost write SetGhost;
44 property MinLength: integer read FMinLength write SetMinLength; //
\96¢
\8eÀ
\91\95
45 property MaxLength: integer read FMaxLength write SetMaxLength; //
\96¢
\8eÀ
\91\95
46 property MinVote: integer read FMinVote write SetMinVote;
47 property MinAgree: integer read FMinAgree write SetMinAgree;
48 property SearchLogRange: TSearchLogRange read FSearchLogRange write SetSearchLogRange;
51 //
\83\8d\83O
\82Ì
\8c\9f\8dõ
\83t
\83H
\81[
\83\80
52 TfrmSearchLog = class(TForm)
55 gbxCondition: TGroupBox;
56 lblScriptPattern: TLabel;
59 edtScriptPattern: TEdit;
60 cbxScriptRegExp: TCheckBox;
62 cbxChannel: TComboBox;
63 rgpSearchLogRange: TRadioGroup;
66 spnMinVote: TSpinEdit;
67 spnMinAgree: TSpinEdit;
70 procedure btnOkClick(Sender: TObject);
71 procedure btnCancelClick(Sender: TObject);
73 FCondition: TSearchCond;
74 procedure SetCondition(const Value: TSearchCond);
75 procedure SetChannelList(const Value: TStrings);
76 procedure SetGhostList(const Value: TStrings);
77 function GetChannelList: TStrings;
78 function GetGhostList: TStrings;
80 constructor Create(AOwner: TComponent); override;
81 destructor Destroy; override;
82 function Execute: boolean;
83 property Condition: TSearchCond read FCondition write SetCondition;
84 property GhostList: TStrings read GetGhostList write SetGhostList;
85 property ChannelList: TStrings read GetChannelList write SetChannelList;
89 frmSearchLog: TfrmSearchLog;
97 procedure TSearchCond.Assign(Source: TPersistent);
101 if not (Source is TSearchCond) then
105 Src := Source as TSearchCond;
106 FScriptPattern := Src.ScriptPattern;
107 FScriptRegExp := Src.ScriptRegExp;
108 FChannel := Src.Channel;
110 FMinLength := Src.MinLength;
111 FMaxLength := Src.MaxLength;
112 FMinVote := Src.MinVote;
113 FMinAgree := Src.MinAgree;
114 SearchLogRange := Src.SearchLogRange;
118 function TSearchCond.IsInvalidCondition: boolean;
120 //
\8bó
\82Á
\82Û
\82Ì
\8fð
\8c\8f\82Å
\82Í
\82È
\82¢
\82±
\82Æ
\82ð
\83`
\83F
\83b
\83N
122 if ScriptPattern <> '' then
124 if (Channel <> '') or (Ghost <> '') then
126 if (MinVote > 0) or (MinAgree > 0) then
128 { if (MinLength > 0) or (MaxLength > 0) then
132 procedure TSearchCond.SetChannel(const Value: String);
137 procedure TSearchCond.SetGhost(const Value: String);
142 procedure TSearchCond.SetMaxLength(const Value: integer);
147 procedure TSearchCond.SetMinAgree(const Value: integer);
152 procedure TSearchCond.SetMinLength(const Value: integer);
157 procedure TSearchCond.SetMinVote(const Value: integer);
162 procedure TSearchCond.SetScriptPattern(const Value: String);
164 FScriptPattern := Value;
167 procedure TSearchCond.SetScriptRegExp(const Value: boolean);
169 FScriptRegExp := Value;
174 function TfrmSearchLog.Execute: boolean;
178 //
\83L
\83\83\83\93\83Z
\83\8b\8e\9e\82É
\90Ý
\92è
\82ª
\95Ï
\82í
\82ç
\82È
\82¢
\82æ
\82¤
\82É
\83o
\83b
\83N
\83A
\83b
\83v
179 Backup := TSearchCond.Create(nil);
181 Backup.Assign(Condition);
184 edtScriptPattern.Text := ScriptPattern;
185 cbxScriptRegExp.Checked := ScriptRegExp;
186 cbxChannel.Text := Channel;
187 cbxGhost.Text := Ghost;
188 spnMinVote.Value := MinVote;
189 spnMinAgree.Value := MinAgree;
190 rgpSearchLogRange.ItemIndex := Ord(SearchLogRange);
192 Result := ShowModal = mrOk;
193 //
\83L
\83\83\83\93\83Z
\83\8b\8e\9e\82É
\82Í
\90Ý
\92è
\82ð
\8c³
\82É
\96ß
\82·
195 Condition.Assign(Backup);
201 procedure TfrmSearchLog.SetCondition(const Value: TSearchCond);
203 FCondition.Assign(Value);
206 procedure TfrmSearchLog.btnOkClick(Sender: TObject);
207 var ErrorMsg,CheckScriptPattern :String;
209 //
\8c\8b\89ÊOK
\82Å
\83E
\83B
\83\93\83h
\83E
\82ð
\95Â
\82¶
\82é
212 CheckScriptPattern := edtScriptPattern.Text;
213 ScriptRegExp := cbxScriptRegExp.Checked;
214 Channel := cbxChannel.Text;
215 Ghost := cbxGhost.Text;
216 MinVote := spnMinVote.Value;
217 MinAgree := spnMinAgree.Value;
218 SearchLogRange := TSearchLogRange(rgpSearchLogRange.ItemIndex);
220 if ScriptRegExp and (CheckScriptPattern <> '') then
222 ErrorMsg := SafeAndCheckRegExp(CheckScriptPattern);
223 if ErrorMsg <> '' then begin
224 ShowMessage('
\90³
\8bK
\95\
\8c»
\82É
\8cë
\82è
\82ª
\82 \82è
\82Ü
\82·'#13#10 + ErrorMsg);
227 ScriptPattern := CheckScriptPattern;
230 if Condition.IsInvalidCondition then
231 ShowMessage('
\8fð
\8c\8f\82ð
\8ew
\92è
\82µ
\82Ä
\82
\82¾
\82³
\82¢')
236 procedure TfrmSearchLog.btnCancelClick(Sender: TObject);
238 //
\8c\8b\89Ê
\83L
\83\83\83\93\83Z
\83\8b\82Å
\83E
\83B
\83\93\83h
\83E
\82ð
\95Â
\82¶
\82é
239 ModalResult := mrCancel;
242 procedure TfrmSearchLog.SetChannelList(const Value: TStrings);
244 cbxChannel.Items.Assign(Value);
247 procedure TfrmSearchLog.SetGhostList(const Value: TStrings);
249 cbxGhost.Items.Assign(Value);
252 constructor TfrmSearchLog.Create(AOwner: TComponent);
255 FCondition := TSearchCond.Create(nil);
258 destructor TfrmSearchLog.Destroy;
264 function TfrmSearchLog.GetChannelList: TStrings;
266 Result := cbxChannel.Items;
269 function TfrmSearchLog.GetGhostList: TStrings;
271 Result := cbxGhost.Items;
274 procedure TSearchCond.SetSearchLogRange(const Value: TSearchLogRange);
276 FSearchLogRange := Value;