unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, StdCtrls, ComCtrls;
type
TForm1 =
class(TForm)
lbFilter: TListBox;
edFilter: TEdit;
Label2: TLabel;
StatusBar1: TStatusBar;
BtnAdd: TButton;
procedure BtnAddClick(Sender: TObject);
private
Changed : Boolean;
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.BtnAddClick(Sender: TObject);
var counter,i : Integer;
NewItem :
string;
begin
NewItem := edFilter.Text;
if lbfilter.items.indexof (NewItem) > -1
then
begin
showmessage ('
Redundanzproblem!');
edfilter.SetFocus;
end
else begin
lbfilter.Items.Add(NewItem);
end;
lbfilter.Sorted := true;
edfilter.Clear;
counter := lbfilter.Items.Count;
label2.caption:='
(' + inttostr(counter) + '
)';
if (label2.caption ='
(0)')
then
label2.caption:='
()';
Statusbar1.Panels[0].text:='
Geändert';
Changed := true;
end;
...
//Sonderzeichen entfernen anhand von Search_Text in sgfiles.cells[0,i]
if checkbox1.checked
then begin
if (length(sgfiles.Cells[0,1])>1)
then begin
for lk := 0
to lbFilters.Items.Count - 1
do begin
StringGridReplace(sgfiles, lbFilters.Items[lk], '
');
end;
// for lk
//StringGridReplace(sgfiles,Search_text,' ');
//StringGridReplace(sgfiles,Search_Text,'');
Statusbar1.Panels[1].text:='
Geändert';
changed := true;
end;
// length
end;
// Checked
...
end.