core/builtins/dialog.cif
changeset 59 c9dfb364c2d1
parent 0 7f656887cf89
child 66 2a78c4ff2eab
equal deleted inserted replaced
58:377ac716dabb 59:c9dfb364c2d1
    16 
    16 
    17 Displays a UI dialog.
    17 Displays a UI dialog.
    18 
    18 
    19 ==long-description
    19 ==long-description
    20 
    20 
    21 Up to two buttons are supported. By default the first is labelled C<OK> and the second C<Cancel>. The button the user selected can be determined by the return code of the command. The first button will produce a return code of zero (0), and the second a code of one (1). If there was an error displaying the dialog, the error code will be returned (always a negative number). The return code makes it possible to write scripts like:
    21 Up to two buttons are supported. If neither C<--first-button> or C<--second-button> are specified, two buttons are shown, C<OK> and C<Cancel>. The button the user selected can be determined by the return code of the command. The first button will produce a return code of zero (0), and the second a code of one (1). If there was an error displaying the dialog, the error code will be returned (always a negative number). The return code makes it possible to write scripts like:
    22 
    22 
    23   dialog --body 'Do you want to proceed?' && do_something
    23   dialog "Do you want to proceed?" && do_something
    24 
    24 
    25 This will result in F<do_something> only being executed if the user presses the first button. An error or the user pressing the second button with NOT result in F<do_something> being executed. Note though that the text window server's notifier implementation appears to assign the first button one (1) and the second, zero (0). Also, on the 3rd edition of S60 killing a dialog command while it is running will result in the handset resetting itself when the actual dialog is dismissed.
    25 This will result in C<do_something> only being executed if the user presses the first button. An error or the user pressing the second button with NOT result in C<do_something> being executed. Note that killing a dialog command while it is running will usually result in the device crashing or hanging, to prevent this the dialog command traps the CTRL-C key combination.
    26 
       
    27 The environment variable C<DIALOG_IMPL> can be used to control the way in which the user is interacted with. The following values of C<DIALOG_IMPL> are supported:
       
    28 
       
    29 =over 5
       
    30 
       
    31 =item C<notifier>
       
    32 
       
    33 The C<RNotifier> API will be used. This is the default if C<DIALOG_IMPL> is not defined The behaviour of C<RNotifier> depends on the handset configuration, but normally it will result in graphical dialogs being displayed.
       
    34 
       
    35 =item C<console>
       
    36 
       
    37 The user will be interacted with via the console that the dialog command is connected to. In this mode, pressing the enter (or on some platforms, select) key corresponds to pressing the first button and any other corresponds to pressing the second button.
       
    38 
       
    39 =item C<null>
       
    40 
       
    41 No attempt is made to interact with the user and it is assumed that the first button is always pressed. This mode allows all user interaction to be disabled.
       
    42 
       
    43 =back
       
    44 
    26 
    45 ==argument string body optional
    27 ==argument string body optional
    46 
    28 
    47 The body of the dialog. If not specified, the body is read from C<stdin>.
    29 The body of the dialog. If not specified, the body is read from C<stdin>.
    48 
    30 
    49 ==option string t title
    31 ==option string t title
    50 
    32 
    51 The title of the dialog.
    33 The title of the dialog. If not specified, defaults to "Attention".
    52 
    34 
    53 ==option string f first-button
    35 ==option string f first-button
    54 
    36 
    55 The text for the first button.
    37 The text for the first button.
    56 
    38 
    57 ==option string s second-button
    39 ==option string s second-button
    58 
    40 
    59 The text for the first button.
    41 The text for the first button.
    60 
    42 
       
    43 ==option enum m mode DIALOG_IMPL
       
    44 
       
    45 Specify the way in which the dialog is displayed. If not specified the default is "notifier".
       
    46 
       
    47 ==enum-value notifier
       
    48 
       
    49 The C<RNotifier> API will be used. The behaviour of C<RNotifier> depends on the handset configuration, but normally it will result in a graphical dialog being displayed.
       
    50 
       
    51 ==enum-value console
       
    52 
       
    53 The user will be interacted with via the console that the dialog command is connected to. In this mode, pressing the enter (or on some platforms, select) key corresponds to pressing the first button and any other input corresponds to pressing the second button.
       
    54 
       
    55 ==enum-value null
       
    56 
       
    57 The dialog is not shown to the user and it is assumed that the first button is always pressed. This mode allows all user interaction to be disabled.
       
    58 
    61 ==copyright
    59 ==copyright
    62 
    60 
    63 Copyright (c) 2006-2010 Accenture. All rights reserved.
    61 Copyright (c) 2006-2010 Accenture. All rights reserved.
    64 
    62