EDOBE XDOM TAKE 6 IR - PRODUCTSHEET Especificaciones Pagina 75

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 304
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 74
CHAPTER 4: User-Interface Tools Types of controls 75
closed. If the function returns true, the window is closed, but if it returns false, the close operation is
cancelled and the window remains open.
You r
onClose handler can examine the states of any controls in the dialog to determine their correctness,
and can show
alert messages or use other modal dialogs to alert the user to any errors that must be
corrected. It can then return true to allow the dialog to be dismissed, or false to allow the user to correct
any errors.
Dismissing a modal dialog
Every modal dialog should have at least one button that the user can click to dismiss the dialog. Typically
modal dialogs have an OK and a Cancel button to close the dialog with or without accepting changes that
were made in it.
You can define
onClick callbacks for the buttons that close the parent dialog by calling its close method.
You have the option of sending a value to the
close method, which is in turn passed on to and returned
from the
show method that invoked the dialog. This return value allows your script to distinguish different
closing events; for example, clicking OK can return 1, clicking Cancel can return 2. However, for this typical
behavior, you do not need to define these callbacks explicitly; see
Default and cancel elements” on
page 75.
For some dialogs, such as a simple alert with only an OK button, you do not need to return any value. For
more complex dialogs with several possible user actions, you might need to distinguish more outcomes. If
you need to distinguish more than two closing states, you must define your own closing callbacks rather
than relying on the default behavior.
If, by mistake, you create a modal dialog with no buttons to dismiss it, or if your dialog does have buttons,
but their
onClick handlers do not function properly, a user can still dismiss the dialog by typing ESC. In this
case, the system will execute a call to the dialogs
close method, passing a value of 2. This is not, of course,
a recommended way to design your dialogs, but is provided as an escape hatch to prevent the application
from hanging in case of an error in the operations of your dialog.
Default and cancel elements
The user can typically dismiss a modal dialog by clicking an OK or Cancel button, or by typing certain
keyboard shortcuts. By convention, typing E
NTER is the same as clicking OK or the default button, and
typing E
SC is the same as clicking Cancel. The keyboard shortcut has the same effect as calling notify for
the associated
button control.
To determine which control is notified by which keyboard shortcut, set the
Dialog object’s
defaultElement and cancelElement properties. The value is the control object that should be notified
when the user types the associated keyboard shortcut.
X For buttons assigned as the defaultElement, if there is no onClick handler associated with the
button, clicking the button or typing E
NTER calls the parent dialogs close method, passing a value of 1
to be returned by the
show call that opened the dialog.
X For buttons assigned as the cancelElement, if there is no onClick handler associated with the
button, clicking the button or typing E
SC calls the parent dialogs close method, passing a value of 2
to be returned by the
show call that opened the dialog.
If you do not set the
defaultElement and cancelElement properties explicitly, ScriptUI tries to choose
reasonable defaults when the dialog is about to be shown for the first time. For the default element, it
looks for a button whose
name or text value is "ok" (disregarding case). For the cancel element, it looks for
Vista de pagina 74
1 2 ... 70 71 72 73 74 75 76 77 78 79 80 ... 303 304

Comentarios a estos manuales

Sin comentarios