SuperTuxKart
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CGUIEditBox Class Reference
Inheritance diagram for CGUIEditBox:
Inheritance graph
[legend]

Public Member Functions

 CGUIEditBox (const wchar_t *text, bool border, IGUIEnvironment *environment, IGUIElement *parent, s32 id, const core::rect< s32 > &rectangle)
 constructor
 
virtual ~CGUIEditBox ()
 destructor
 
virtual void setOverrideFont (IGUIFont *font=0)
 Sets another skin independent font.
 
virtual void setOverrideColor (video::SColor color)
 Sets another color for the text.
 
virtual video::SColor getOverrideColor () const
 Gets the override color.
 
virtual void enableOverrideColor (bool enable)
 Sets if the text should use the overide color or the color in the gui skin.
 
virtual bool isOverrideColorEnabled (void) const
 Checks if an override color is enabled.
 
virtual void setDrawBorder (bool border)
 Turns the border on or off.
 
virtual void setWordWrap (bool enable)
 Enables or disables word wrap for using the edit box as multiline text editor.
 
virtual bool isWordWrapEnabled () const
 Checks if word wrap is enabled.
 
virtual void setMultiLine (bool enable)
 Enables or disables newlines.
 
virtual bool isMultiLineEnabled () const
 Checks if multi line editing is enabled.
 
virtual void setAutoScroll (bool enable)
 Enables or disables automatic scrolling with cursor position.
 
virtual bool isAutoScrollEnabled () const
 Checks to see if automatic scrolling is enabled.
 
virtual core::dimension2du getTextDimension ()
 Gets the size area of the text in the edit box.
 
virtual void setTextAlignment (EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical)
 Sets text justification.
 
virtual bool OnEvent (const SEvent &event)
 called if an event happened.
 
virtual void draw ()
 draws the element and its children
 
virtual void setText (const core::stringw &text)
 Sets the new caption of this element.
 
virtual void setMax (u32 max)
 Sets the maximum amount of characters which may be entered in the box.
 
virtual u32 getMax () const
 Returns maximum amount of characters, previously set by setMax();.
 
virtual void setPasswordBox (bool passwordBox, wchar_t passwordChar=L' *')
 Sets whether the edit box is a password box. Setting this to true will.
 
virtual bool isPasswordBox () const
 Returns true if the edit box is currently a password box.
 
virtual void updateAbsolutePosition ()
 Updates the absolute position, splits text if required.
 
virtual void serializeAttributes (io::IAttributes *out, io::SAttributeReadWriteOptions *options) const
 Writes attributes of the element.
 
virtual void deserializeAttributes (io::IAttributes *in, io::SAttributeReadWriteOptions *options)
 Reads attributes of the element.
 
virtual irr::gui::IGUIFont * getOverrideFont () const
 
virtual irr::gui::IGUIFont * getActiveFont () const
 
virtual void setDrawBackground (bool)
 
void fromAndroidEditText (const std::u32string &text, int start, int end, int composing_start, int composing_end)
 
void openScreenKeyboard ()
 
s32 getCursorPosInBox () const
 
s32 getTextCount () const
 
void setTextBoxType (GUIEngine::TextBoxType t)
 
virtual void setComposingText (const std::u32string &ct)
 
virtual void clearComposingText ()
 
virtual const core::position2di & getICPos () const
 
void sendGuiEvent (EGUI_EVENT_TYPE type)
 send some gui event to parent
 

Protected Member Functions

void setTextRect (s32 line)
 sets the area of the given line
 
virtual void inputChar (char32_t c)
 adds a letter to the edit box
 
void calculateScrollPos ()
 calculates the current scroll position
 
void setTextMarkers (s32 begin, s32 end)
 send some gui event to parent set text markers
 
void updateCursorDistance ()
 
bool processKey (const SEvent &event)
 
bool processMouse (const SEvent &event)
 
s32 getCursorPos (s32 x, s32 y)
 
void updateGlyphLayouts ()
 
