unit UGamedlg;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, FileCtrl;
type
TForm1 =
class(TForm)
DirectoryListBox: TDirectoryListBox;
DriveComboBox: TDriveComboBox;
FileListBox: TFileListBox;
FilterComboBox: TFilterComboBox;
Label1: TLabel;
lblFiletypes: TLabel;
lblDescription: TLabel;
mDescription: TMemo;
btnOk: TBitBtn;
btnCancel: TBitBtn;
btnHelp: TBitBtn;
lblFilename: TLabel;
procedure FileListBoxKeyPress(Sender: TObject;
var Key: Char);
procedure btnOkClick(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btnOkClick(Sender: TObject);
var
Filename:
String;
Filepart:
String;
Fileextn:
String;
ExtSepPos: Integer;
begin
Fileextn := '
.txt';
Filename := FileListBox.FileName;
FilePart := Filename;
ExtSepPos := POS('
.',FileName);
if ExtSepPos>0
then System.Delete(Filepart,ExtSepPos,3);
{if Key = #13 then}
if ExtractFileExt(FileName) = '
.rtf'
then
begin
mDescription.Clear;
Filename := ChangeFileExt(Filename,'
.txt');
mDescription.Lines.LoadFromFile(Filename);
end;
end;
procedure TForm1.FileListBoxKeyPress(Sender: TObject;
var Key: Char);
begin
BtnOkClick(Sender);
//funktioniert leider nicht wie gewünscht
end;
end.