-
Notifications
You must be signed in to change notification settings - Fork 2
/
FLevelListDialog.pas
39 lines (31 loc) · 993 Bytes
/
FLevelListDialog.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
unit FLevelListDialog;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls,
SharedGlobals;
type
TFLevelListDialog = class(TForm)
MatchingLevelsList: TListBox;
btnSelect: TButton;
procedure btnSelectClick(Sender: TObject);
procedure FormResize(Sender: TObject);
private
FSelectedFileName: string;
public
property SelectedFileName: string read FSelectedFileName write FSelectedFileName;
end;
implementation
{$R *.dfm}
procedure TFLevelListDialog.btnSelectClick(Sender: TObject);
begin
if MatchingLevelsList.ItemIndex <> -1 then
SelectedFileName := MatchingLevelsList.Items[MatchingLevelsList.ItemIndex];
ModalResult := mrOk;
end;
procedure TFLevelListDialog.FormResize(Sender: TObject);
begin
// Center the "Load" button horizontally when the form is resized
btnSelect.Left := (ClientWidth - btnSelect.Width) div 2;
end;
end.