menu Form
menu Form {name} {x} {y} {width} {height} [title...]Also searchable as: menu Form · window · new window · dialog
menu Form creates a new window besides the main menu window. It starts hidden: show it with
menu SetProp {name} visible #true.
Parameters
Section titled “Parameters”| Parameter | Meaning |
|---|---|
name |
The window’s name, for menu SetProp, menu Delete, menu SetDef parent. |
x, y |
Position of the window on the screen. |
width, height |
Size of the inside. It comes out 10 pixels larger each way, as in EasyUO 1.6; menu SetProp {name} width and height set the exact size. |
title |
The title bar text; the rest of the line. |
Description
Section titled “Description”- Controls created after it go into it, until another
menu Formormenu Panel,menu SetDef parent,menu PopDeformenu Clear.menu SetDef parent form0goes back to the main window. - Closing it with its × hides it and puts its name in
#MenuButton. The main window’s × givesCLOSEDinstead. - It has the main window’s frame: a fixed size, no maximize button, always on top, its own taskbar button.
menu Delete{name}removes it with everything in it.- With
menu GetPropandmenu SetProp:left,top,width,height(the inside),text(the title),visible,color,enabled,tooltip.
Example
Section titled “Example”menu Form opts 400 200 200 90 Optionsmenu Check loot 10 10 150 20 #true Loot corpsesmenu Button ok 60 50 80 25 OKmenu SetProp opts visible #trueset #MenuButton N/Awhile #MenuButton = N/A wait 1menu Get lootset %loot #MenuResmenu SetProp opts visible #falsedisplay ok Loot corpses: %loothalt- Use a name only once. When the name is taken, EasyUO 1.6 still creates the window, hidden and
unreachable, and the controls created next go into it. A sub that builds a pop-up with
menu Formeach time it runs shows it only the first time: delete it first, or create it once. - Starting the script again destroys every window it made.
See also
The EasyUO 1.6 behaviour on this page was researched with help from the ScriptUO community: Gaderian's tutorial New Menu Code and how to adapt old scripts and the scripts its members share at scriptuo.com.