Xbasic

{NOCHILDREN}

Syntax

{NOCHILDREN}

Description

Allows you to open new dialogs from a dialog without them being children of the first dialog.

Discussion

By default when Xdialog window opens another Xdialog (for example a button on dialog1 causes dialog2 to open), the second dialog is a "child" of the first dialog and when the first dialog closes, so will the second. The {nochildren} command allows you to open new dialogs from a dialog without them being children of the first dialog.

Example

ui_modeless_dlg_box("Dialog1",<<%dlg% 
This is 'Dialog1'; 
It is a 'standard' Dialog in that it is the parent of ; 
any dialogs that are launched from it.; 
{lf}; 

; 
%dlg%,<<%code%
  
if a_dlg_button = "close" then 
    ui_modeless_dlg_close("dialog1") 
end if 

if a_dlg_button = "launch" then 
    show_dialog2() 
end if 
%code%)
'Move this dialog out of the way so that the next dialog that opens does not obscure it.
ui_dlg_move("dialog1",1,1) 


ui_modeless_dlg_box("Dialog1_NoChildren",<<%dlg% 
{nochildren} 
This is 'Dialog1_NoChildren'; 
It has the '\{nochildren}' command. Therefore, it is NOT the parent of; 
any dialogs that are launched from it.; 
{lf}; 

; 
%dlg%,<<%code%
  
if a_dlg_button = "close" then 
ui_modeless_dlg_close("dialog1_NoChildren") 
end if 

if a_dlg_button = "launch" then 
show_dialog2() 
end if
  
%code%)
'-------------------------------------
function show_dialog2 as v ()
ui_modeless_dlg_box("Dialog2",<<%dlg% 
This is Dialog 2; 
If this dialog was launched from 'Dialog1' then it is; 
a child of Dialog 1, so when you close Dialog 1; 
this dialog will also close; 
{lf}; 
However, if this dialog was launched from 'Dialog1_NoChildren'; 
{lf}; 
; 
%dlg%,<<%code%
  
if a_dlg_button = "close" then 
    ui_modeless_dlg_close("dialog2") 
end if
  
%code%)
end function

Limitations

Desktop applications only

See Also