class fwt::Dialog

sys::Obj
  fwt::Widget
    fwt::Pane
      fwt::ContentPane
        fwt::Window
          fwt::Dialog

@Js
@Serializable

Source

Dialog is a transient window, typically used to notify or input information from the user. Dialog also contains convenience routines for opening message boxes.

body

Obj? body

Source

Main body of the content:

  • Str: displays string as label
  • Widget: used as main content See buildContent.
buildContent

virtual This buildContent()

Source

Build the dialog content using the image, body, details, and commands fields. Return this. This method is automatically called by open if the content field is null.

cancel

static Command cancel()

Source

Predefined dialog command for Cancel.

commands

Command[]? commands

Source

The commands are mapped to buttons along the bottom of the dialog. If a predefined command such as ok is passed, then it closes the dialog and is returned as the result. If a custom command is passed, then it should close the dialog as appropiate with the result object.

defCommand

Command? defCommand

Source

Optional command to specify as default action. This field must be configured after commands is set. Use null for no default command.

details

Obj? details

Source

The details parameter is hidden by default, but may be displayed by the user via the "Details" button. The details button is implicitly added to the command set if details is non-null. Details may be any of the following

  • Str: displays string as label
  • Err: displays error trace as string
  • Widget: mounted as main content of details box See buildContent.
image

Image? image

Source

Image to the left of the body when building content. See buildContent.

make

new make(Window? parent, |This|? f := null)

Source

Construct dialog.

no

static Command no()

Source

Predefined dialog command for No.

ok

static Command ok()

Source

Predefined dialog command for OK.

okCancel

static Command[] okCancel()

Source

Convenience for [ok, cancel].

open

virtual override Obj? open()

Source

If the content field is null, then construct is via buildContent.

openErr

static Obj? openErr(Window? parent, Str msg, Obj? details := null, Command[] commands := [Dialog.ok()])

Source

Open an error message box. See openMsgBox.

openInfo

static Obj? openInfo(Window? parent, Str msg, Obj? details := null, Command[] commands := [Dialog.ok()])

Source

Open an information message box. See openMsgBox.

openMsgBox

static Obj? openMsgBox(Pod pod, Str keyBase, Window? parent, Obj body, Obj? details := null, Command[] commands := [Dialog.ok()])

Source

Open a message box. The pod's locale properties map as follows:

  • "{keyBase}.name": title of the message box
  • "{keyBase}.icon": icon for the message box

See buildContent for a description of the body, details, and commands. You may pass commands as the details parameter if details are null.

The command invoked to close message box is returned. If the dialog is canceled using the window manager then null is returned.

openPromptStr

static Str? openPromptStr(Window? parent, Str msg, Str def := "", Int prefCols := 20)

Source

Open a prompt for the user to enter a string with an ok and cancel button. Return the string value or null if the dialog is canceled. The text field is populated with the def string which defaults to "".

openQuestion

static Obj? openQuestion(Window? parent, Str msg, Obj? details := null, Command[] commands := [Dialog.ok()])

Source

Open a question message box. See openMsgBox.

openWarn

static Obj? openWarn(Window? parent, Str msg, Obj? details := null, Command[] commands := [Dialog.ok()])

Source

Open a warning message box. See openMsgBox.

setDefButton

protected Void setDefButton(Button b)

Source

yes

static Command yes()

Source

Predefined dialog command for Yes.

yesNo

static Command[] yesNo()

Source

Convenience for [yes, no].