EAGLE Help Light

dlgAccept()

Funkce
Closes the dialog and accepts its contents.

Zápis
void dlgAccept([ int Result ]);

Description
The dlgAccept 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 accepted and are copied into the variables that have been given when the dialog objects were defined.

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

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


dlgPushButton("OK") {
  dlgAccept();
  dlgMessageBox("Accepting!");
  }
the statement after dlgAccept() will still be executed!
Viz také dlgReject, dlgDialog, A Complete Example

Příklad


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


OBSAH Translation © 2001 ELCAD v.o.s., Copyright © 2001 CadSoft Computer GmbH