home *** CD-ROM | disk | FTP | other *** search
- unit Dial;
-
- Interface
-
- function GetPhoneNum: String;
-
- Implementation
-
- uses Drivers, App, Dialogs, Views, Objects;
-
- const
- hnDialHist = 1;
-
- function GetPhoneNum: String;
- var
- Dialog: PDialog;
- Control: PView;
- R: TRect;
- PhoneString: string[25];
- begin
- R.Assign(20, 5, 50, 12);
- Dialog := New(PDialog, Init(R, 'Enter phone number'));
- with Dialog^ do
- begin
- R.Assign(2, 2, 24, 3);
- Control := New(PInputLine, Init(R, 25));
- Insert(Control);
- R.Assign(25, 2, 28, 3);
- Insert(New(PHistory, Init(R, PInputLine(Control), hnDialHist)));
- R.Assign(2, 4, 12, 6);
- Insert(New(PButton, Init(R, 'O~k~', cmOK, bfDefault)));
- R.Assign(16, 4, 26, 6);
- Insert(New(PButton, Init(R, 'Cancel', cmCancel, bfNormal)));
- SelectNext(False);
- end;
- if DeskTop^.ExecView(Dialog) = cmCancel then GetPhoneNum := ''
- else begin
- Dialog^.GetData(PhoneString);
- GetPhoneNum := PhoneString;
- end;
- Dialog^.Done;
- end;
- end.
-