Dialog basics

From Scriptwiki
Revision as of 10:59, 24 August 2006 by Cail (talk | contribs)

Jump to: navigation, search

Basic dialog commands and switches

/dialog -mdtsonkcvie name [table] [x y w h] [text]
Where name is the name by which you'll refer to the dialog, and table is the dialog table name used to create dialog

 -m	create a modeless dialog using 'table' /dialog -m name table
 -a	used with -m, uses currently  active window as the parent
 -x	close a dialog without triggering any events
 -d	open dialog on the desktop, used with -m
 -h	make dialog work with active server connection
 -t	set dialog title /dialog -t name text
 -s	set dialog size/pos /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	minimize/restore the dialog if created on the desktop

The dialog table You can use the dialog prefix to create a dialog table called name in a script using this format:

dialog [-l] name {
 title	"text"
 icon	filename, index
 size	x y w h

option type (dbu, pixels, notheme) text "text", id, x y w h, style (right, center, nowrap) edit "text", id, x y w h, style (right, center, multi, pass, read, return, hsbar, vsbar, autohs, autovs, limit N) button "text", id, x y w h, style (default, ok, cancel, flat, multi) check "text", id, x y w h, style (left, push, 3state) radio "text", id, x y w h, style (left, push) box "text", id, x y w h, style scroll "text", id, x y w h, style (top left bottom right horizontal range N N) list id, x y w h, style (sort, extsel, multsel, size, vsbar, hsbar, check, radio) combo id, x y w h, style (sort, edit, drop, size, vsbar, hsbar) icon id, x y w h, filename, index, style (noborder top left bottom right small large actual) link "text", id, x y w h tab "text", id, x y w h tab "text", id menu "text", menuid [, menuid] item "text", id [, menuid] item break, id [, menuid] }

The -l switch makes a dialog table local, so that it can only be accessed by other scripts in the same file.