EAGLE Help

dlgDialog


Function
Executes a User Language Dialog.

Syntax
int dlgDialog(string Title) block ;

Returns
The dlgDialog function returns an integer value that can be given a user defined meaning through a call to the dlgAccept() function.
If the dialog is simply closed, the return value will be 0.

Description
The dlgDialog function executes the dialog defined by block. This is the only dialog object that actually is a User Language builtin function. Therefore it can be used anywhere where a function call is allowed.

The block normally contains only other dialog objects, but it is also possible to use other User Language statements, for example to conditionally add objects to the dialog (see the second example below).

By default a dlgDialog contains a dlgVBoxLayout, so a simple dialog doesn't have to worry about the layout.

A dlgDialog should at some point contain a call to the dlgAccept() function in order to allow the user to close the dialog and accept its contents.

If all you need is a simple message box or file dialog you might want to use one of the Predefined Dialogs instead.

See also dlgGridLayout, dlgHBoxLayout, dlgVBoxLayout, dlgAccept, dlgReset, dlgReject, A Complete Example

Examples

int Result = dlgDialog("Hello") {
  dlgLabel("Hello world");
  dlgPushButton("+OK") dlgAccept();
  };
int haveButton = 1;
dlgDialog("Test") {
  dlgLabel("Start");
  if (haveButton)
     dlgPushButton("Here") dlgAccept();
  };

Index Copyright © 2005 CadSoft Computer GmbH