1

I have modified the send-assistant of madExcept with a new checkbox. If the use checks this box, I want to send additional attachments with the bug report (a copy of the users data files).

How can I check if the user checked the box?

regards, -Vegar

Vegar
  • 12,828
  • 16
  • 85
  • 151
  • 1
    Have you asked in the madshi newsgroups (at news.soft-gems.net)? It is sometimes quiet in there but at the moment Mathias seems to be active and answers quickly. – frogb Jan 28 '10 at 16:13
  • The title suggests you want to know how to attach additional stuff. The body says you want to know how to inspect a checkbox. Those are two completely different things. Which are you having trouble with? (If you're having trouble with both, then consider asking two separate questions.) – Rob Kennedy Jan 28 '10 at 17:25
  • My problem is to attach a file only if the user asks for it. Will edit the title a little to clarify. I have asked the same question in the madExcept forum, but I have not tried any newsgroups. – Vegar Jan 28 '10 at 21:38

2 Answers2

0

I have solved this issue with help from madshi over at forum.madshi.net.

My solution involves the TMadExceptionHandler-component, and the event OnExceptionAction.

procedure TMainForm.MadExceptionHandler1ExceptAction(action: TExceptAction; 
  const exceptIntf: IMEException; var handled: Boolean);
var
  cbSendData: INVCheckbox;
  assistant: INVAssistant;
begin
  if action = eaSendBugReport2 then
  begin
    assistant := exceptIntf.GetAssistant(exceptIntf.SendAssistant);
    cbSendData := assistant.Forms[1].nvCheckBox('SendDataChk');

    exceptIntf.AdditionalAttachments.Clear;
    if (cbSendData.Checked) then
    begin
      //Add data files as attachments...
    end;
  end;
end;

One minor thing remains, and that is to enable/disable the checkbox on special occasions. Madshi tells me the proper way of doing that, is to register an actionhandler-callback with the assistant and check for an nvaItemEvent-action on the checkbox. I have not tried this yet.

-Vegar

Community
  • 1
  • 1
Vegar
  • 12,828
  • 16
  • 85
  • 151
-2

I don't know madExcept, but as far as it source code is Delphi (which seems from your tags), you can check it like this:

begin
  if CheckBox1.Checked then
    AttachDataFile;
end;

CheckBox1 is the name you set for the control when you dropped it into the forms editor. If you don't know the name, select it with the mouse and look at the object inspector for the property Name.

jachguate
  • 16,976
  • 3
  • 57
  • 98
  • 2
    Oh, I'm sorry, but if you don't know madExcept, I guess you shouldn't have tried to answer... – Vegar Jan 29 '10 at 08:34
  • Take a look here to see what it's all about: http://help.madshi.net/madExceptSettings9.htm – Vegar Jan 29 '10 at 08:46