Project

General

Profile

$dialog » History » Revision 11

Revision 10 (Per Amundsen, 07/07/2017 07:21 PM) → Revision 11/12 (Per Amundsen, 12/13/2019 06:28 PM)

_Added in 1.9.0_ 

 *$dialog(name,table,[parent])* 

 Creates a modal dialog. 

 _See also [[/dialog]], [[on DIALOG]], [[Dialog Items]]._ 

 *Parameters* 

 name - Name of the dialog to create. 
 table - Name of the dialog table to use. 
 [parent] - Name of the parent window to associate the dialog with or -1 = Desktop window, -2 = Main AdiIRC window, -3 = Currently active window, -4 = Currently active dialog. (optional) 

 *Example* 

 <pre> 
 : Create a dialog table. 
 Dialog Example1 { 
   title "This is Example 1" 
   size -1 -1 172 129 
   option dbu 
   tab "Tab A", 14, 2 0 165 123 
   tab "Tab B", 15 
   tab "Tab C", 16 
   edit "", 17, 8 16 154 104, tab 16 multi return autohs vsbar 
   menu "&File", 1 
   item "&New", 6, 1 
   item "&Open", 7, 1 
   item break, 8, 1 
   item "&Save", 9, 1 
   item "Save &as", 10, 1 
   menu "&Edit", 2 
   item "&Copy", 11, 2 
   item "P&aste", 12, 2 
   menu "&view", 3 
   item "&All", 13, 3 
   menu "&Help", 4 
   item "&About", 5, 4 
 } 

 ; Create and open the dialog using the 'Example' table. 
 //noop $dialog(Example, Example) 
 </pre> 

 ----------------------------------------------------------------------------- 

 *$dialog(name|N)* 

 Returns information about a dialog. 

 *Parameters* 

 name|N - Name of the dialog or if N = 0, number of dialogs, otherwise the Nth dialog. 

 *Properties* 

 .result - Returns ID of the 'result' button if specified. 
 .x - Returns the X position of the dialog. 
 .y - Returns the Y position of the dialog. 
 .w - Returns the width of the dialog. 
 .h - Returns the height of the dialog. 
 .cw - Returns the width of the dialog client area. 
 .ch - Returns the height of the dialog client area. 
 .title - Returns the dialog title. 
 .modal - Returns [[$true]] if the dialog is modal, otherwise [[$false]]. 
 .state - Returns minimized/maximized/hidden/normal. *(AdiIRC only)* (AdiIRC only) 
 .table - Returns the name of the dialog table. 
 .ok - Returns ID of the 'ok' button if specified. 
 .cancel - Returns ID of the 'cancel' button if specified. 
 .focus - Returns ID of the control that currently has focus. 
 .active - Returns [[$true]] if the dialog is active, otherwise [[$false]]. 
 .tab - Returns id of tab that is currently displayed. 
 .hwnd - Returns the window handle. 
 .icon - Returns the filename of the icon file. *(AdiIRC only)* (AdiIRC only) 
 .local - Returns [[$true]] if the dialog is a local dialog, otherwise [[$false]]. *(AdiIRC only)* (AdiIRC only) 
 .dbu - Returns [[$true]] if the dialog was created with the dbu option, otherwise [[$false]]. *(AdiIRC only)* (AdiIRC only) 
 .default - Returns the id of the "default" button, if defined. *(AdiIRC only)* (AdiIRC only) 

 *Example* 

 <pre> 
 ; Print number of dialogs. 
 //echo -ag $dialog(0) 

 ; Print name of the first dialog. 
 //echo -ag $dialog(1) 
 </pre>