Untersuchungsergebnis.~2~ Download desSQL {SQL[140] Ada[150] Abap[1289]}zum Wurzelverzeichnis wechseln
unit SearchReplace;
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
interface
uses
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
GenDefs, Options, Language,
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Utilities, ExtCtrls;
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
type
TSearchReplace = class(TForm)
Label1: TLabel;
Naechstes: TButton;
Button2: TButton;
Panel1: TPanel;
Panel2: TPanel;
Panel4: TPanel;
Button4: TButton;
Panel5: TPanel;
Label4: TLabel;
Voriges: TButton;
Edit1: TEdit;
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: String): boolean;
procedure ComboBox1Click(Sender: TObject);
procedure showSearchDialogue(Add:String);
procedure showReplaceDialogue();
procedure FormCreate(Sender: TObject);
public
origheight:integer;
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: String): 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.FormCreate(Sender: TObject);
begin
origheight:=height;
end;
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
procedure TSearchReplace.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (Key = VK_RETURN) and not Button3.Visible then
FormOK(Key)
else
Close();
end;
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
procedure TSearchReplace.showSearchDialogue(Add:String);
begin
caption:=trans(392,'Suchen/Ersetzen')+' '+Add;
Panel3.height := 0;
Label4.width := (width - 4 * Naechstes.width) div 6;
Naechstes.Caption:=trans(322,'nächstes') ;
Button4.Visible := true;
Button3.Visible := false;
ComboBox2.TabStop := false;
height := origheight- Panel2.Height;
Voriges.Show();
end;
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
procedure TSearchReplace.showReplaceDialogue();
begin
Label4.width := (width - 3 * Naechstes.width) div 3;
Naechstes.Caption:=trans(176,'ersetzen');
Panel3.height := Panel2.height;
Button4.Visible := false;
Button3.Visible := true;
ComboBox2.TabStop := true;
height := origheight;
Voriges.Hide();
end;
//------------------------------------------------------------------
//-
//------------------------------------------------------------------
procedure TSearchReplace.FormShow(Sender: TObject);
begin
setfocus();
ComboBox1.setfocus();
end;
//------------------------------------------------------------------
//-
//- Ende dieser Quelle
//-
//------------------------------------------------------------------
end.
[ zur Elbe Produktseite wechseln0.389Quellennavigators
]