Project

General

Profile

Actions

Dialogs

/dialog

Added in 1.9.0

/dialog -abcdefghijklmnoprstuvx <name> [newname|table] [x y w h] [text|filename] [N]

Allows you to create a modeless dialog with the -m switch.

See also $dialog, on DIALOG, Dialog Items.

Switches

Switch Description
-a Used with -m, uses currently active window as the parent.
-b Interprets size as dbu.
-c Click cancel button.
-d Open dialog on the desktop, used with -m.
-e Restores the dialog if created on the desktop.
-f Hides the window borders. (AdiIRC only)
-g Renames existing dialog using <name> <newname>.
-h Make dialog work with active server connection. TODO
-i Minimize the dialog if created on the desktop.
-j Shows the window borders/allows resizing the dialog window. (AdiIRC only)
-k Click the "ok" button.
-l TODO
-m Create a modeless dialog using 'table'.
-n Unset ontop setting.
-o Set dialog ontop of all windows.
-p Interprets size as pixels.
-r Centers dialog.
-s Set dialog position/size.
-t Set dialog title to 'text'.
-u Set dialog icon to 'filename'. (AdiIRC only)
-v Makes the dialog the active window.
-x Close a dialog without triggering any events.

Parameters

Parameter Description
<name> Name of the dialog to create.
[newname] Newname used with -g
[table] Name of the dialog table to use.
[x y w h] X/Y Position on the desktop and the Height/Width of the dialog.
[text|filename] Dialog title text or dialog icon filename.
[N] Icon index. (AdiIRC only, used with -u)

Example

; 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 show the dialog as modeless and on the desktop.
/dialog -md Example1 Example1

/did

Added in 1.9.0

/did -abcdefghijklmnorstuvz <name> <id> [n] [text | filename | start [end]]

The /did command allows you to modify the values of controls in a dialog,

Switches

Switch Description
-a Add line of text to end.
-b Disable id.
-c Check checkbox/radiobutton list/combo line.
-d Delete Nth line.
-e Enable id.
-f Set focus on id.
-g Set a new icon/image to an icon control.
-h hide id
-i Insert text at Nth line.
-j Resets the edited setting in an editbox. TODO
-k Works with -cu, keeps other selections in a listbox.
-l Uncheck the checkbox of an item in a listcb control.
-m Disables editbox.
-n Enables editbox.
-o Overwrite Nth line with text.
-r Clear all text in id.
-s Checks the checkbox of an item in a listcb control.
-t Set id as default button.
-u Uncheck checkbox/radiobutton list/combo line.
-v Make id visible.
-z Resets the width of horizontal scrollbar in listbox. TODO

Parameters

Parameter Description
<name> Name of the dialog.
<id> Id of the control to edit, you can use the form N-N1,N2-N3 to change multiple id's at once, 1-5,6,9 would change the following ids: 1,2,3,4,5,6,9.
[n] Usually a line number, it can also be an id number with menus, use 0 if you want to access the editbox of a combo control.
[text] The text parameter if applicable.
[filename] Filename used with -g.
|start [end] Used with -z to set the range of a scrollbar, or with -c to set a selection

/didtok

Added in 1.9.0

/didtok <name> <id> <c> <text>

Tokenizes a string by character c, then adds the result to a dialog list/combo/edit box.

Parameters

Parameter Description
<name> Name of the dialog.
<id> Id of the dialog control.
<c> ASCII value to tokenize by.
<text> Text to tokenize.

Example

; Dialog table layout.
dialog colors {
  size -1 -1 100 200
  list 1, 10 10 80 180
}

; Run the dialog.
/dialog -m colors colors

; Tokenize the string "red blue orange yellow" by whitespace and insert result into the list control.
/didtok colors 1 32 red blue orange yellow

$did

Added in 1.9.0

$did

Returns the id of the matched dialog id during a on DIALOG event.

Example

on *:DIALOG:*:*:{
  echo -ag The matched dialog id is $did
}

