unit SearchReplace;
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
interface
uses
GenDefs,OwnUtils,
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
Windows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,
Dialogs,StdCtrls,Utilities,OptionClass,ExtCtrls,language;
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
type
TSearchReplace= class(TForm)
Label1:TLabel;
Label2:TLabel;
Button1:TButton;
Button2:TButton;
ComboBox1:TComboBox;
ComboBox2:TComboBox;
Button3:TButton;
Panel1:TPanel;
Label3:TLabel;
Panel2:TPanel;
Panel3:TPanel;
Panel4:TPanel;
Button4:TButton;
Panel5:TPanel;
Panel6:TPanel;
CheckBox1:TCheckBox;
CheckBox2:TCheckBox;
Label5:TLabel;
Label4:TLabel;
procedure ComboBox1KeyDown(Sender:TObject;var Key:Word;Shift:TShiftState);
procedure ComboBox2KeyDown(Sender:TObject;var Key:Word;Shift:TShiftState);
procedure FormShow(Sender:TObject);
procedure FormOK(Key:integer);
procedure FormKeyDown(Sender:TObject;var Key:Word;Shift:TShiftState);
procedure ComboBox1Add(SearchString:TextString);
function FindinComboBox1(SearchString:JString):boolean;
procedure ComboBox1Click(Sender: TObject);
public
end;
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
var
Form2:TSearchReplace;
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
implementation
{$R *.dfm}
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
procedure TSearchReplace.FormOK(Key:integer);
begin
Close();
modalresult:=mrok;
end;
//------------------------------------------------------------------
//add to combobox --
//--
//------------------------------------------------------------------
procedure TSearchReplace.ComboBox1Add(SearchString:TextString);
var i:integer;
begin
Combobox1.items.Add(SearchString.S);
for i:=1 to length(opt.R.SearchString) do begin
if SearchString.S=opt.R.SearchString[i].S then
opt.R.SearchString[i].Regular:=SearchString.Regular;
end;
end;
//------------------------------------------------------------------
//Find in combobox --
//--
//------------------------------------------------------------------
function TSearchReplace.FindinComboBox1(SearchString:JString):boolean;
var i:integer;
begin
Result:=false;
for i:=1 to length(opt.R.SearchString) do begin
if trim(SearchString)=trim(opt.R.SearchString[i].S) then
Result:=Result or opt.R.SearchString[i].Regular;
end;
end;
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
procedure TSearchReplace.ComboBox1Click(Sender: TObject);
begin
ComboBox1.Color:=clWhite;
ComboBox2.Color:=clWhite;
end;
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
procedure TSearchReplace.ComboBox1KeyDown(Sender:TObject;var Key:Word;
Shift:TShiftState);
begin
ComboBox1.Color:=clWhite;
ComboBox2.Color:=clWhite;
if Key in [VK_F3,VK_F4,VK_F5] then begin
FormOK(Key)
end
else if (Key=VK_RETURN)and not Button3.Visible then begin
FormOK(Key)
end;
end;
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
procedure TSearchReplace.ComboBox2KeyDown(Sender:TObject;var Key:Word;
Shift:TShiftState);
begin
ComboBox1.Color:=clWhite;
ComboBox2.Color:=clWhite;
if Key in [VK_F3,VK_F4,VK_F5] then
FormOK(Key)
else if (Key=VK_RETURN) then
FormOK(Key);
end;
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
procedure TSearchReplace.FormKeyDown(Sender:TObject;var Key:Word;
Shift:TShiftState);
begin
if (Key=VK_RETURN)and not Button3.Visible then
FormOK(Key)
end;
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
procedure TSearchReplace.FormShow(Sender:TObject);
begin
setfocus();
ComboBox1.SetFocus();
end;
//------------------------------------------------------------------
//-
//- Ende dieser Quelle
//-
//------------------------------------------------------------------
end.
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
|
Haftungshinweis
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.
|