Guiliani  Version 2.4 revision 5970 (build 3)
CGUIEdit Class Reference

No-frills text input control, not to be used on its own. More...

#include <GUIEdit.h>

Inheritance diagram for CGUIEdit:

Public Types

enum  AcceptedChars_t {
  AC_ALL, AC_LETTERS, AC_DIGITS, AC_ALPHANUMERIC,
  AC_NONE
}
 Sets of characters that are accepted as input in a CGUIEdit. More...
 
- Public Types inherited from CGUIObject
enum  FourWayFocus_t { FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUS_DOWN }
 

Public Member Functions

 CGUIEdit (CGUICompositeObject *const pkParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const eC_String &rkText, AcceptedChars_t eAcceptedChars=AC_ALL, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIEdit (CGUICompositeObject *const pkParent, const CGUIRect &kRect, const eC_String &rkText, AcceptedChars_t eAcceptedChars=AC_ALL, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIEdit (const CGUIEdit &rkSource)
 
 CGUIEdit ()
 
 ~CGUIEdit ()
 
void AddTextChangedObserver (CGUIObserver *pObserver)
 
eC_String DeleteSelectedTextString ()
 
virtual void DoAnimate (const eC_Value &vTimes=eC_FromInt(1))
 
virtual eC_Bool DoButtonDown (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
eC_Bool DoChar (const eC_UInt &uiKey, const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
 
virtual eC_Bool DoDoubleClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoDrag (const eC_Value &vDeltaX, const eC_Value &vDeltaY, const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool DoDraw ()
 
eC_Bool DoKeyDown (const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
 Edits the text in reaction to keyboard events. More...
 
void EnsureCursorVisible ()
 
AcceptedChars_t GetAcceptedChars () const
 
virtual void GetFocus ()
 
CGUIEditableTextGetLabel ()
 
eC_Int GetMaxLength () const
 
eC_String GetSelectedTextString ()
 
void InsertTextString (const eC_String &rkTextString)
 
virtual eC_Bool IsHighlightable () const
 
virtual void LoseFocus ()
 
CGUIEditoperator= (const CGUIEdit &rkSource)
 
virtual void ReadFromStream ()
 
void RemoveTextChangedObserver (CGUIObserver *pObserver)
 
void SetAcceptedChars (AcceptedChars_t eAcceptedChars)
 
void SetHeight (const eC_Value &vY)
 
void SetLabel (CGUIEditableText *pkText)
 
void SetMaxLength (eC_Int iMaxLength)
 
void SetResetCursorWhenFocusLost (const eC_Bool bResetCursor)
 
virtual void SetTextID (const TextResource_t &eTextID)
 
virtual void SetTextString (const eC_String &rkTextString)
 
void SetWidth (const eC_Value &vX)
 
virtual void WriteToStream (const eC_Bool bWriteClassID=false)
 
- Public Member Functions inherited from CGUIObject
 CGUIObject (CGUICompositeObject *const pParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIObject (CGUICompositeObject *const pParent, const CGUIRect &kRect, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIObject ()
 
 CGUIObject (const CGUIObject &kSource)
 
virtual ~CGUIObject ()
 
void AddValueObserver (CGUIObserver *pObserver)
 
eC_Bool CalculateInvalidatedRect (CGUIRect &rRect) const
 
virtual eC_Bool ClaimFocus ()
 
virtual void CreateSnapshot (eC_UInt uiBackColor=0x00)
 
eC_Bool DataPoolConnectorExists () const
 
void DeleteSnapshot ()
 
virtual void DisableSnapshotDrawing (eC_Bool bDeleteSnapshot=true)
 
virtual eC_Bool DoDrawSnapshot ()
 
virtual void EnableSnapshotDrawing ()
 
virtual CGUIObjectFindObject (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool FocusAny ()
 
virtual eC_Bool FocusNext (CGUIObject *const pRefObj=NULL, const eC_Bool &bSubTreeOfRefObjDone=false)
 
virtual eC_Bool FocusPrevious (CGUIObject *const pRefObj=NULL, const eC_Bool &bSubTreeOfRefObjDone=false)
 
CGUIRect GetAbsRect () const
 
eC_Value GetAbsXPos () const
 
eC_Value GetAbsXPosCenter () const
 
eC_Value GetAbsXPosREdge () const
 
eC_Value GetAbsYPos () const
 
eC_Value GetAbsYPosBEdge () const
 
eC_Value GetAbsYPosCenter () const
 
eC_UByte GetAlpha () const
 
CGUIBehaviourDecoratorGetBehaviour ()
 
const CGUIBehaviourDecoratorGetBehaviour () const
 
GUIBitmapPlaneID_t GetBitmapID () const
 
CGUIBitmapPlaneGetBitmapPlane () const
 
CGUIRect GetCurrentAbsRect () const
 
eC_Value GetCurrentAbsXPos () const
 
eC_Value GetCurrentAbsXPosCenter () const
 
eC_Value GetCurrentAbsXPosREdge () const
 
eC_Value GetCurrentAbsYPos () const
 
eC_Value GetCurrentAbsYPosBEdge () const
 
eC_Value GetCurrentAbsYPosCenter () const
 
CDataPoolConnectorGetDataPoolConnector ()
 
eC_Value GetDistanceBottom () const
 
eC_Value GetDistanceRight () const
 
eC_Value GetHalfHeight () const
 
eC_Value GetHalfWidth () const
 
eC_Value GetHeight () const
 
ObjectHandle_t GetID () const
 
CGUILayouterGetLayouter ()
 
const CGUILayouterGetLayouter () const
 
ObjectHandle_t GetNeighborBottomID () const
 
ObjectHandle_t GetNeighborLeftID () const
 
ObjectHandle_t GetNeighborRightID () const
 
ObjectHandle_t GetNeighborTopID () const
 
CGUIObjectGetObjectByID (const ObjectHandle_t &eID, const eC_Bool &bOnlyVisible=false)
 
const CGUIObjectGetObjectByID (const ObjectHandle_t &eID, const eC_Bool &bOnlyVisible=false) const
 
CGUIRect GetOriginRect () const
 
CGUICompositeObjectGetParent ()
 
const CGUICompositeObjectGetParent () const
 
CGUIRect GetRelRect () const
 
eC_Value GetRelXPos () const
 
eC_Value GetRelXPosCenter () const
 
eC_Value GetRelXPosREdge () const
 
eC_Value GetRelYPos () const
 
eC_Value GetRelYPosBEdge () const
 
eC_Value GetRelYPosCenter () const
 
eC_Value GetWidth () const
 
void InvalidateArea ()
 
eC_Bool IsClickable () const
 
eC_Bool IsClickThrough () const
 
virtual eC_Bool IsCompositeObject () const
 
eC_Bool IsDescendantOf (const CGUIObject *const pAncestor) const
 
eC_Bool IsDisabled () const
 
eC_Bool IsDragable () const
 
eC_Bool IsDragged () const
 
eC_Bool IsDrawingSnapshot () const
 
eC_Bool IsFocussable () const
 
eC_Bool IsFocussed () const
 
eC_Bool IsGrayedOut () const
 
eC_Bool IsHighlighted () const
 
eC_Bool IsInvisible () const
 
eC_Bool IsPressed () const
 
eC_Bool IsStopFocus () const
 
void NotifyValueObservers (const CGUIValue &kValue, const eC_UInt uiX=0, const eC_UInt uiY=0)
 
CGUIObjectoperator= (const CGUIObject &kSource)
 
virtual void RefreshLayout (CGUILayouter::eMovedEdges_t eMovedEdges) const
 
void RemoveValueObserver (CGUIObserver *pObserver)
 
void RenderToBitmap (eC_UInt uiBitmapID, eC_Value vXOffset=eC_FromInt(0), eC_Value vYOffset=eC_FromInt(0))
 
eC_Bool RequestFocus ()
 
void SetAlpha (eC_UByte ubAlpha)
 
void SetBehaviour (CGUIBehaviourDecorator *pBehaviour)
 
void SetClickThrough (const eC_Bool &bClickThrough)
 
virtual void SetDisabled (const eC_Bool &bDisabled)
 
virtual void SetFocussable (const eC_Bool &bFocussable)
 
virtual void SetGrayedOut (const eC_Bool &bGrayOut)
 
void SetID (const ObjectHandle_t &eID)
 
virtual void SetInvisible (const eC_Bool &bInvisible)
 
void SetLayouter (CGUILayouter *pLayouter)
 
void SetNeighborBottomID (const ObjectHandle_t eNewNeighborBottomID)
 
void SetNeighborIDs (const ObjectHandle_t eNewNeighborLeftID, const ObjectHandle_t eNewNeighborRightID, const ObjectHandle_t eNewNeighborTopID, const ObjectHandle_t eNewNeighborBottomID)
 
void SetNeighborLeftID (const ObjectHandle_t eNewNeighborLeftID)
 
void SetNeighborRightID (const ObjectHandle_t eNewNeighborRightID)
 
void SetNeighborTopID (const ObjectHandle_t eNewNeighborTopID)
 
virtual void SetParent (CGUICompositeObject *const pParent)
 
void SetRelRect (const CGUIRect &kNewRect)
 
virtual void SetRelXPos (const eC_Value &vX)
 
void SetRelXPosCenter (const eC_Value &vXCenter)
 
void SetRelXPosREdge (const eC_Value &vX)
 
virtual void SetRelYPos (const eC_Value &vY)
 
void SetRelYPosBEdge (const eC_Value &vY)
 
void SetRelYPosCenter (const eC_Value &vYCenter)
 
void SetStopFocus (const eC_Bool &bDontFocusToParent)
 
virtual eC_Bool SetValue (const CGUIValue &rkValue)
 
virtual eC_Bool SetValue (CDataPoolEntry &rkValue)
 
- Public Member Functions inherited from CGUIBehaviour
virtual eC_Bool DoUserEvent (CGUIEvent *const pEvent)
 
virtual void OnCreate ()
 
virtual void OnDelete ()
 
virtual void OnHide ()
 
virtual void OnShow ()
 
virtual eC_Bool DoClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoLongClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoButtonUp (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoDragEnd (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoMouseEnter (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoMouseLeave (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoMouseMove (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool Decrease ()
 
virtual eC_Bool Increase ()
 
virtual eC_Bool DoKeyUp (const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
 
virtual eC_Bool DoScrollUp (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool DoScrollDown (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool DoScrollLeft (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool DoScrollRight (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
- Public Member Functions inherited from CGUIStreamableObject
const eC_String & GetXMLTag () const
 
void SetXMLTag (const eC_String &kXMLTag)
 
- Public Member Functions inherited from CGUIAnimatable
virtual ~CGUIAnimatable ()
 Destructor. Removes all existing animation callbacks.
 
virtual eC_Bool IsAnimating () const
 
virtual void StartAnimation ()
 
virtual void StopAnimation ()
 

Additional Inherited Members

- Static Public Attributes inherited from CGUIObject
static const eC_Char XMLTAG_ALPHA [] = "Alpha"
 XML tag to be used writing alpha-value into a stream.
 
static const eC_Char XMLTAG_CLICKTHROUGH [] = "ClickThrough"
 XML tag to be used writing clickthrough-state into a stream.
 
static const eC_Char XMLTAG_CONTROLCLASSID [] = "ControlClassID"
 XML tag to be used when writing a control class ID into a stream.
 
static const eC_Char XMLTAG_DISABLED [] = "Disabled"
 XML tag to be used writing disabled-state into a stream.
 
static const eC_Char XMLTAG_FOCUSSABLE [] = "Focussable"
 XML tag to be used writing focussable-state into a stream.
 
static const eC_Char XMLTAG_GRAYEDOUT [] = "GrayedOut"
 XML tag to be used writing grayedout-state into a stream.
 
static const eC_Char XMLTAG_HEIGHT [] = "Height"
 XML tag to be used writing height into a stream.
 
static const eC_Char XMLTAG_INVISIBLE [] = "Invisible"
 XML tag to be used writing invisible-state into a stream.
 
static const eC_Char XMLTAG_OBJECTID [] = "ObjectID"
 XML tag to be used writing object id into a stream.
 
static const eC_Char XMLTAG_OVERRIDDENNEIGHBORS [] = "OverriddenNeighbors"
 XML tag to be used writing overridden neighbors into a stream.
 
static const eC_Char XMLTAG_WIDTH [] = "Width"
 XML tag to be used writing width into a stream.
 
static const eC_Char XMLTAG_XPOS [] = "XPos"
 XML tag to be used writing x-position into a stream.
 
static const eC_Char XMLTAG_YPOS [] = "YPos"
 XML tag to be used writing y-position into a stream.
 
- Static Public Attributes inherited from CGUIBehaviour
static const eC_Char XMLTAG_BEHAVIOURCLASSID [] = "BehaviourClassID"
 XML tag to be used when writing a behaviour class ID into a stream.
 
- Static Public Attributes inherited from CGUIStreamableObject
static const eC_Char XMLTAG_CLASSVERSION [] = "ClassVersion"
 
- Protected Member Functions inherited from CGUIObject
virtual eC_Bool CreateBitmapPlane ()
 
virtual eC_Bool FourWayNext (FourWayFocus_t eFocusDirection)
 
- Protected Member Functions inherited from CGUIStreamableObject
eC_UInt ReadStreamingHeader (const eC_UInt &uiClassVersion, const eC_UInt &uiClassMinVersion=0) const
 
void WriteStreamingFooter (const eC_Bool &bWriteClassID) const
 
void WriteStreamingHeader (const eC_Bool &bWriteClassID, const eC_Char *const pkClassIDTag, const eC_Int &iClassID, const eC_UInt &uiClassVersion) const
 

Detailed Description

No-frills text input control, not to be used on its own.

If you want to have a fully functional input control, use CGUIBaseInputField or a derived class. Using CGUIEdit directly will lead to problems; especially focusing issues will occur.

This control maintains (and clips) a CGUIEditableText. It deals with keyboard input. It inserts, deletes and selects text as needed. It also animates the cursor of the text so that it appears to be blinking. The cursor position is also maintained here, performing the necessary operations when this control receives mouse events (button down sets the cursor position, dragging changes the selection, double clicking selects everything, SHIFT key combined with button down selects text).

When pressing the 'activate' (ENTER) key while this control is focused, the cursor blinking is stopped, and the event is transferred to the parent to be handled.

Pressing the BACKSPACE or DELETE key deletes the current selection. If no text is selected, a character next to the cursor is deleted.

The cursor can be moved around by pressing the cursor keys, HOME and END. If the SHIFT key is held down while pressing either of these keys, the text between the previous and the new cursor position is selected.

The set of characters that are accepted as input (see AcceptedChars_t) can be set when creating an object of this class. It may be changed later by calling SetAcceptedChars(). This attribute is only used for direct user input (i.e., DoChar()). The characters are not checked when changing the text in this control in other ways, like calling SetTextString(), InsertTextString() or streaming.

Platform Specific Limitations

GUIEdit does only work for horizontally left-alignment text (class CGUIEdit). See CGUIEdit Platform Specific Limitations

Member Enumeration Documentation

◆ AcceptedChars_t

Sets of characters that are accepted as input in a CGUIEdit.

Enumerator
AC_ALL 

All characters.

AC_LETTERS 

All letters of the Latin alphabet and whitespace characters.

AC_DIGITS 

Arabic digits.

AC_ALPHANUMERIC 

Latin letters, arabic digits and whitespace characters.

AC_NONE 

No characters.

Constructor & Destructor Documentation

◆ CGUIEdit() [1/4]

CGUIEdit::CGUIEdit ( CGUICompositeObject *const  pkParent,
const eC_Value &  vX,
const eC_Value &  vY,
const eC_Value &  vWidth,
const eC_Value &  vHeight,
const eC_String &  rkText,
AcceptedChars_t  eAcceptedChars = AC_ALL,
const ObjectHandle_t eID = NO_HANDLE 
)

CGUIEdit constructor.

Parameters
pkParentPointer to the designated parent object.
vXX-position relative to its parent object.
vYX-position relative to its parent object.
vWidthWidth of the input field.
vHeightHeight of the input field.
rkTextInitial text to be shown in the input field.
eAcceptedCharsThe character set accepted as input.
eIDObject Identifier of this input field (use NO_HANDLE if none is required).

◆ CGUIEdit() [2/4]

CGUIEdit::CGUIEdit ( CGUICompositeObject *const  pkParent,
const CGUIRect kRect,
const eC_String &  rkText,
AcceptedChars_t  eAcceptedChars = AC_ALL,
const ObjectHandle_t eID = NO_HANDLE 
)

CGUIEdit constructor.

Parameters
pkParentPointer to the designated parent object.
kRectClient rectangle of the new CGUIEdit relative to the parent.
rkTextInitial text to be shown in the input field.
eAcceptedCharsThe character set accepted as input.
eIDObject Identifier of this input field (use NO_HANDLE if none is required).

◆ CGUIEdit() [3/4]

CGUIEdit::CGUIEdit ( const CGUIEdit rkSource)

Copy constructor.

Parameters
rkSourceOriginal instance which is copied.

◆ ~CGUIEdit()

CGUIEdit::~CGUIEdit ( void  )

CGUIEdit destructor

◆ CGUIEdit() [4/4]

CGUIEdit::CGUIEdit ( )

Standard constructor

See also
CGUIObject().

Member Function Documentation

◆ DeleteSelectedTextString()

eC_String CGUIEdit::DeleteSelectedTextString ( )

Deletes the selected text (if any).

Returns
The selected text string before deletion.

◆ DoAnimate()

void CGUIEdit::DoAnimate ( const eC_Value &  vTimes = eC_FromInt(1))
virtual

Animates the cursor by toggling the internal CGUIEditableText's cursor.

Parameters
vTimesCorrection factor

Reimplemented from CGUIAnimatable.

◆ DoButtonDown()

eC_Bool CGUIEdit::DoButtonDown ( const eC_Value &  vAbsX,
const eC_Value &  vAbsY 
)
virtual

Sets the cursor position to the position returned by CGUIEditableText::GetBestCursorPosition() and starts the cursor blinking animation. If SHIFT is pressed, the text between the current cursor position and clicked-position is selected.

Parameters
vAbsXX-position in screen coordinates where the click occurred
vAbsYY-position in screen coordinates where the click occurred
Returns
True The event has been handled.
False The event has not been handled.

Reimplemented from CGUIBehaviour.

◆ DoChar()

eC_Bool CGUIEdit::DoChar ( const eC_UInt &  uiKey,
const GUIKeyIdentifier_t eKeyIdentifier,
const eC_UInt &  uiModifiers 
)
virtual

This implementation does the following:

  1. If there is a selection, the selected text is replaced by the character.
  2. If there is no selection, the character is inserted at the current cursor position.
    Parameters
    uiKeyThe code of the pressed key.
    eKeyIdentifierThe Guiliani key identifier.
    uiModifiersModifiers bitfield.
    Returns
    Always False.

Reimplemented from CGUIBehaviour.

◆ DoDoubleClick()

eC_Bool CGUIEdit::DoDoubleClick ( const eC_Value &  vAbsX = eC_FromInt(-1),
const eC_Value &  vAbsY = eC_FromInt(-1) 
)
virtual

Selects the whole text.

Parameters
vAbsXX-position in screen coordinates where the click occurred
vAbsYY-position in screen coordinates where the click occurred
Returns
True The event has been handled.
False The event has not been handled.

Reimplemented from CGUIBehaviour.

◆ DoDrag()

eC_Bool CGUIEdit::DoDrag ( const eC_Value &  vDeltaX,
const eC_Value &  vDeltaY,
const eC_Value &  vAbsX,
const eC_Value &  vAbsY 
)
virtual

Extends the text selection.

Parameters
vDeltaXMouse movement in X since last frame
vDeltaYMouse movement in Y since last frame
vAbsXMouse position in X where event occurred
vAbsYMouse position in Y where event occurred
Returns
Always True

Reimplemented from CGUIBehaviour.

◆ DoDraw()

eC_Bool CGUIEdit::DoDraw ( )
virtual

Visualizes the object. It is forbidden to call SetRelXPos, SetRelYPos, SetWidth or SetHeight in DoDraw, i.e., it is not allowed to change the layout.

Returns
True if anything was drawn, False otherwise

Reimplemented from CGUIObject.

◆ DoKeyDown()

eC_Bool CGUIEdit::DoKeyDown ( const GUIKeyIdentifier_t eKeyIdentifier,
const eC_UInt &  uiModifiers 
)
virtual

Edits the text in reaction to keyboard events.

This implementation does the following:

  • If cursor left or right is pressed, one of the following may happen:
    1. If there is a selection and the SHIFT key is pressed, the selection may be extended. Otherwise, the selected text is deselected.
    2. If there is no selection, the cursor is moved one character to the left or right, depending on the pressed key.
  • If ESCAPE key is pressed and there is a selection, the selected text is deselected.
  • If HOME or END key is pressed, one of the following may happen:
    1. If SHIFT key is pressed, the text between the current cursor and the beginning or end of the line is selected.
    2. If SHIFT key is not pressed, the cursor goes to the beginning or the end of the line.
      Parameters
      eKeyIdentifierThe Guiliani key identifier.
      uiModifiersModifiers bitfield.
      Returns
      different values based on the action carried out:
  • True if cursor left or cursor right was pressed. This is necessary to keep focusing reasonable.
  • false for any other type of event to allow further processing by parent objects.

Reimplemented from CGUIBehaviour.

◆ EnsureCursorVisible()

void CGUIEdit::EnsureCursorVisible ( )

Computes the cursor pixel position from the current cursor position. If the cursor is outside the containing object so that it would be clipped, this method ensures the cursor's visibility by scrolling the text vertically.

◆ GetAcceptedChars()

AcceptedChars_t CGUIEdit::GetAcceptedChars ( ) const
inline
Returns
The current set of characters accepted as input as set by SetAcceptedChars() or the constructor.

◆ GetFocus()

void CGUIEdit::GetFocus ( )
virtual

Starts the cursor blinking animation.

Reimplemented from CGUIBehaviour.

◆ GetLabel()

CGUIEditableText* CGUIEdit::GetLabel ( )
inline

Get the CGUIEditableText label of the input field.

Returns
Pointer to the label.

◆ GetMaxLength()

eC_Int CGUIEdit::GetMaxLength ( ) const
inline
Returns
the maximum length of the input text.

◆ GetSelectedTextString()

eC_String CGUIEdit::GetSelectedTextString ( )

Gets the selected text.

Returns
The currently selected text.

◆ InsertTextString()

void CGUIEdit::InsertTextString ( const eC_String &  rkTextString)

Deletes selected text (if any) and inserts text at the cursor's position. If the total length after inserting would exceed the max length, the text passed text is truncated before inserting (existing text is not deleted).

Parameters
rkTextStringThe string to be inserted.

◆ IsHighlightable()

virtual eC_Bool CGUIEdit::IsHighlightable ( ) const
inlinevirtual

This method checks if an object is highlightable. This refers to whether it can be highlighted via the event handler. If true the event handler may mark this object as the currently highlighted one. Thus, there is no special flag in CGUIObject that determines if an object is highlightable. The default determination is that the control is in none of the following states:

  • invisible
  • grayed-out
  • disabled if so the return value will be true. NOTE: when an object is not highlightable, it will never receive DoMouseEnter and DoMouseLeave-events
    Returns
    True if highlightable, False otherwise

Reimplemented from CGUIObject.

◆ LoseFocus()

void CGUIEdit::LoseFocus ( )
virtual

Deselects all text by resetting the cursor position to 0 and stops the cursor blinking animation.

See also
CGUIEditableText::SetCursorPosition()

Reimplemented from CGUIBehaviour.

◆ operator=()

CGUIEdit & CGUIEdit::operator= ( const CGUIEdit rkSource)

Assignment operator method of the CGUIEdit class.

Parameters
rkSourceSource object to be copied.
Returns
Copied object.

◆ ReadFromStream()

void CGUIEdit::ReadFromStream ( )
virtual

Reads all object attributes from streaming file. Only for use with GUIFactory. GUIStreamingFileReader has to be set in CGUI::Init().

See also
CGUIFactory

Reimplemented from CGUIObject.

◆ RemoveTextChangedObserver()

void CGUIEdit::RemoveTextChangedObserver ( CGUIObserver pObserver)

Unsubscribe an observer that subscribed as TextChanged observer.

Parameters
pObserverThe Observer that wants to unsubscribe.

◆ SetAcceptedChars()

void CGUIEdit::SetAcceptedChars ( AcceptedChars_t  eAcceptedChars)

Set the type of characters that are accepted by DoChar(). This method does not check the current text and does not modify it.

Parameters
eAcceptedCharsThe character set accepted as input.
See also
GetAcceptedChars()

◆ SetHeight()

void CGUIEdit::SetHeight ( const eC_Value &  vY)
virtual

Set the height of the edit field. Reimplemented because this affects the internal text and its cursor.

Parameters
vYNew height of the edit field.

Reimplemented from CGUIObject.

◆ SetLabel()

void CGUIEdit::SetLabel ( CGUIEditableText pkText)

Changes the internal text. Deletes the previous text and stores the pointer passed to this method.

Parameters
pkTextThe new text to be used.

◆ SetMaxLength()

void CGUIEdit::SetMaxLength ( eC_Int  iMaxLength)

Set the maximum length of the input text.

Parameters
iMaxLengthThe maximum length of input text.

◆ SetResetCursorWhenFocusLost()

void CGUIEdit::SetResetCursorWhenFocusLost ( const eC_Bool  bResetCursor)
inline

Specifies whether the cursor position and blinking state will be reset when the focus is lost. By default, a CGUIEdit will reset the cursor when it loses the focus. For use cases with onscreen keyboards this behaviour might not be desired.

Parameters
bResetCursorTrue will reset the cursor, False will leave it untouched.

◆ SetTextID()

void CGUIEdit::SetTextID ( const TextResource_t eTextID)
virtual

This sets the text string associated with the given TextID.

Note
This will NOT use the actual TextID and will therefore NOT be updated if the TextID's text changes.
Parameters
eTextIDTextID whose associated text shall be shown on the GUIEdit.

◆ SetTextString()

void CGUIEdit::SetTextString ( const eC_String &  rkTextString)
virtual

Set the text. If there already is text, it is replaced completely. If the text's length exceeds the max length, it is truncated.

Parameters
rkTextStringThe string to be assigned to this object.

◆ SetWidth()

void CGUIEdit::SetWidth ( const eC_Value &  vX)
virtual

Sets this object's width to a new value.

Parameters
vXthe new width

Reimplemented from CGUIObject.

◆ WriteToStream()

void CGUIEdit::WriteToStream ( const eC_Bool  bWriteClassID = false)
virtual

Writes all object attributes to the streaming file. StreamWriter has to be initialized. Only for use with GUIStreamWriter.

Parameters
bWriteClassIDThis flag is used to select if writing of ControlID, leading and trailing tags is performed. Only GUIStreamWriter and GUICompositeObject have to set this flag true.
See also
CGUIStreamWriter

Reimplemented from CGUIObject.


The documentation for this class was generated from the following files: