class fwt::Dialog
sys::Obj fwt::Widget fwt::Pane fwt::ContentPane fwt::Window fwt::Dialog
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
Main body of the content:
- Str: displays string as label
- Widget: used as main content See
buildContent
.
- buildContent
-
virtual This buildContent()
Build the dialog content using the
image
,body
,details
, andcommands
fields. Return this. This method is automatically called byopen
if the content field is null. - cancel
-
static Command cancel()
Predefined dialog command for Cancel.
- commands
-
Command[]? commands
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
Optional command to specify as default action. This field must be configured after
commands
is set. Usenull
for no default command. - details
-
Obj? details
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
Image to the left of the body when building content. See
buildContent
. - make
-
new make(Window? parent, |This|? f := null)
Construct dialog.
- no
-
static Command no()
Predefined dialog command for No.
- ok
-
static Command ok()
Predefined dialog command for OK.
- okCancel
-
static Command[] okCancel()
Convenience for
[ok, cancel]
. - open
-
virtual override Obj? open()
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()])
Open an error message box. See
openMsgBox
. - openInfo
-
static Obj? openInfo(Window? parent, Str msg, Obj? details := null, Command[] commands := [Dialog.ok()])
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()])
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)
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()])
Open a question message box. See
openMsgBox
. - openWarn
-
static Obj? openWarn(Window? parent, Str msg, Obj? details := null, Command[] commands := [Dialog.ok()])
Open a warning message box. See
openMsgBox
. - setDefButton
- yes
-
static Command yes()
Predefined dialog command for Yes.
- yesNo
-
static Command[] yesNo()
Convenience for
[yes, no]
.