Project

General

Profile

$dialog » History » Version 11

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