EAGLE Help

dlgReject()


Function
Closes the dialog and rejects its contents.

Syntax
void dlgReject([ int Result ]);

Description
The dlgReject function causes the dlgDialog to be closed and return after the current statement sequence has been completed.

Any changes the user has made to the dialog values will be discarded. The variables that have been given when the dialog objects were defined will be reset to their original values when the dialog returns.

The optional Result is the value that will be returned by the dialog. Typically this should be 0 or a negative integer value. If no value is given, it defaults to 0.

Note that dlgReject() does return to the normal program execution, so in a sequence like

dlgPushButton("Cancel") {
  dlgReject();
  dlgMessageBox("Rejecting!");
  }
the statement after dlgReject() will still be executed!

Calling dlgReject() implies a call to dlgReset().

See also dlgAccept, dlgReset, dlgDialog, A Complete Example

Example

int Result = dlgDialog("Test") {
               dlgPushButton("+OK")    dlgAccept(42);
               dlgPushButton("Cancel") dlgReject();
               };

Index Copyright © 2005 CadSoft Computer GmbH