$dialog » History » Version 12
Per Amundsen, 02/16/2023 09:33 PM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | *$dialog(name,table,[parent])* |
||
4 | |||
5 | Creates a modal dialog. |
||
6 | |||
7 | 7 | Per Amundsen | _See also [[/dialog]], [[on DIALOG]], [[Dialog Items]]._ |
8 | |||
9 | 1 | Per Amundsen | *Parameters* |
10 | |||
11 | 12 | Per Amundsen | table(ktable). |
12 | |*Parameter*|*Description*| |
||
13 | | name | Name of the dialog to create. | |
||
14 | | table | Name of the dialog table to use. | |
||
15 | | [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) | |
||
16 | 1 | Per Amundsen | |
17 | *Example* |
||
18 | |||
19 | <pre> |
||
20 | 3 | Per Amundsen | : Create a dialog table. |
21 | Dialog Example1 { |
||
22 | title "This is Example 1" |
||
23 | size -1 -1 172 129 |
||
24 | option dbu |
||
25 | tab "Tab A", 14, 2 0 165 123 |
||
26 | tab "Tab B", 15 |
||
27 | tab "Tab C", 16 |
||
28 | edit "", 17, 8 16 154 104, tab 16 multi return autohs vsbar |
||
29 | menu "&File", 1 |
||
30 | item "&New", 6, 1 |
||
31 | item "&Open", 7, 1 |
||
32 | item break, 8, 1 |
||
33 | item "&Save", 9, 1 |
||
34 | item "Save &as", 10, 1 |
||
35 | menu "&Edit", 2 |
||
36 | item "&Copy", 11, 2 |
||
37 | item "P&aste", 12, 2 |
||
38 | menu "&view", 3 |
||
39 | item "&All", 13, 3 |
||
40 | menu "&Help", 4 |
||
41 | item "&About", 5, 4 |
||
42 | 1 | Per Amundsen | } |
43 | |||
44 | 4 | Per Amundsen | ; Create and open the dialog using the 'Example' table. |
45 | 1 | Per Amundsen | //noop $dialog(Example, Example) |
46 | </pre> |
||
47 | |||
48 | ----------------------------------------------------------------------------- |
||
49 | |||
50 | *$dialog(name|N)* |
||
51 | |||
52 | Returns information about a dialog. |
||
53 | |||
54 | *Parameters* |
||
55 | |||
56 | 12 | Per Amundsen | table(ktable). |
57 | |*Parameter*|*Description*| |
||
58 | | name<notextile>|</notextile>N | Name of the dialog or if N = 0, number of dialogs, otherwise the Nth dialog. | |
||
59 | 1 | Per Amundsen | |
60 | *Properties* |
||
61 | |||
62 | 12 | Per Amundsen | table(ktable). |
63 | |*Property*|*Description*| |
||
64 | | .result | Returns ID of the 'result' button if specified. | |
||
65 | | .x | Returns the X position of the dialog. | |
||
66 | | .y | Returns the Y position of the dialog. | |
||
67 | | .w | Returns the width of the dialog. | |
||
68 | | .h | Returns the height of the dialog. | |
||
69 | | .cw | Returns the width of the dialog client area. | |
||
70 | | .ch | Returns the height of the dialog client area. | |
||
71 | | .title | Returns the dialog title. | |
||
72 | | .modal | Returns [[$true]] if the dialog is modal, otherwise [[$false]]. | |
||
73 | | .state | Returns minimized/maximized/hidden/normal. *(AdiIRC only)* | |
||
74 | | .table | Returns the name of the dialog table. | |
||
75 | | .ok | Returns ID of the 'ok' button if specified. | |
||
76 | | .cancel | Returns ID of the 'cancel' button if specified. | |
||
77 | | .focus | Returns ID of the control that currently has focus. | |
||
78 | | .active | Returns [[$true]] if the dialog is active, otherwise [[$false]]. | |
||
79 | | .tab | Returns id of tab that is currently displayed. | |
||
80 | | .hwnd | Returns the window handle. | |
||
81 | | .icon | Returns the filename of the icon file. *(AdiIRC only)* | |
||
82 | | .local | Returns [[$true]] if the dialog is a local dialog, otherwise [[$false]]. *(AdiIRC only)* | |
||
83 | | .dbu | Returns [[$true]] if the dialog was created with the dbu option, otherwise [[$false]]. *(AdiIRC only)* | |
||
84 | | .default | Returns the id of the "default" button, if defined. *(AdiIRC only)* | |
||
85 | 1 | Per Amundsen | |
86 | *Example* |
||
87 | |||
88 | <pre> |
||
89 | ; Print number of dialogs. |
||
90 | //echo -ag $dialog(0) |
||
91 | |||
92 | ; Print name of the first dialog. |
||
93 | //echo -ag $dialog(1) |
||
94 | </pre> |