Skip to content
DevGeniusCode edited this page Mar 14, 2025 · 1 revision

USER Control

The USER control is the default control type, used for multiple purposes. It can serve as a container or group for other controls, as well as a tool for drawing rectangular shapes or lines by defining their position. Other controls also use the tags defined for the USER control, in addition to their own specific tags.

Purposes of the Control

  1. Container/Group: The USER control can act as a container, holding and organizing other controls. This allows for efficient layout and management of multiple elements on the screen.

  2. Drawing Rectangles or Lines: It can also be used to draw rectangular shapes or lines by specifying the position and dimensions, making it useful for creating visual boundaries or shapes within the UI.

Opening and Closing a Control

Each control is opened with the keyword WINDOW and closed with the keyword END.

For the USER control, when it serves as a container (group), it can contain other controls as children. Each child control is preceded by the keyword CHILD, and after all the children have been defined, the keyword ENDALLCHILDREN should be used to close the group of children and return to the main control.

Example with Children

WINDOW WINDOWTYPE = USER ; parent ... rest of control options CHILD WINDOW ; child WINDOWTYPE = CHECKBOX ... rest of control child options END CHILD WINDOW ; child WINDOWTYPE = COMBOBOX ... rest of control child options END WINDOW ; child and parent or just a drawing WINDOWTYPE = USER ... rest of control child options END ENDALLCHILDRENEND

Available Tags

Note

All tags are case-sensitive.

The following tags are available for the USER control:

Click on the links to view available values and options for the tag.

TagDescription
WINDOWTYPEThe control type.
SCREENRECTDefines the size and position of the control on the screen.
NAMEThe name of the control.
STATUSThe status of the control. see statuses
STYLEThe style of the control. see styles.
SYSTEMCALLBACKThe system callback function for the control. see callbacks.
INPUTCALLBACKThe input callback function for the control.
TOOLTIPCALLBACKCallback function for the control’s tooltip.
DRAWCALLBACKCallback function for the control’s texture.
FONTFont settings. see Text Properties.
HEADERTEMPLATE (Optional)Defines the template for the control’s text. see Text Properties.
TOOLTIPTEXT (Optional)Text for the tooltip displayed when hovering over the control. see Text Properties.
TOOLTIPDELAYDelay 0...n time for the tooltip to appear, -1 for disable.
TEXT (Optional)The text displayed in the control. see Text Properties.
TEXTCOLORColor settings for text in different states. see Text Properties.
ENABLEDDRAWDATA,
DISABLEDDRAWDATA,
HILITEDRAWDATA
Visual texture for the control in different states. see Texturing.

Important

The order of the tags is crucial for proper rendering of the control and must be followed as specified.

Example

Here’s a sample code defining a USER control:

Note

Each texture contain 9 elements

WINDOW WINDOWTYPE = USER; SCREENRECT = UPPERLEFT: 14020, BOTTOMRIGHT: 660544, CREATIONRESOLUTION: 800600; NAME = "OptionsMenu.wnd:OptionsMenuParent"; STATUS = ENABLED+NOFOCUS+SEE_THRU; STYLE = USER; SYSTEMCALLBACK = "OptionsMenuSystem"; INPUTCALLBACK = "OptionsMenuInput"; TOOLTIPCALLBACK = "[None]"; DRAWCALLBACK = "[None]"; FONT = NAME: "Times New Roman", SIZE: 14, BOLD: 0; HEADERTEMPLATE = "[NONE]"; TOOLTIPDELAY = -1; TEXTCOLOR = ENABLED: 2552552550, ENABLEDBORDER: 2552552550, DISABLED: 2552552550, DISABLEDBORDER: 2552552550, HILITE: 2552552550, HILITEBORDER: 2552552550; ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 222175, BORDERCOLOR: 4755168255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255; DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 646464255, BORDERCOLOR: 254254254255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255; HILITEDRAWDATA = IMAGE: NoImage, COLOR: 128128255255, BORDERCOLOR: 254254254255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255, IMAGE: NoImage, COLOR: 255255255255, BORDERCOLOR: 255255255255;END

See Also

Category:Controls

Clone this wiki locally