TabOrder = 3
ViewStyle = vsReport
OnChange = BoardListViewChange
+ OnDblClick = BoardListViewDblClick
end
object OkBotton: TButton
Left = 248
ModalResult = 2
TabOrder = 5
end
- object ComboBox1: TComboBox
+ object SearchComboBox: TComboBox
Left = 96
Top = 4
Width = 345
Height = 41
Caption = #26908#32034#23550#35937
TabOrder = 1
- object CheckBox1: TCheckBox
+ object NameCheckBox: TCheckBox
Left = 12
Top = 16
Width = 69
Height = 17
Caption = #21517#21069'(&N)'
+ Checked = True
+ State = cbChecked
TabOrder = 0
end
- object CheckBox2: TCheckBox
+ object MailCheckBox: TCheckBox
Left = 92
Top = 16
Width = 121
Height = 17
Caption = #12513#12540#12523#12450#12489#12524#12473'(&M)'
+ Checked = True
+ State = cbChecked
TabOrder = 1
end
- object CheckBox3: TCheckBox
+ object IDCheckBox: TCheckBox
Left = 224
Top = 16
Width = 85
Height = 17
Caption = #26085#20184'+ID(&D)'
+ Checked = True
+ State = cbChecked
TabOrder = 2
end
- object CheckBox4: TCheckBox
+ object SentenceCheckBox: TCheckBox
Left = 320
Top = 16
Width = 69
Height = 17
Caption = #26412#25991'(&B)'
+ Checked = True
+ State = cbChecked
TabOrder = 3
end
end
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls,
- BoardGroup, GikoSystem;
+ BoardGroup, GikoSystem, bmRegExp, Giko;
type
TSearchDialog = class(TForm)
OkBotton: TButton;
CancelBotton: TButton;
Label1: TLabel;
- ComboBox1: TComboBox;
+ SearchComboBox: TComboBox;
CategoryListView: TListView;
AllReleaseButton: TButton;
AllSelectButton: TButton;
GroupBox1: TGroupBox;
- CheckBox1: TCheckBox;
- CheckBox2: TCheckBox;
- CheckBox3: TCheckBox;
- CheckBox4: TCheckBox;
+ NameCheckBox: TCheckBox;
+ MailCheckBox: TCheckBox;
+ IDCheckBox: TCheckBox;
+ SentenceCheckBox: TCheckBox;
procedure FormCreate(Sender: TObject);
procedure CategoryListViewSelectItem(Sender: TObject; Item: TListItem;
Selected: Boolean);
procedure AllSelectButtonClick(Sender: TObject);
procedure AllReleaseButtonClick(Sender: TObject);
procedure OkBottonClick(Sender: TObject);
+ procedure BoardListViewDblClick(Sender: TObject);
private
{ Private \90é\8c¾ }
FChkItem: TObject;
+ FRegItem: TThreadItem;
procedure SetCategoryList;
procedure SetBoardList(Item: TListItem);
procedure CheckItem(Item: TObject);
+ procedure OnMatch(Sender: TObject; LineInfo: RE_LineInfo_t);
public
{ Public \90é\8c¾ }
// constructor Create(AOwner: TComponent); overload; override;
end;
end;
+procedure TSearchDialog.OnMatch(Sender: TObject; LineInfo: RE_LineInfo_t);
+begin
+
+ // \92T\82µ\82Ä\82¢\82é\83t\83@\83C\83\8b\82©\82ç\8c©\82Â\82©\82Á\82½\82Ì\82Å\83\8a\83X\83g\82É\92Ç\89Á\82·\82é
+ BoardListView.AddItem( FRegItem.Title, FRegItem );
+ // \82±\82Ì\83t\83@\83C\83\8b\82Í\82à\82¤\8c©\82Â\82¯\82½\82Ì\82Å\82±\82ê\88È\8fã\91±\82¯\82È\82¢
+ TGrep( Sender ).Cancel := True;
+
+end;
+
procedure TSearchDialog.OkBottonClick(Sender: TObject);
var
i, j, k: Integer;
- Board: TBoard;
+ Category: TCategory;
+ Board: TBoard;
ThreadItem: TThreadItem;
List: TList;
- sl: TStringList;
+ //sl: TStringList;
+ ThreadFile: TFileStream;
+ sl: string;
+ Reg: TGrep;
+ Filter: string;
begin
Screen.Cursor := crHourglass;
- sl := TStringList.Create;
+ //sl := TStringList.Create;
List := TList.Create;
try
BoardListView.Clear;
+ // \83T\83C\83g\82Ì\92\86\82Ì (\91±\82)
for i := 0 to BBS2ch.Count - 1 do begin
- for j := 0 to BBS2ch.Items[i].Count - 1 do begin
- Board := TBoard(BBS2ch.Items[i]);
+ // \83J\83e\83S\83\8a\82Ì\92\86\82Ì (\91±\82)
+ Category := BBS2ch.Items[i];
+ for j := 0 to Category.Count - 1 do begin
+ // \94Â\82Ì\92\86\82Ì (\91±\82)
+ Board := Category.Items[j];
if not Board.IsThreadDatRead then
GikoSys.ReadSubjectFile(Board);
for k := 0 to Board.Count - 1 do begin
+ // \8cÂ\81X\82Ì\83X\83\8c\83b\83h\82Ì (\91±\82)
ThreadItem := Board.Items[k];
- if FileExists(ThreadItem.FileName) then begin
- sl.LoadFromFile(ThreadItem.FileName);
+ if FileExists( ThreadItem.GetThreadFileName ) then begin
+
+ // \83\8d\83O\82ª\91¶\8dÝ\82·\82é
+ Reg := TGrep.Create( nil );
+ try
+ Reg.OnMatch := OnMatch;
+ FRegItem := ThreadItem;
+
+ // grep \97p\82Ì\8c\9f\8dõ\83\8f\81[\83h\82ð\90¶\90¬
+ If NameCheckBox.Checked And
+ MailCheckBox.Checked And
+ IDCheckBox.Checked And
+ SentenceCheckBox.Checked Then
+ Begin
+ // \91S\82Ä\83Z\83b\83g\82³\82ê\82Ä\82¢\82é\8fê\8d\87\82Í\90³\8bK\95\\8c»\82ð\8eg\82í\82È\82¢
+ // (\90³\8bK\95\\8c»\82ð\8eg\82¤\82Æ\82©\82È\82è\92x\82¢\82Ì\82Å)
+ Reg.RegExp := SearchComboBox.Text;
+ Reg.GrepByStr( ThreadItem.GetThreadFileName );
+ End Else Begin
+ If NameCheckBox.Checked Then
+ Filter := '.*' + SearchComboBox.Text + '.*<>'
+ Else
+ Filter := '.*<>';
+ If MailCheckBox.Checked Then
+ Filter := Filter + '.*' + SearchComboBox.Text + '.*<>'
+ Else
+ Filter := Filter + '.*<>';
+ If IDCheckBox.Checked Then
+ Filter := Filter + '.*' + SearchComboBox.Text + '.*<>'
+ Else
+ Filter := Filter + '.*<>';
+ If SentenceCheckBox.Checked Then
+ Filter := Filter + '.*' + SearchComboBox.Text + '.*<>\n'
+ Else
+ Filter := Filter + '.*<>\n';
+
+ Reg.RegExp := Filter;
+
+ // \8c\9f\8dõ
+ // \81¦\8c©\82Â\82©\82Á\82½\82ç OnMatch \82É\94ò\82Ô
+ Reg.GrepByRegExp( ThreadItem.GetThreadFileName );
+ End;
+
+ finally
+ Reg.Destroy;
+ end;
+
end;
end;
end
end;
finally
- sl.Free;
+ //sl.Free;
List.Free;
Screen.Cursor := crDefault;
end;
end;
+procedure TSearchDialog.BoardListViewDblClick(Sender: TObject);
+begin
+
+ If TObject( BoardListView.Selected.Data ) is TThreadItem Then
+ GikoForm.InsertBrowserTab( TThreadItem(BoardListView.Selected.Data) );
+
+end;
end.