procedure TPrimeApp.doPrimeDialog;
var
R: Objects.TRect;
dummy: Word;
line_start, line_end, cindex, cforce: PView;
begin
R.Assign(0,0,72,16);
R.Move(4,3);
PrimeDialog := New(PDialog, Init(R, 'Prime finder Dialog'));
with PrimeDialog^ do begin
// text 1
R.Assign(2,1, 43,2);
Insert(New(PStaticText, Init(R, 'Start Prime:')));
// text 2
R.Assign(2,4, 43,5);
Insert(New(PStaticText, Init(R, 'End Prime:')));
// input line: prime start
R.Assign(2,2, 64,3);
line_start := New(PInputLine,Init(R, 250));
insert(line_start);
// input line: prime end
R.Assign(2,5, 64,6);
line_end := New(PInputLine,Init(R, 250));
insert(line_end);
// checkbox: parameter
R.Assign( 2,7, 23, 8); Insert(New(PStaticText, Init(R, 'Parameter 1:')));
R.Assign(26,7, 47, 8); Insert(New(PStaticText, Init(R, 'Parameter 2:')));
R.Assign( 2,8, 23, 9); cindex := New(PCheckBoxes, Init(R, NewSItem('~o~nly one check', nil)));
R.Assign(26,8, 47, 9); cforce := New(PCheckBoxes, Init(R, NewSItem('~f~orce start' , nil)));
Insert(cindex);
Insert(cforce);
// text: index
R.Assign(2,10, 42,11); Insert(New(PStaticText, Init(R, 'Index:')));
R.Assign(2,11, 42,12); Insert(New(PStaticText, Init(R, 'Prime:')));
// text: prime
R.Assign(10,10, 42,11); Insert(New(PStaticText, Init(R, '1')));
R.Assign(10,11, 42,12); Insert(New(PStaticText, Init(R, '2')));
// button: cancel
R.Assign(2,13, 24,15);
Insert(New(PButton, Init(R, '~C~ancel Search', cmCancelSearch, bfDefault)));
// button: load data
R.Assign(26,13, 46,15);
Insert(New(PButton, Init(R, '~L~oad Data', cmStopAndLoad, bfNormal)));
// button: save data
R.Assign(48,13, 69,15);
Insert(New(PButton, Init(R, '~S~top and saves', cmStopAndSave, bfNormal)));
end;
if ValidView(PrimeDialog) <> nil then begin
desktop^.insert(PrimeDialog);
end;
end;