Main Menu


2D CONTROLS

There are three APE extern commands to use with 2D Controls:

extern CreateAPE2DControl type name x y width=ctrlwidth height=ctrlheight otherparms...

extern RemoveAPE2DControl name

extern ModifyAPE2DControl name parm=value

Both ‘Create’ and ‘Modify’ can take as many ‘parm=value’ arguments as you want to throw at them. Also, variable names and expressions can be used in place of discrete values.

One weird thing: since these are accessing controls that all parts of Anox uses, it assumes only the directory "\anoxdata" graphics. Fonts do assume the fonts directory, though!

TYPES OF CONTROLS

TYPE

DESCRIPTION

push

pushbutton--click to call sequence

edit

single-line edit box, can autoselect it

table

used for epairs

textbox

box containing text--use modify, addline, and addfile to add text


PARAMETERS

PARAMETER DESCRIPTIONS

TYPE

DESCRIPTION

Setfocus=true

Forces the specified control to be the current focus. If set to ‘false’, then focus is removed from ALL controls.

Sequence=bbbb:eeee

when control is operated, trigger this sequence

Gamevar=varname

set this variable to the a value specified by...

Returnvalue=numberorvar

Override the regular return value for a control and have it set a specified gamevar (in APE) or the return message (in C) to the specified value. NOTE: If a return value is set, then ONLY the button-down message is sent, and NO OTHERS.

Value=<value>

Current=<value>

For any control with multiple entries i.e. a listbox, set the selection to item number <value>

Font="fontname"

Set font for message

Text="string"

Add a line of text to a textbox or listbox

Message="blahblah"

label for button

Width=ctrlwidth

how wide is control?

Height=ctrlheight

how tall is control?

Line_height=<value>

Specify the height/spacing of the rows of text in a multi-line control i.e. listbox or textbox

Indent=<value>

For listboxes which have an optional second column of data, this is the offset, in pixels, for column 2

Spacing=<value>

Like line_height, can be used to put space between lines in multi-line controls

Addentry=entryval, addline=entryval

adds entry to a listbox

Addfile=filepath

Add all the text from a file into a text box.

Hiddenflag=true [false]

hide button gfx

Dimflag=true[false]

Force the control to be dimmed i.e. unselectable

Nodrawflag=true [false]

Suppress drawing (and use) of the control when set to true

Holdfocusflag=false [true]

When set to false, then clicking on this control does not give it focus.

Keyinputflag=false [true]

When set to false, this control no longer accepts keyboard shortcuts or input.

Border=true [false]

draw border or done--assumes true

Purge=true

Erase all entries from a list box or text box

Slider=<value>

For slider controls or lists, force the slider and the drawing index to a specified location. Will automatically crop to keep the slider within the valid range.

Min=<value>,max=<value>

For sliders, set the minimum and/or maximum values for the range.

Normal=gfxpathname

Graphic to use for normal state of button instead of provided gfx

Dim=gfxpathname

Graphic to use for dim state of button instead of provided gfx

Backcolor=color

Set the color for the unfilled portion of a progress bar

Barcolor=color

Set the color for the filled portion of a progress bar

Bright=gfxpathname

Graphic to use for bright state of button instead of provided gfx

Depressed=gfxpathname

Graphic to use for depressed state of button instead of provided gfx (toggles)


EXAMPLES

extern CreateAPE2DControl push button1 226 228 width=160 height=40 normal=/gameflow/tsm/button1.tga bright=/gameflow/tsm/button1b.tga gamevar=tsChoice returnvalue=1 sequence=HandleMouseClick%

extern RemoveAPE2DControl button1

extern CreateAPE2DControl textbox hoursbox 246 232 width=280 height=90 font="goodsym" border=false addline="MUSEUM HOURS"

extern ModifyAPE2DControl hoursbox addline=" "

extern CreateAPE2DControl push hoursbutton 396 326 width=120 height=18 font="goodsym" sequence=CloseMuseumHours% message="Back to Menu"