void correctCursor (s32 &cursor_pos, bool left)
 
void updateSurrogatePairText ()
 

Protected Attributes

bool MouseMarking
 
bool Border
 
bool OverrideColorEnabled
 
s32 m_mark_begin
 
s32 m_mark_end
 
GUIEngine::TextBoxType m_type
 
video::SColor OverrideColor
 
gui::IGUIFont * OverrideFont
 
gui::IGUIFont * LastBreakFont
 
IOSOperator * Operator
 
uint64_t m_force_show_cursor_time
 
s32 m_cursor_pos
 
s32 m_scroll_pos
 
s32 m_cursor_distance
 
u32 m_max_chars
 
bool AutoScroll
 
bool PasswordBox
 
char32_t PasswordChar
 
EGUI_ALIGNMENT HAlign
 
EGUI_ALIGNMENT VAlign
 
core::rect< s32 > CurrentTextRect
 
core::rect< s32 > FrameRect
 
s32 m_composing_start
 
s32 m_composing_end
 
std::u32string m_edit_text
 
std::u32string m_composing_text
 
std::vector< GlyphLayout > m_glyph_layouts
 
std::vector< wchar_t > m_surrogate_chars
 
core::position2di m_ic_pos
 

Member Function Documentation

◆ getTextDimension()

core::dimension2du CGUIEditBox::getTextDimension ( )
virtual

Gets the size area of the text in the edit box.

Gets the area of the text in the edit box.

Returns
Returns the size in pixels of the text

◆ inputChar()

void CGUIEditBox::inputChar ( char32_t  c)
protectedvirtual

adds a letter to the edit box

Reimplemented in MyCGUIEditBox.

◆ isAutoScrollEnabled()

bool CGUIEditBox::isAutoScrollEnabled ( ) const
virtual

Checks to see if automatic scrolling is enabled.

Returns
true if automatic scrolling is enabled, false if not

◆ isMultiLineEnabled()

virtual bool CGUIEditBox::isMultiLineEnabled ( ) const
inlinevirtual

Checks if multi line editing is enabled.

Returns
true if mult-line is enabled, false otherwise

◆ isOverrideColorEnabled()

bool CGUIEditBox::isOverrideColorEnabled ( void  ) const
virtual

Checks if an override color is enabled.

Returns
true if the override color is enabled, false otherwise

◆ isWordWrapEnabled()

virtual bool CGUIEditBox::isWordWrapEnabled ( ) const
inlinevirtual

Checks if word wrap is enabled.

Returns
true if word wrap is enabled, false otherwise

◆ OnEvent()

bool CGUIEditBox::OnEvent ( const SEvent &  event)
virtual

called if an event happened.

Reimplemented in MyCGUIEditBox.

◆ setAutoScroll()

void CGUIEditBox::setAutoScroll ( bool  enable)
virtual

Enables or disables automatic scrolling with cursor position.

Parameters
enableIf set to true, the text will move around with the cursor position

◆ setMax()

void CGUIEditBox::setMax ( u32  max)
virtual

Sets the maximum amount of characters which may be entered in the box.

Parameters
maxMaximum amount of characters. If 0, the character amount is infinity.

◆ setMultiLine()

virtual void CGUIEditBox::setMultiLine ( bool  enable)
inlinevirtual

Enables or disables newlines.

Parameters
enableIf set to true, the EGET_EDITBOX_ENTER event will not be fired, instead a newline character will be inserted.

◆ setPasswordBox()

void CGUIEditBox::setPasswordBox ( bool  passwordBox,
wchar_t  passwordChar = L'*' 
)
virtual

Sets whether the edit box is a password box. Setting this to true will.

disable MultiLine, WordWrap and the ability to copy with ctrl+c or ctrl+x

Parameters
passwordBoxtrue to enable password, false to disable
passwordCharthe character that is displayed instead of letters

◆ setTextMarkers()

void CGUIEditBox::setTextMarkers ( s32  begin,
s32  end 
)
protected

send some gui event to parent set text markers

set text markers


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