📄 usearch.pas
字号:
unit USearch;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls;
type
TSearch = class(TForm)
PageControl1: TPageControl;
TabSheet1: TTabSheet;
btnOK: TButton;
btnCancel: TButton;
Label1: TLabel;
cbSearch: TComboBox;
GroupBox1: TGroupBox;
chkMatchCase: TCheckBox;
chkWholeWord: TCheckBox;
GroupBox2: TGroupBox;
chkDown: TRadioButton;
chkUp: TRadioButton;
GroupBox3: TGroupBox;
GroupBox4: TGroupBox;
chkEntire: TRadioButton;
chkSelect: TRadioButton;
chkCursor: TRadioButton;
chkFirst: TRadioButton;
procedure FormActivate(Sender: TObject);
procedure cbSearchKeyPress(Sender: TObject; var Key: Char);
procedure btnOKClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure LoadFindStr;
public
{ Public declarations }
end;
var
Search: TSearch;
implementation
uses utils, Uconst;
{$R *.DFM}
procedure TSearch.FormActivate(Sender: TObject);
begin
cbSearch.SetFocus;
end;
procedure TSearch.cbSearchKeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then begin
ModalResult:= mrOK;
btnOKClick(self);
Key:= #0;
end;
end;
procedure TSearch.btnOKClick(Sender: TObject);
begin
SaveFindText(cbSearch.Text);
end;
// 傈俊 八祸茄 巩磊凯阑 霓焊 冠胶俊 眠啊茄促.
procedure TSearch.LoadFindStr;
var
I,Pos1:integer;
TextList: TStringList;
begin
TextList := TStringList.Create;
IniFile.ReadSectionValues('FindText',TextList);
if TextList.Count<1 then Exit;
cbSearch.Items.Clear;
for I:= TextList.Count-1 downto 1 do begin
Pos1:=Pos('=',TextList[I]);
if Pos1>0 then
cbSearch.Items.Add(Copy(TextList[I],Pos1+1,Length(TextList[I])));
end;
TextList.Free;
end;
procedure TSearch.FormCreate(Sender: TObject);
begin
LoadFindStr;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -