| Package | Top Level |
| Class | public class Dialogs |
dialogs object.
See also
| Method | Defined by | ||
|---|---|---|---|
|
closeSplashForm(formId:Number):void
Closes a splash form opened with
showSplashForm. | Dialogs | ||
|
showConfigDialog():void
Shows the application configuration dialog.
| Dialogs | ||
|
showEjectDriveDialog():void
Shows the system "Eject drive" dialog.
| Dialogs | ||
|
showForm(controls:Array, title:String = "Appetizer", buttonLabel:String = "OK"):void
Builds and displays a form dialog, which can be used to get user's input.
| Dialogs | ||
|
showImportDialog():void
Shows the application "Import" dialog, which allows importing shortcuts.
| Dialogs | ||
|
showMessage(message:String, buttons:String = "ok", type:String = "information"):String
Shows a message box to the user.
| Dialogs | ||
|
showNewShortcutDialog():void
Shows the application "New shortcut" dialog.
| Dialogs | ||
|
showPreferences():void
Shows the Preferences dialog box of the plugin.
| Dialogs | ||
|
showSplashForm(message:String, title:String = ""):Number
Displays some text on a modal splash screen.
| Dialogs | ||
| closeSplashForm | () | method |
public function closeSplashForm(formId:Number):void
Closes a splash form opened with showSplashForm.
formId:Number — The form identifier
|
See also
| showConfigDialog | () | method |
public function showConfigDialog():voidShows the application configuration dialog.
| showEjectDriveDialog | () | method |
public function showEjectDriveDialog():voidShows the system "Eject drive" dialog.
| showForm | () | method |
public function showForm(controls:Array, title:String = "Appetizer", buttonLabel:String = "OK"):voidBuilds and displays a form dialog, which can be used to get user's input. The function takes, as a first parameter, a table of objects, each representing a control (such as a check box or text field). The properties of these controls are the same as the properties of a preference.
Parameterscontrols:Array — The table of controls
|
|
title:String (default = "Appetizer") — The form title
|
|
buttonLabel:String (default = "OK") — The form button label
|
See also
-- Build the table of controls
controls = {}
-- Add a text field
table.insert(controls, {
type = "Text",
name = "textExample",
title = "Type some text:",
description = "This is a text field"
})
-- Add a check box
table.insert(controls, {
type = "CheckBox",
name = "checkboxExample",
defaultValue = "true",
title = "Are you sure?"
})
-- Add a popup
table.insert(controls, {
type = "Popup",
name = "popupExample",
defaultValue = "two",
title = "Popup",
options = {
one = "First option",
two = "Second option",
three = "Third option"
}
})
-- Display the form
result = dialogs:showForm(controls, "Please select some values", "Save")
if result == null then
trace("User cancelled")
else
for key, value in pairs(result) do
trace(key, " = ", value)
end
end
appetizer:addEventListener("trayIconMenuOpening", "appetizer_trayIconMenuOpening")
trace("Listening to the "trayIconMenuOpening" event...")
| showImportDialog | () | method |
public function showImportDialog():voidShows the application "Import" dialog, which allows importing shortcuts.
| showMessage | () | method |
public function showMessage(message:String, buttons:String = "ok", type:String = "information"):String
Shows a message box to the user. There are four kinds of message boxes: information,
warning, error and confirmation. Currently, the only difference
between them is that they display a different icon. Additionally, each message box can have different
combinations of buttons among yes, no, ok and cancel.
When you call this function the script is stopped until the user clicks on a button. You can then
check the return value of the function to know which button has been clicked. To display a simple alert
box with just an "OK" button, simply use dialogs.showMessage("my message").
message:String — The message to display.
|
|
buttons:String (default = "ok") — The buttons to display. Possible values are "ok", "yesNo" and "yesNoCancel".
|
|
type:String (default = "information") — The type of message box. Possible values are "information", "warning", "error" and "confirmation".
|
String — The button that was clicked. Possible values are "ok", "yes", "no" or "cancel".
|
result = dialogs:showMessage("This is an error message with an 'ok' button", "ok", "error")
dialogs:showMessage("'"..result.."' was clicked")
result = dialogs:showMessage("This is a warning message with yes / no buttons", "yesNo", "warning")
dialogs:showMessage("'"..result.."' was clicked")
result = dialogs:showMessage("This is a confirmation message with yes / no / cancel buttons", "yesNoCancel", "confirmation")
dialogs:showMessage("'"..result.."' was clicked")
| showNewShortcutDialog | () | method |
public function showNewShortcutDialog():voidShows the application "New shortcut" dialog. If the user clicks "Save" on it, a new shortcut will be created.
| showPreferences | () | method |
public function showPreferences():voidShows the Preferences dialog box of the plugin.
See also
| showSplashForm | () | method |
public function showSplashForm(message:String, title:String = ""):Number
Displays some text on a modal splash screen. It can be used for example as a "waiting" screen during
a time consuming operation. The function returns an ID that you will need to close the form
using closeSplashScreen.
message:String — The message to display
|
|
title:String (default = "") — The form title
|
Number — The form identifier
|
See also
local formId = dialogs:showSplashForm("Operation in progress...", "Please wait...")
doSomeTimeConsumingOperationHere()
dialogs:closeSplashForm(formId)