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, Clipboard, and Errors
   Dialog Functions
   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
   Global objects
    settings
    controller
    session
    python
   Collections
    array
    map
    bytes
   File Format I/O
    image_data
    image_stream
   Utils
    crypto
    timer
   Comm
    serial
   Dialogs
    file_open
    file_save
    msg_ok
    msg_ok_cancel
    msg_yes_no
    msg_password
   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. Each dialog has its own reference page because constructor names, result values, and supported methods differ between dialog types.

Dialog Pages

Constructor Page Description
`file_open()` file_open Opens a file selection dialog.
`file_save()` file_save Opens a save-file dialog.
`msg_ok()` msg_ok Shows an OK message dialog.
`msg_ok_cancel()` msg_ok_cancel Shows an OK/Cancel message dialog.
`msg_yes_no()` msg_yes_no Shows a Yes/No message dialog.
`msg_password()` msg_password Shows a password OK/Cancel dialog.

File Dialogs

`file_open()` and `file_save()` use method calls to configure the dialog before it is shown. Their properties are read-only snapshots of the current configuration.

Common file dialog configuration methods are `title(text)`, `directory(path)`, `file(name)`, `add_filter(name, pattern)`, `on_result(callback)`, and `show()`. `file_open()` also supports `multi_select(enabled)`.

Without `on_result()`, `show()` waits for the dialog and 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 paths, or `none()` if the dialog is cancelled.


Message Dialogs

Message dialogs use method calls to set the title, message text, optional buttons, and result callback. Their properties are read-only result/configuration values.

Common message dialog methods are `title(text)`, `message(text)`, `buttons(enabled)`, `on_result(callback)`, `show()`, `click_ok()`, and `click_close()`. `msg_password()` also supports `password_label(text)` and `password(text)`.

Without `on_result()`, `show()` waits for the dialog and returns a result `map`.

With `on_result(callback)`, `show()` displays the dialog and returns the dialog object immediately. The callback receives one argument: the same result `map`.

Common result keys are `action`, `action_code`, `ok`, `cancel`, `affirmative`, `save`, and `password`. The password value is only meaningful for `msg_password()`.


Object Behavior

Dialog objects support common object methods documented on their individual pages. Dialog objects are not cloneable because they represent host dialog state and optional asynchronous callback state.

Previous: serial

Next: file_open

exprv4/reference/objects/dialogs.txt · Last modified: by andrej

Page Tools