views:

133

answers:

2

Hi,

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

A: 

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
Oh, I'm sorry, but if you don't know madExcept, I guess you shouldn't have tried to answer...
Vegar
Take a look here to see what it's all about: http://help.madshi.net/madExceptSettings9.htm
Vegar
+1  A: 

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

Vegar