Blitz3D+ Command Reference

CreateTextField ( x,y,width,height,group[,style] )

Parameters

x,y - position of the field's top-left corner within the group's client area

width,height - size of the field

group - window or gadget group that owns the field

style (optional) - 0: normal (default); bit 1: password field, characters displayed masked

Description

Creates a single-line text field gadget and returns its handle.

Requires Extended language mode.

The everyday single-line input: an object name in an inspector, a search box, a filename. Read its contents with TextFieldText, set them with SetGadgetText - all text is UTF-8, so any Unicode name works. SetGadgetHint can show grey cue text until the user types something.

Every edit posts a critical gadget-action event ($401) through the shared event queue, and pressing Enter posts one with EventData 13 - which is how you implement commit-on-Enter for a rename field. Use ActivateGadget to drop the keyboard focus straight into the field when a panel opens.

Style bit 1 turns it into a password field with masked characters. For multi-line input use CreateTextArea instead.

See it working in the world editor shell sample and the native input controls sample.

See also: TextFieldText, SetGadgetText, SetGadgetHint, CreateTextArea, ActivateGadget.

Index