Dialog is a way of creating GUI (Graphical user interface) for your script. They are used to enhance the user experience and the script’s user-friendliness.
There are two types of dialogs; a modeless dialog and a modal dialog.
Basic Dialog Command
The /dialog command allows you to create a dialog. The name is simply the name you use to reference the dialog. The table is the most important part. We will talk about it later on. This is what you actually use to design and create the dialog.
dialog-mdtsonkcvie <name> [table] [x y w h] [text]
Switches Table
Switch
used with
Purpose
-m
used to create a modeless dialog /dialog-m <name> <table>
-a
-m
use the
currently active window as parent
-x
close a dialog
without triggering any of its events
-d
-m
open the
dialog on the desktop
-h
makes the
dialog to work with the active server connection
-t
sets dialog
title /dialog-t <name> <text>
-s
sets dialog size and position /dialog-s name x y w h
-r
centers dialog
-bp
interprets
size as dbu or pixels
-o
set dialog
ontop of all windows
-n
unset ontop
setting
-k
click ok
button
-c
click cancel
button
-v
makes the
dialog the active window
-ie
-d
minimize/restore the dialog
$dialog()
This identifier is used to execute a modeled dialog. This is very helpful when you want to simply use the dialog to retrieve a few values.
%result=$dialog(name,table[,parent])
$dialog()
Properties
Properties
Description
x,y,w,h
returns the size and
position of the dialog
cw,ch
returns width and height
of client area of dialog
title
returns the title of the
dialog
modal
returns $true if the
dialog is modal, otherwise $false
table
returns the dialog table
that the dialog is using
ok
returns the id of the Ok
button if you specified one
cancel
returns the id of the
Cancel button if you specified one
result
returns the id of the
Result button if you specified one
focus
returns id of control that
currently has focus
tab
returns id of tab that is
currently displayed
active
returns $true if dialog is
the active window, otherwise $false
hwnd
returns dialog window
handle
Dialog Table
The dialog table is the structure of the dialog. This is what you used to design all the objects, design where they go and how they look.
Dialog [-l] name{ title "text" icon filename, index size x y w h option type /*
All Your Dialog's Object Will Go In Here
More details below
*/ }
-l – This switch make the table local. (Can only be accessed by other script on that file)
"test" - is the default text for the dialog.
id - is a unique number designated to only one control. The id is used as a reference number for the rest of the script.
x y w h - are the position in which the dialog will start up at (x,y). The w h are the width and heights of the dialog itself.
Option Type:
mIRC offers three different types of dialogs style:
notheme - The notheme option loads up a dialog without the windows theme (classic windows 95 style).
dbu – The dbu (Dialog Base Unit) is used in this option. This makes the dialog look the same on just about every computer.
pixels – While this is still the default option it is not recommended since it can look significantly different depending on the user’s resolution.
Dialog Objects
Please select from the drop list an object for more information:
Text Object
Syntax:
text "text", id, x y w h[, style]
Style Options:
- right - right align it (default if blank)
- center - center align
- nowrap - text will be forced to stay in one line.
Example:
DialogExample{ title "ZigWap - Example" size -1 -1 100 20 option dbu text "This is an example of a text control.",1,4 4 90 15 center }
Edit
Object
Syntax:
edit "text", id, x y w h[, style]
Style Options:
- right - aligned to the right (default if blank)
- center - align to the center
- multi - multi-lined textbox
- pass - password filed (****) instead of text
- read - Read Only (can't be overwrite)
- return - set a %var to get its value
- hsbar - horizontal scrollbar
- vsbar - vertical scrollbar
- autohs - automatically scroll horizontally
- autovs - automatically scroll verticall
Example:
DialogExample{ title "ZigWap - Example" size -1 -1 100 20 option dbu edit "I can type in this box.",1,4 4 90 10 }
Button
Object
Syntax:
button "text", id, x y w h[, style]
Style Options:
- default - clicked when hit {Enter}
- ok - the 'result' button for future processing
- cancel - normal cancel button
- flat
- multi
Example:
DialogExample{ title "ZigWap - Example" size -1 -1 100 20 option dbu button "This is an OK button",1,4 4 90 10, ok }
Check
Object
Syntax:
check "text", id, x y w h[, style]
Style Options:
- left - check on the left side (Default is right)
- push - check is a button which can be pressed
- 3state - check has "3 stats" ON/OFF and intermidiate.
- left - checkmark is on the right side (Default is on left)
- push - box, one of a set of radio buttons
- group - used to group a set of radios together
Example:
DialogExample{ title "ZigWap - Example" size -1 -1 100 100 option dbu radio "Option In GroupA 1",1,3 1 60 10, group radio "Option In GroupA 2",2,3 11 60 10 radio "Option In GroupA 3",3,3 21 60 10
radio "Option In GroupB 1",4,3 35 60 10, group radio "Option In GroupB 2",5,3 45 60 10 radio "Option In GroupB 3",6,3 55 60 10
radio "Option In GroupC 1",7,3 75 60 10, push group radio "Option In GroupC 2",8,3 85 60 10, push
}
Box
Object
Syntax:
box "text", id, x y w h
Example:
DialogExample{ title "ZigWap - Example" size -1 -1 100 100 option dbu box "Frame For Controls",1,3 1 93 93 }