Remember Details in assistent creator
Remember Details in assistent creator
How can you rember the details in an assistent form, that when a bugreport is send again, details like name email adress are remembered?
I saw it in the movie on the site, but can't reproduce it ...
I saw it in the movie on the site, but can't reproduce it ...
This is how madExcept is doing it:
This is by default the "OnAction" handler of the contact form.
Code: Select all
procedure HandleContactForm(form: INVForm; action: TNVAction; item: INVItem; exceptIntf: IMEException);
var s1, s2 : string;
edit : INVEdit;
check : INVCheckBox;
begin
case action of
nvaFormCreate : begin
s1 := RegReadStr(HKEY_CURRENT_USER, 'Software\madshi\ContactForm', 'RememberName');
s2 := RegReadStr(HKEY_CURRENT_USER, 'Software\madshi\ContactForm', 'RememberEmail');
if (s1 <> '') or (s2 <> '') then begin
edit := form.nvEdit('NameEdit');
if edit <> nil then
edit.Text := s1;
edit := form.nvEdit('EmailEdit');
if edit <> nil then
edit.Text := s2;
check := form.nvCheckBox('MemCheck');
if check <> nil then
check.Checked := true;
if form.ContinueButton.Enabled then
form.ActiveControl := form.ContinueButton.Name;
end;
end;
nvaFormClose : if form.ModalResult = nvmOk then begin
check := form.nvCheckBox('MemCheck');
if check <> nil then
if check.Checked then begin
edit := Form.nvEdit('NameEdit');
if edit <> nil then
RegWriteStr(HKEY_CURRENT_USER, 'Software\madshi\ContactForm', 'RememberName', edit.Text);
edit := Form.nvEdit('EmailEdit');
if edit <> nil then
RegWriteStr(HKEY_CURRENT_USER, 'Software\madshi\ContactForm', 'RememberEmail', edit.Text);
end else begin
RegDelVal(HKEY_CURRENT_USER, 'Software\madshi\ContactForm', 'RememberName');
RegDelVal(HKEY_CURRENT_USER, 'Software\madshi\ContactForm', 'RememberEmail');
end;
if exceptIntf <> nil then begin
edit := Form.nvEdit('NameEdit');
if edit <> nil then
s1 := edit.Text
else s1 := '';
edit := Form.nvEdit('EmailEdit');
if edit <> nil then
s2 := edit.Text
else s2 := '';
if s1 <> '' then
exceptIntf.MailFrom := s1 + ' ' + '<' + s2 + '>';
end;
end;
end;
end;