$did([name},id,[N])

Returns settings and values from a dialog item.

See also /dialog, on DIALOG, Dialog Items.

Parameters

Parameter Description
[name] If specified, name of the dialog otherwise $dname from the current event is used. (optional)
id Id of the dialog item.
[N] If N = 0, get number of lines, otherwise the Nth line for a item with multiple lines. (optional)

Properties

Property Description
.text Returns line or Nth line.
.len Returns length of line or length of Nth line.
.lines Returns number of lines.
.sel If N = 0, returns number of lines otherwise the Nth selected line.
.seltext Returns selected text in an editbox or first selected item in a listbox.
.selstart Returns select start character in editbox line.
.selend Returns select end character in editbox line.
.edited Returns $true if text in editbox was changed, otherwise $false.
.state Returns 0 = off, 1 = on, and 2 = indeterminate.
.next Returns id of next control in tab key order.
.prev Returns id of previous control in tab key order.
.visible Returns $true if the control is visible, otherwise $false.
.enabled Returns $true if the control is enabled, otherwise $false.
.isid Returns $true if id exists in the dialog, otherwise $false.
.csel If N is 0, returns number of checked lines, otherwise line number of the Nth checked box in a listcb control.
.cstate Returns 0 = off, 1 = on for item in a listcb control (listbox created using the check parameter).
.type Returns the dialog item type. (AdiIRC only)

$didwm

Added in 1.9.0

$didwm([name],id,wildtext,[N])

Returns the number of the line that matches the wildtext, with the search starting at line N.

Parameters

Parameter Description
[name] If specified, name of the dialog otherwise $dname from the current event is used. (optional)
id Id of the dialog item.
wildtext The wildtext to search.
[N] If N = 0, number of matches, otherwise the Nth match. (optional)

$didreg

Added in 1.9.0

$didreg([name],id,regex,[N])

Returns the number of the line that matches the regular expression, with the search starting at line N.

Parameters

Parameter Description
[name] If specified, name of the dialog otherwise $dname from the current event is used. (optional)
id Id of the dialog item.
regex The regular expression to perform.
[N] If N = 0, number of matches, otherwise the Nth match. (optional)

$didtok

Added in 1.9.1

$didtok([name],id,C)

Returns a tokenized list of the items in a dialog list/combo/edit box.

Parameters

Parameter Description
[name] If specified, name of the dialog otherwise $dname from the current event is used. (optional)
id Id of the dialog item.
C The ASCII value to tokenize by.

on DIALOG

Added in 1.9.0

on <level>:DIALOG:<name>:<event>:<id>

Triggers when a dialog item state is changed, e.g clicking a button or types text in a Editbox.

See also $dname, $devent, $did, /dialog, $dialog, Dialog Items.

Parameters

<level> - The User Access Level for the event to trigger.
<name> - The dialog name that this event triggers for; wildcards accepted.
<event> - The dialog event that this event triggers for; wildcards accepted.
<id> - The id name of the dialog item to listen for; wildcards accepted. Multiple IDs can be specified in the form: 1,2,3,4-8,9
<commands> - The commands to be performed when the event listener's criteria is met.

Events

Event Description
active Triggers when the dialog is made active.
close Triggered when a dialog has been closed.
dclick Occurs when a double left-click has occurred in a list box or combo box, as well as on the dialog itself.
drop Triggers when an item has been dragged and dropped with the mouse.
edit When text in an Editbox or a combo box has changed.
init This event ID is 0, and triggers before a dialog is displayed. This allows initialization time for the dialog and its items.
menu Whenever a menu-item is selected.
mouse When the mouse is moved.
rclick Works when the mouse right-clicks.
sclick Occurs during a single-click in a list box/combo box, during check/uncheck of radio/check buttons, or during the click of a button.
scroll A scrollbar control position has changed.
uclick Left mouse button has been released/gone up.

Updated by Per Amundsen over 7 years ago · 1 revisions

Also available in: PDF HTML TXT