osd-dialog - OSD dialog box
osd-xdialog - OSD Extended dialog box
n osd-dialog "title" "prompt" ["x-pos" "y-pos"] "but1"
n osd-xdialog "title" "prompt" default ["x-pos" "y-pos"] "but1" "but2" ...
osd-dialog constructs a OSD dialog prompt with a title string title, a prompt string within the dialog of prompt. A single button, with text rendering but1, is placed within the dialog. The dialog remains on the screen until the button is selected or the user aborts.
osd-xdialog creates an extended dialog with multiple buttons similar to osd-dialog, the number of buttons created (#) is determined from the number of but arguments. The default integer argument specifies the default button (1..#), a value of 0 specifies that there is no default button.
The commands return the button pressed in the variable $result(5).
The argument n can be used to change the default behavior of both commands described above, n is a bit based flag where:-
0x01
0x02
A simple query dialog is typically constructed using osd-dialog, as follows:-
!if &seq %osd-search-str "" osd-dialog "Replace" "Error: Search string is empty!" " &OK " !return !endif
The following example uses multiple buttons within a single dialog, using osd-xdialog, as follows:-
0 define-macro osd-close !if &bmod "edit" set-variable #l0 &spr "Buffer \"%s\" changed" $buffer-bname osd-xdialog "Buffer Close" #l0 1 "&Save First" \ "&Loose Changes" "&Cancel" !if &equ $result 3 !abort !elif &equ $result 2 -1 buffer-mode "edit" !else !if &seq $buffer-fname "" !nma write-buffer !else !nma save-buffer !endif !endif !endif delete-buffer $buffer-bname @mna !emacro
osd-dialog and osd-xdialog are macros defined in osd.emf, using osd(2) to create the dialog.
(c) Copyright JASSPA 1999
Last Modified: 1999/06/02
Generated On: 1999/12/01