unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, FileCtrl, ComCtrls, ShellCtrls, Buttons;
type
TDatei =
class(TForm)
Dateiliste: TFileListBox;
Dateityp: TFilterComboBox;
OK: TButton;
Ordner: TDirectoryListBox;
Esc: TButton;
DriveComboBox1: TDriveComboBox;
ListBox1: TListBox;
Laden: TButton;
OpenDialog: TOpenDialog;
procedure EscClick(Sender: TObject);
procedure OKClick(Sender: TObject);
procedure LadenClick(Sender: TObject);
private
s : tstringlist;
public
Parameter: TStringlist;
end;
var
Datei: TDatei;
implementation
uses GraphProg;
{$R *.dfm}
procedure TDatei.EscClick(Sender: TObject);
begin
close;
end;
{
procedure TDatei.SetNames(names: string);
var
j: integer;
begin
FNames.DelimitedText := parameter[Item.Index];
for j := 0 to Pred(FNames.Count) do
begin
graph.Canvas.Pixels[100, Strtoint(Fnames[j])] := clRed;
end;
end; }
procedure TDatei.OKClick(Sender: TObject);
var
slTemp: TStringlist;
i: Integer;
begin
listbox1.clear;
slTemp := TStringlist.Create;
try
slTemp.LoadFromFile(Dateiliste.Filename);
for i := 0
to slTemp.Count - 1
do begin
ListBox1.Items.Add(slTemp.Strings[i]);
end;
finally
FreeAndNil(slTemp);
end;
end;
{
procedure TDatei.LadenClick(Sender: TObject);
var
i : integer;
s : tstringlist;
t : string;
begin
s:= tstringlist.Create;
{t:= tstringlist.Create;}
{ try
s.LoadFromFile(Dateiliste.Filename);
for i := 0 to s.Count -1 do
begin
t := s.Strings[i];
graph.Canvas.Pixels[10, strtoint(t)] :=clred ;
end;
finally
freeandnil(s);
end;
end; }
procedure tdatei.ladenClick(Sender: TObject);
var
SL: TStringList;
i: Integer;
T: Textfile;
SInString:
String;
begin
if (opendialog.Execute)
then begin
SL := TStringList.Create;
try
AssignFile(T,opendialog.FileName);
Reset(T);
while (
not Eof(T))
do begin
ReadLn(T,SInString);
SL.Delimiter := '
;';
SL.DelimitedText := SInString;
listbox1.Append;
for i := 0
to SL.Count-1
do
listbox1.Fields[I].AsString := SL.Strings[i];
listbox1.Post;
end;
finally
SL.Free;
end;
end;
CloseFile(T);
end;
{
procedure TDatei.LadenClick(Sender: TObject);
var
Para: TStringlist;
j: Integer;
Wert: integer;
begin
parameter := TStringlist.Create;
parameter.LoadFromFile(Dateiliste.Filename);
FNames.DelimitedText := parameter[0];
for j := 0 to Pred(FNames.Count) do
begin
graph.Canvas.Pixels[100, Strtoint(Fnames[j])] := clRed;
end;
parameter.Delete(0);
end;
procedure TDatei.LadenClick(Sender: TObject);
var
wert: integer;
i : integer;
begin }
{ para := dateiliste.Items[0];
wert := Strtoint(para); }
{ close;
try
parameter := tstringlist.create;
parameter.LoadFromFile(Dateiliste.Filename);
setnames(parameter[0]);
begin
Bitmap := TBitmap.Create;
try
with Bitmap do begin
LoadFromFile('C:\Dokumente und Einstellungen\Yann\Eigene Dateien\Eigene Bilder\graph\koordinatensystem1.bmp');
graph.Canvas.Draw(0,0,BitMap);
end;
finally
Bitmap.Free;
end;
end;
for i := 0 to dateiliste.InstanceSize - 1 do begin
graph.Canvas.Pixels[i*10, 100] := clRed;
end;
finally
FreeAndNil(parameter);
end;
end;
{procedure TDatei.DateilisteChange(Sender: TObject);
begin
if dateiliste.Filename = 'gaga.ink' then
ok.Enabled := true;
{else datei.laden.Enabled := false;
if datei.Dateiliste.Filename = '*.*' then
datei.ok.Enabled := true
else datei.ok.Enabled := false;
end; }
end.