Worst-case scenario: the UEd Goblin wipes the map and burns down your house.

UE3:UIEditBox (UT3)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UT3 Object >> UIRoot >> UIScreenObject >> UIObject >> UIEditBox
Package: 
Engine
Implemented interfaces
UIDataStorePublisher
Known classes within UIEditBox:
UIComp_DrawStringEditbox, UIEditboxString
Direct subclasses:
UINumericEditBox, UTUIEditBox
This class in other games:
UDK

This basic widget allows the user to type text into an input field.

Copyright 1998-2007 Epic Games, Inc. All Rights Reserved

Todo: add property to control whether change notifications are sent while the user is typing text (vs. only when the user presses enter or something).

Properties[edit]

Property group 'Data'[edit]

DataSource[edit]

Type: UIRoot.UIDataStoreBinding

Modifiers: private

The name of the data source that this editbox's value will be associated with.

Todo: explain this a bit more

StringRenderComponent[edit]

Type: UIComp_DrawStringEditbox

Modifiers: editinline, const, noclear

Renders the text for this editbox

Default value: UIComp_DrawStringEditbox'EditboxStringRenderer'

Property group 'Image'[edit]

BackgroundImageComponent[edit]

Type: UIComp_DrawImage

Modifiers: editinline, const

Component for rendering the background image

Default value: UIComp_DrawImage'EditboxBackgroundTemplate'

Property group 'Text'[edit]

bPasswordMode[edit]

Type: bool

If enabled, the * character will be rendered instead of the actual text.

bReadOnly[edit]

Type: bool

Modifiers: private

specifies whether the text in this editbox can be changed by user input

CharacterSet[edit]

Type: EEditBoxCharacterSet

Controls which type of characters are allowed in this editbox

InitialValue[edit]

Type: string

Modifiers: localized

The initial value to display in the editbox's text field

Default value: "Initial Editbox Value"

MaxCharacters[edit]

Type: int

the maximum number of characters that can be entered into the editbox

Default values[edit]

Property Value
bSupportsPrimaryStyle False
DefaultStates[2] Class'Engine.UIState_Focused'
DefaultStates[3] Class'Engine.UIState_Active'
DefaultStates[4] Class'Engine.UIState_Pressed'
PrimaryStyle
Member Value
DefaultStyleTag 'DefaultEditboxStyle'
RequiredStyleClass Class'Engine.UIStyle_Combo'

Subobjects[edit]

EditboxBackgroundTemplate[edit]

Class: Engine.UIComp_DrawImage

Property Value
StyleResolverTag 'Background Image Style'

EditboxStringRenderer[edit]

Class: Engine.UIComp_DrawStringEditbox

Property Value
bIgnoreMarkup True
StringCaret
Member Value
bDisplayCaret True

WidgetEventComponent[edit]

Class: Engine.UIComp_Event

Inherits from: UIObject.WidgetEventComponent

No new values.

Enums[edit]

EEditBoxCharacterSet[edit]

CHARSET_All 
Allows all charcters
CHARSET_NoSpecial 
Ignores special characters like !@#
CHARSET_AlphaOnly 
Allows only alphabetic characters
CHARSET_NumericOnly 
Allows only numeric characters
CHARSET_AlphaNumeric 
Allows alpha numeric characters (a-z,A-Z,0-9)

Delegates[edit]

OnSubmitText[edit]

delegate bool OnSubmitText (UIEditBox Sender, int PlayerIndex)

Called when the user presses enter (or any other action bound to UIKey_SubmitText) while this editbox has focus.

Parameters:

  • Sender - the editbox that is submitting text
  • PlayerIndex - the index of the player that generated the call to SetValue; used as the PlayerIndex when activating UIEvents; if not specified, the value of GetBestPlayerIndex() is used instead.

Returns:

if TRUE, the editbox will clear the existing value of its textbox.

Functions[edit]

Native functions[edit]

CalculateCaretPositionFromCursorLocation[edit]

native function int CalculateCaretPositionFromCursorLocation (optional int PlayerIndex) const

Calculates the character position for the point under the mouse or joystick cursor

Parameters:

  • PlayerIndex - the index of the player that generated the call to this method; if not specified, the value of GetBestPlayerIndex() is used instead.

Returns:

the index into the editbox's value string for character under the mouse/joystick cursor. If the cursor is within the "client region" of the editbox but not over a character (for example, if the string is very short and the mouse is hovering towards the right side of the region), then the length of the editbox's value string is returend. Otherwise, returns INDEX_NONE,

ClearBoundDataStores[edit]

native final function ClearBoundDataStores ()

Specified by: UIDataStoreSubscriber.ClearBoundDataStores

Notifies this subscriber to unbind itself from all bound data stores

GetBoundDataStores[edit]

native virtual function GetBoundDataStores (out array<UIDataStoreout_BoundDataStores)

Specified by: UIDataStoreSubscriber.GetBoundDataStores

Retrieves the list of data stores bound by this subscriber.

Parameters:

  • out_BoundDataStores - receives the array of data stores that subscriber is bound to.

GetDataStoreBinding[edit]

native final virtual function string GetDataStoreBinding (optional int BindingIndex) const

Specified by: UIDataStoreSubscriber.GetDataStoreBinding

