Xbasic
UI_MODELESS_DLG_BUTTON Function
Syntax
Button_Name as C = UI_MODELESS_DLG_BUTTON(C title)
Arguments
- Button_Name
The name of the dialog being monitored. Button_Name will be blank if no button is being pressed.
- title
The title of the dialog.
Description
Return which button is being pressed for the named modeless dialog box, Blank if no button being pressed.
Discussion
The UI_MODELESS_DLG_BUTTON() function returns the name of the first button on a modeless dialog box, when any button is pressed. The function is used to check asynchronously to see if the user is clicking the abort key.
Example
This example is in two parts. First, start a modeless dialog box with buttons.
ui_modeless_dlg_box("test2",<<%dlg% {watch=ui_modeless_dlg_button("test")!buttonPressed} %dlg%,<<%code% if a_dlg_button = "close" then ui_modeless_dlg_close("test2") end if if a_dlg_button = "buttonPressed" then button_name = ui_modeless_dlg_button("test") if button_name <> "" then ui_msg_box("This is Test2 reporting what button was pressed in Test","Button that was pressed: " + button_name) end if ui_modeless_dlg_button_reset("test","") end if %code%)
Then start a script that watches for button clicks in the modeless dialog box.
ui_modeless_dlg_box("test",<<%dlg% %dlg%,<<%code% if a_dlg_button = "close" then ui_modeless_dlg_close("test") end if %code%)
See Also