NG TaskDialog 2018 - verification checkbox checked or not ?

Hello everyone,

I could not find the answer on the forum so I decided to post the question.

With NGInputTaskDialog, OnButtonClick event how do I check if the verification checkbox is checked or not checked.

I have tried tons of variation around the tdfVerificationFlagChecked flag, but was unable to distinguish a checked state from an un-checked state.

Thanks in advance


Cheers

Mathias

Comments

  • 7 Comments sorted by Votes Date Added
  • Thanks for report. 
    In current source version, you can use OnVerificationClick event handler, in which you can test Flags property. However, the bug has been fixed, and Flags property will also report verification state in OnButtonClick in the next release.
  • Hello Eugene and thank you for your answer.

    I was not reporting a bug, and the function probably works correctly.

    I was asking for a code snippet to check the state of the verificationcheckbox in NGDialogs. How do you do it ? Is it something like :

    procedure TfrmKWAssign.NGInputDialog1ButtonClick(Sender: TObject;
    AModalResult: TModalResult; ACustomButton: TNGTaskDlgButtonItem;
    var ACanClose: Boolean);
    begin
    if AModalResult = mrYes then
    begin
    if tdfVerificationFlagChecked then ShowMessage('checked') else ShowMessage('unchecked');
    end;
    end;

    or maybe :

    procedure TfrmKWAssign.NGInputDialog1ButtonClick(Sender: TObject;
    AModalResult: TModalResult; ACustomButton: TNGTaskDlgButtonItem;
    var ACanClose: Boolean);
    begin
    if AModalResult = mrYes then
    begin
    if tdfVerificationFlagChecked IN NGInputDialog1.flags then ShowMessage('no more asking') else ShowMessage('ask me again');
    end;
    end;

    Thank you in advance if you can provide me with the correct way to do it.

    Have a good day

    Cheers


    Mathias
  • edited May 2018 Posts: 0 Accepted Answer Vote Up0Vote Down
    Do it like this:

    var
      VerificationChecked: Boolean;

    procedure TForm2.NGInputDialog1VerificationClick(Sender: TObject);
    begin
      VerificationChecked := (tdfVerificationFlagChecked in NGInputDialog1.Flags);
    end;

    procedure TForm2.NGInputDialog1ButtonClick(Sender: TObject;
      AModalResult: TModalResult; ACustomButton: TNGTaskDlgButtonItem;
      var ACanClose: Boolean);
    begin
      if AModalResult = mrYes then
      begin
        if VerificationChecked then
          ShowMessage('checked')
        else
          ShowMessage('unchecked');
      end;
    end;
  • The shorter way (using only OnButtonClick event) will be available with my resent bug fix:

    procedure TForm2.NGInputDialog1ButtonClick(Sender: TObject;
      AModalResult: TModalResult; ACustomButton: TNGTaskDlgButtonItem;
      var ACanClose: Boolean);
    begin
      if AModalResult = mrYes then
      begin
        if tdfVerificationFlagChecked in NGInputDialog1.Flags then
          ShowMessage('checked')
        else
          ShowMessage('unchecked');
      end;
    end;
  • Thank you very much Eugene,

    The solution you provided works like a charm for now and I thank you again for you fast reply :)

    Any idea of the availability date of the update you mentioned  ?

    Wishing you a good day

    Cheers

    Mathias
  • Posts: 0 Accepted Answer Vote Up0Vote Down
    >>Any idea of the availability date of the update you mentioned  ?<<
    Release 2018.2 is available now.
  • Version updated and tdfVerificationFlagChecked working as explained earlier.


    Thanks again for your fast answers and great support :)

    Cheers


    Mathias
Sign In or Register to comment.