madExcept,在将其他文件附加到报告之前检查自定义助手中复选框的状态

发布于 2024-08-19 11:10:50 字数 111 浏览 2 评论 0原文

我用一个新的复选框修改了 madExcept 的发送助手。如果用户选中此框,我想发送带有错误报告的附加附件(用户数据文件的副本)。

如何检查用户是否选中了该框?

问候, -维加

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

來不及說愛妳 2024-08-26 11:10:50

我已经在 madshi 的帮助下解决了这个问题 forum.madshi.net

我的解决方案涉及 TMadExceptionHandler-component 和事件 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;

还剩下一件小事,那就是在特殊情况下启用/禁用该复选框。 Madshi 告诉我正确的方法是向助手注册一个 actionhandler-callback,并检查复选框上的 nvaItemEvent-action。我还没有尝试过这个。

-维加

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

自此以后,行同陌路 2024-08-26 11:10:50

我不知道 madExcept,但就其源代码是 Delphi (从您的标签看来),您可以像这样检查它:

begin
  if CheckBox1.Checked then
    AttachDataFile;
end;

CheckBox1 是您将控件放入表单编辑器时为控件设置的名称。如果您不知道名称,请用鼠标选择它,然后在对象检查器中查看属性名称。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文