home *** CD-ROM | disk | FTP | other *** search
- unit Unit3;
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, StdCtrls, ExtCtrls;
-
- type
- TNewForm1 = class(TForm)
- RadioGroup1: TRadioGroup;
- Edit1: TEdit;
- Label1: TLabel;
- Button1: TButton;
- procedure Button1Click(Sender: TObject);
- private
- { Private-Deklarationen }
- public
- { Public-Deklarationen }
- end;
-
- procedure SetLock;
-
- implementation
-
- uses
- Unit1;
-
- {$R *.DFM}
-
- procedure SetLock;
- var
- NewForm: TNewForm1;
- begin
- NewForm := TNewForm1.Create(Application);
- try
- NewForm.RadioGroup1.ItemIndex := 0;
- NewForm.ShowModal;
- finally
- NewForm.Free;
- end;
- end;
-
- procedure TNewForm1.Button1Click(Sender: TObject);
- var
- i: integer;
- begin
- try
- i := StrToInt(Edit1.Text);
- except
- i := 0;
- end;
- if i>0 then
- begin
- with Form1.RtRegControl1 do
- case RadioGroup1.ItemIndex+1 of
- 1: begin
- CallsLeft := i;
- if CallsLeft<=0 then
- ShowMessage('Could not set the Count Lock.'+#13#10+'Bye, bye!');
- end;
- 2: begin
- DaysLeft := i;
- if DaysLeft<=0 then
- ShowMessage('Could not set the Date Lock.'+#13#10+'Bye, bye!');
- end;
- end;
- Close;
- end
- else
- MessageDlg('The number of calls/days must be greater then 0!',mtError,[mbOk],0);
- end;
-
- end.
-