home *** CD-ROM | disk | FTP | other *** search
- unit Dmo_dlp2;
-
- interface
-
- uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, Buttons,
- StdCtrls, sysutils, dialogs, dmo_dlp1;
-
- type
- TFormSel = class(TForm)
- OKBtn: TBitBtn;
- CancelBtn: TBitBtn;
- ListBox1: TListBox;
- procedure FileSelShow(Sender: TObject);
- procedure ListBox1DblClick(Sender: TObject);
- procedure OkClick(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- FormSel: TFormSel;
-
- implementation
-
- {$R *.DFM}
-
- procedure TFormSel.FileSelShow(Sender: TObject);
- var
- i: Integer;
- begin
- ListBox1.items.clear; { reset the contents}
-
- for i:=0 to TotalForms -1 do
- begin
- ListBox1.items.AddObject(FormName[i],TObject(i));
- end;
-
- end;
-
- procedure TFormSel.ListBox1DblClick(Sender: TObject);
- var
- idx: integer;
- begin
- idx:=ListBox1.ItemIndex; {index of the selected item }
- SelectedForm:=integer(ListBox1.items.objects[idx]); { set the selected form}
- ModalResult:=mrOk;
- hide;
- end;
-
- procedure TFormSel.OkClick(Sender: TObject);
- begin
- ListBox1DblClick(sender);
- end;
-
- end.
-