Retrieves the markup string corresponding to the data store that this object is bound to.

Parameters:

  • BindingIndex - optional parameter for indicating which data store binding is being requested for those objects which have multiple data store bindings. How this parameter is used is up to the class which implements this interface, but typically the "primary" data store will be index 0.

Returns:

a datastore markup string which resolves to the datastore field that this object is bound to, in the format: <DataStoreTag:DataFieldTag>

GetValue[edit]

native final function string GetValue (optional bool bReturnUserText) const

Gets the text that is currently in this editbox

Parameters:

  • bReturnUserText - if TRUE, returns the text typed into the editbox by the user; if FALSE, returns the resolved value of this editbox's data store binding.

NotifyDataStoreValueUpdated[edit]

native final virtual function NotifyDataStoreValueUpdated (UIDataStore SourceDataStore, bool bValuesInvalidated, name PropertyTag, UIDataProvider SourceProvider, int ArrayIndex)

Specified by: UIDataStoreSubscriber.NotifyDataStoreValueUpdated

Handler for the UIDataStore.OnDataStoreValueUpdated delegate. Used by data stores to indicate that some data provided by the data has changed. Subscribers should use this function to refresh any data store values being displayed with the updated value. notify subscribers when they should refresh their values from this data store.

Parameters:

  • SourceDataStore - the data store that generated the refresh notification; useful for subscribers with multiple data store bindings, to tell which data store sent the notification.
  • PropertyTag - the tag associated with the data field that was updated; Subscribers can use this tag to determine whether there is any need to refresh their data values.
  • SourceProvider - for data stores which contain nested providers, the provider that contains the data which changed.
  • ArrayIndex - for collection fields, indicates which element was changed. value of INDEX_NONE indicates not an array or that the entire array was updated.

RefreshSubscriberValue[edit]

native final virtual function bool RefreshSubscriberValue (optional int BindingIndex)

Specified by: UIDataStoreSubscriber.RefreshSubscriberValue

Resolves this subscriber's data store binding and updates the subscriber with the current value from the data store.

Returns:

TRUE if this subscriber successfully resolved and applied the updated value.

SaveSubscriberValue[edit]

native virtual function bool SaveSubscriberValue (out array<UIDataStoreout_BoundDataStores, optional int BindingIndex)

Specified by: UIDataStorePublisher.SaveSubscriberValue

Resolves this subscriber's data store binding and publishes this subscriber's value to the appropriate data store.

Parameters:

  • out_BoundDataStores - contains the array of data stores that widgets have saved values to. Each widget that implements this method should add its resolved data store to this array after data values have been published. Once SaveSubscriberValue has been called on all widgets in a scene, OnCommit will be called on all data stores in this array.
  • BindingIndex - optional parameter for indicating which data store binding is being requested for those objects which have multiple data store bindings. How this parameter is used is up to the class which implements this interface, but typically the "primary" data store will be index 0.

Returns:

TRUE if the value was successfully published to the data store.

SetDataStoreBinding[edit]

native final virtual function SetDataStoreBinding (string MarkupText, optional int BindingIndex)

Specified by: UIDataStoreSubscriber.SetDataStoreBinding

Sets the data store binding for this object to the text specified.

Parameters:

  • MarkupText - a markup string which resolves to data exposed by a data store. The expected format is: <DataStoreTag:DataFieldTag>
  • BindingIndex - optional parameter for indicating which data store binding is being requested for those objects which have multiple data store bindings. How this parameter is used is up to the class which implements this interface, but typically the "primary" data store will be index 0.

SetValue[edit]

native final function SetValue (string NewText, optional int PlayerIndex, optional bool bSkipNotification)

Change the value of this editbox at runtime.

Parameters:

  • NewText - the new text that should be displayed in the label
  • PlayerIndex - the index of the player that generated the call to SetValue; used as the PlayerIndex when activating UIEvents
  • bSkipNotification - specify TRUE to prevent the OnValueChanged delegate from being called.

Events[edit]

Initialized[edit]

event Initialized ()

Overrides: UIScreenObject.Initialized

Called once this screen object has been completely initialized, before it has called Initialize on its children.

Other instance functions[edit]

IgnoreMarkup[edit]

final function IgnoreMarkup (bool bShouldIgnoreMarkup)

Changes whether this editbox's string should process markup

Parameters:

  • bShouldIgnoreMarkup - if TRUE, markup will not be processed by this editbox's string

Note: does not update any existing text contained by the editbox.

IsReadOnly[edit]

final function bool IsReadOnly ()

Returns:

TRUE if this editbox is readonly

OnGetTextValue[edit]

function OnGetTextValue (UIAction_GetTextValue Action)

Handler for GetTextValue action.

OnSetLabelText[edit]

function OnSetLabelText (UIAction_SetLabelText Action)

Kismet Action Handlers

SetBackgroundImage[edit]

final function SetBackgroundImage (Surface NewImage)

Changes the background image for this editbox.

Parameters:

  • NewImage - the new surface to use for this UIImage

SetReadOnly[edit]

function SetReadOnly (bool bShouldBeReadOnly)

Changes whether this editbox is read-only.

Parameters:

  • bShouldBeReadOnly - TRUE if the editbox should be read-only.