Skip to content

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.

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.
  • Controls created after it go into it, until another menu Form or menu Panel, menu SetDef parent, menu PopDef or menu Clear. menu SetDef parent form0 goes back to the main window.
  • Closing it with its × hides it and puts its name in #MenuButton. The main window’s × gives CLOSED instead.
  • 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 GetProp and menu SetProp: left, top, width, height (the inside), text (the title), visible, color, enabled, tooltip.
menu Form opts 400 200 200 90 Options
menu Check loot 10 10 150 20 #true Loot corpses
menu Button ok 60 50 80 25 OK
menu SetProp opts visible #true
set #MenuButton N/A
while #MenuButton = N/A
wait 1
menu Get loot
set %loot #MenuRes
menu SetProp opts visible #false
display ok Loot corpses: %loot
halt
  • 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 Form each 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.