Sidebar

Home



Expressions V4


Tutorials

How-To

Reference

  Lexical basics
  Type system
  Variables and assignment
  Operators
  Expression rules
  Control flow
  Functions
  Built-in functions
   None and NaN
   Arithmetic
   Algebra
   Logarithmic and Exponential
   Trigonometric
   Rounding and Centering
   Strings
   Output, Formatting, and Errors
   Dialogs, Clipboard, Platform, and Paths
  Methods and properties
  Built-in methods
   Common Value Methods
   Number Methods
   String Basic Methods
   String Slice Methods
   String Parsing Methods
   String Formatting Methods
   String Regex Methods
   String Trim and Case Methods
  Objects
  Built-in objects
   Collections
    array
    map
    data_array
   Image data
   Image stream
   Dialogs
    fileopen
    filesave
    msgok
    msgokcancel
    msgyesno
    msgpassword
   GUI objects
    window
    panel
    group
    splitpanel
    label
    textbutton
    drawablebutton
    togglebutton
    togglegroup
    textinput
    textedit
    numinput
    slider
    combobox
    listbox
    progressbar
    led
    separator
    menu
    image
    snake
  Classes and user-defined objects
  Include system
  Error model
  Execution model and sessions
  Host integration
  Limits and performance
  Formal reference
  Glossary

Cookbook

exprv4:reference:objects:dialogs

Dialogs

Dialog objects let Expr scripts ask the user for input through host application dialogs.

This group contains file selection dialogs and message dialogs. More dialog objects can be added here later without mixing them with GUI control objects.


Dialog Pages

Constructor Page Description
`fileopen()` fileopen Opens a file selection dialog.
`filesave()` filesave Opens a save-file dialog.
`msgok()` msgok Shows an OK message dialog.
`msgokcancel()` msgokcancel Shows an OK/Cancel message dialog.
`msgyesno()` msgyesno Shows a Yes/No message dialog.
`msgpassword()` msgpassword Shows a password OK/Cancel dialog.

Common File Dialog Methods

Both `fileopen()` and `filesave()` support these configuration methods:

Method Returns Description
`title(text)` self Sets the dialog title.
`directory(path)` self Sets the initial directory. The path is resolved through host profile path rules.
`file(name)` self Sets the initial file name.
`add_filter(name, pattern)` self Adds a file filter.
`on_result(callback)` self Sets an asynchronous result callback.
`show()` array, self, or none Shows the dialog. Return depends on whether `on_result()` is used and whether the user cancels.

`fileopen()` also supports `multi_select(enabled)`. Message dialogs also support `message(text)`, `buttons(enabled)`, `click_ok()`, and `click_close()`. `msgpassword()` also supports `password_label(text)` and `password(text)`.


Result Values

Without `on_result()`, `show()` returns an `array` of selected paths. If the user cancels, it returns `none()`.

With `on_result(callback)`, `show()` displays the dialog and returns the dialog object immediately. The callback receives one argument: an `array` of selected file paths.

Previous: Image stream

Next: fileopen

exprv4/reference/objects/dialogs.txt · Last modified: (external edit)

Page Tools