📄 usecfinddialogs.~pas
字号:
unit uSecFindDialogs;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, uSecDialogs;
type
TSecFindFrm = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
CheckBox1: TCheckBox;
RadioGroup1: TRadioGroup;
procedure Button1Click(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure RadioGroup1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
FFindText: string;
FOnFind: TNotifyEvent;
FOptions: TFindOptions;
procedure SetOnFind(const Value: TNotifyEvent);
procedure SetFindText(const Value: string);
function GetFindText:string;
{ Private declarations }
protected
public
{ Public declarations }
constructor create(Aowner:TComponent);override;
property FindText:string read GetFindText write SetFindText;
property Options: TFindOptions read FOptions write FOptions default [frDown];
property OnFind:TNotifyEvent read FOnFind write SetOnFind;
end;
implementation
{$R *.dfm}
{ TForm1 }
procedure TSecFindFrm.SetOnFind(const Value: TNotifyEvent);
begin
FOnFind := Value;
end;
procedure TSecFindFrm.Button1Click(Sender: TObject);
begin
if assigned(FOnFind) then
FOnFind(Sender);
end;
procedure TSecFindFrm.SetFindText(const Value: string);
begin
FFindText := Value;
Edit1.Text := FFindText;
end;
function TSecFindFrm.GetFindText: string;
begin
FFindText := Edit1.Text;
result := FFindText;
end;
procedure TSecFindFrm.CheckBox1Click(Sender: TObject);
begin
if CheckBox1.Checked then
FOptions:=FOptions+[frMatchCase]
else
FOptions:=FOptions-[frMatchCase];
end;
procedure TSecFindFrm.RadioGroup1Click(Sender: TObject);
begin
if RadioGroup1.ItemIndex=0 then
FOptions:=FOptions-[frDown]
else if RadioGroup1.ItemIndex=1 then
FOptions:=FOptions+[frDown];
end;
constructor TSecFindFrm.create(Aowner: TComponent);
begin
inherited create(AOwner);
FOnFind:=TSecFindDialog(AOwner).OnFind;
FOptions:=FOptions+[frDown];
end;
procedure TSecFindFrm.Button2Click(Sender: TObject);
begin
close;
end;
procedure TSecFindFrm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=cafree;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -