I search for solutions in this order: Past Code, Unreal Source, Wiki, BUF, groups.yahoo, google, screaming at monitor. – RegularX

Difference between revisions of "UE3:UIComp DrawStringEditbox (UT3)"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
(Auto-generated page)
 
(Talk)
 
Line 32: Line 32:
 
! Value
 
! Value
 
|-
 
|-
| 000000,CaretStyle
+
| CaretStyle
|  
+
| 'DefaultCaretStyle'
 
|-
 
|-
 
| CaretWidth
 
| CaretWidth
Line 80: Line 80:
 
! Value
 
! Value
 
|-
 
|-
| 019608,A
+
| A
|  
+
| 0.6
 
|-
 
|-
| 125490,B
+
| B
|  
+
| 0.019608
 
|-
 
|-
| 654901,G
+
| G
|  
+
| 0.12549
 
|-
 
|-
 
| R
 
| R
| 0.0
+
| 0.654901
 
|}
 
|}
  
Line 112: Line 112:
 
! Value
 
! Value
 
|-
 
|-
| 000000,A
+
| A
|  
+
| 1.0
 
|-
 
|-
| 000000,B
+
| B
|  
+
| 1.0
 
|-
 
|-
| 000000,G
+
| G
|  
+
| 1.0
 
|-
 
|-
 
| R
 
| R

Latest revision as of 08:40, 23 May 2008

UT3 Object >> Component >> UIComponent >> UIComp_DrawComponents >> UIComp_DrawString >> UIComp_DrawStringEditbox
Package: 
Engine
Within class: 
UIEditBox
Implemented interfaces
UIStyleResolver
This class in other games:
UDK

This specialized version of UIComp_DrawString handles rendering UIStrings for editboxes. The responsibilities specific to rendering text in editboxes are: 1. A caret must be rendered at the appropriate location in the string 2. Ensuring that the text surrounding the caret is always visible 3. Tracking the text that was typed by the user independently from the data source that the owning widget is bound to.

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

Todo: register this component with the data store for the caret image node so that it receives the refreshdatastore callback

Properties[edit]

Property group 'Presentation'[edit]

StringCaret[edit]

Type: UIRoot.UIStringCaretParameters

Controls whether and how a caret is displayed

Default value:

Member Value
CaretStyle 'DefaultCaretStyle'
CaretWidth 1.0

Internal variables[edit]

bRecalculateFirstCharacter[edit]

Type: bool

Modifiers: const, transient

indicates that the FirstCharacterPosition needs to be re-evaluated the next time the string is reformatted

CaretNode[edit]

Type: pointer{struct FUIStringNode_Image}

Modifiers: const, native, private, transient

the image node that is used for rendering the caret

CaretOffset[edit]

Type: float

Modifiers: const, transient

the offset (in pixels) from the left edge of the editbox's bounding region for rendering the caret

FirstCharacterPosition[edit]

Type: int

Modifiers: const, private, transient

the position of the first visible character in the editbox

SelectionBackgroundColor[edit]

Type: Object.LinearColor

Modifiers: config

the color to use for the background of a selected text block

Default value:

Member Value
A 0.6
B 0.019608
G 0.12549
R 0.654901

SelectionRegion[edit]

Type: UIStringSelectionRegion

Modifiers: transient

the editbox's selected text

SelectionTextColor[edit]

Type: Object.LinearColor

Modifiers: config

the color to use for selected text

Default value:

Member Value
A 1.0
B 1.0
G 1.0
R 1.0

UserText[edit]

Type: string

Modifiers: private, transient

Contains the text that the user has typed into the editbox

Default values[edit]

Property Value
StringStyle
Member Value
DefaultStyleTag 'DefaultEditboxStyle'
TextStyleCustomization
Member Value
bOverrideClipAlignment True
bOverrideClipMode True
ClipAlignment UIALIGN_Right
ClipMode CLIP_Normal

Structs[edit]

UIStringSelectionRegion[edit]

Modifiers: native, transient

Defines a range of selected text in a UIString.

int SelectionStartCharIndex 
int SelectionEndCharIndex 

Default values:

Property Value
SelectionEndCharIndex 0
SelectionStartCharIndex 0

Native functions[edit]

ClearSelection[edit]

native final function bool ClearSelection ()

Clears the current selection region.

Returns:

TRUE if the selection was cleared successfully.

GetSelectedText[edit]

native final function string GetSelectedText () const

Returns:

the string that is currently selected.

GetSelectionRange[edit]

native final function bool GetSelectionRange (out int out_StartIndex, out int out_EndIndex) const

Retrieves the indexes of start and end characters of the selection region.

Parameters:

  • out_startIndex - receives the index for the beginning of the selection region (guaranteed to be less than out_EndIndex)
  • out_EndIndex - recieves the index for the end of the selection region.

Returns:

TRUE if the selection region is valid.

GetUserTextLength[edit]

native final function int GetUserTextLength () const

Returns the length of UserText

SetSelectionEnd[edit]

native final function bool SetSelectionEnd (int EndIndex)

Sets the ending character for the selection region.

Parameters:

  • EndIndex - the index of the character that should become the end of the selection region.

Returns:

TRUE if the selection's ending index was changed successfully.

SetSelectionRange[edit]

native final function bool SetSelectionRange (int StartIndex, int EndIndex)

Change the range of selected characters in this editbox.

Parameters:

  • StartIndex - the index of the first character that should be selected.
  • EndIndex - the index of the last character that should be selected.

Returns:

TRUE if the selection was changed successfully.

SetSelectionStart[edit]

native final function bool SetSelectionStart (int StartIndex)

Sets the starting character for the selection region.

Parameters:

  • StartIndex - the index of the character that should become the start of the selection region.

Returns:

TRUE if the selection's starting index was changed successfully.

SetUserText[edit]

native final function bool SetUserText (string NewValue)

Changes the value of UserText to the specified text without affecting the

SetUserText should be used for modifying the "input text"; that is, the text that would potentially be published to the data store this editbox is bound to. SetValue should be used to change the raw string that will be parsed by the underlying UIString. UserText will be set to the resolved value of the parsed string.

Parameters:

  • NewText - the new text that should be displayed

Returns:

TRUE if the value changed.