#include <intlGUIEditBox.h>
Public Member Functions | |
intlGUIEditBox (const wchar_t *text, bool border, IGUIEnvironment *environment, IGUIElement *parent, s32 id, const core::rect< s32 > &rectangle, bool writable=true, bool has_vscrollbar=false) | |
constructor More... | |
virtual | ~intlGUIEditBox () |
destructor More... | |
virtual void | setDrawBackground (bool draw) |
Sets whether to draw the background. More... | |
virtual bool | isDrawBackgroundEnabled () const |
virtual void | draw () |
draws the element and its children More... | |
virtual void | updateAbsolutePosition () |
Updates the absolute position, splits text if required. More... | |
virtual void | setCursorChar (const wchar_t cursorChar) |
virtual wchar_t | getCursorChar () const |
virtual void | setCursorBlinkTime (u32 timeMs) |
virtual u32 | getCursorBlinkTime () const |
Public Member Functions inherited from GUIEditBox | |
GUIEditBox (IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle, bool border, bool writable) | |
virtual | ~GUIEditBox () |
virtual void | setOverrideFont (IGUIFont *font=0) |
Sets another skin independent font. More... | |
virtual IGUIFont * | getOverrideFont () const |
virtual IGUIFont * | getActiveFont () const |
Get the font which is used right now for drawing. More... | |
virtual void | setOverrideColor (video::SColor color) |
Sets another color for the text. More... | |
virtual video::SColor | getOverrideColor () const |
Gets the override color. More... | |
virtual void | enableOverrideColor (bool enable) |
Sets if the text should use the overide color or the color in the gui skin. More... | |
virtual bool | isOverrideColorEnabled (void) const |
Checks if an override color is enabled. More... | |
virtual void | setWordWrap (bool enable) |
Enables or disables word wrap for using the edit box as multiline text editor. More... | |
virtual bool | isWordWrapEnabled () const |
Checks if word wrap is enabled. More... | |
virtual void | setDrawBorder (bool border) |
Turns the border on or off. More... | |
virtual bool | isDrawBorderEnabled () const |
virtual void | setMultiLine (bool enable) |
Enables or disables newlines. More... | |
virtual bool | isMultiLineEnabled () const |
Checks if multi line editing is enabled. More... | |
virtual void | setAutoScroll (bool enable) |
Enables or disables automatic scrolling with cursor position. More... | |
virtual bool | isAutoScrollEnabled () const |
Checks to see if automatic scrolling is enabled. More... | |
virtual void | setPasswordBox (bool passwordBox, wchar_t passwordChar=L' *') |
Sets whether the edit box is a password box. Setting this to true will. More... | |
virtual bool | isPasswordBox () const |
Returns true if the edit box is currently a password box. More... | |
virtual void | setTextAlignment (EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) |
Sets text justification. More... | |
virtual void | setText (const wchar_t *text) |
Sets the new caption of this element. More... | |
virtual void | setMax (u32 max) |
Sets the maximum amount of characters which may be entered in the box. More... | |
virtual u32 | getMax () const |
Returns maximum amount of characters, previously set by setMax();. More... | |
virtual core::dimension2du | getTextDimension () |
Gets the size area of the text in the edit box. More... | |
virtual void | setWritable (bool can_write_text) |
set true if this EditBox is writable More... | |
virtual bool | OnEvent (const SEvent &event) |
called if an event happened. More... | |
virtual void | serializeAttributes (io::IAttributes *out, io::SAttributeReadWriteOptions *options) const |
Writes attributes of the element. More... | |
virtual void | deserializeAttributes (io::IAttributes *in, io::SAttributeReadWriteOptions *options) |
Reads attributes of the element. More... | |
Protected Member Functions | |
virtual void | breakText () |
Breaks the single text line. More... | |
virtual void | setTextRect (s32 line) |
sets the area of the given line More... | |
void | calculateScrollPos () |
calculates the current scroll position More... | |
s32 | getCursorPos (s32 x, s32 y) |
void | createVScrollBar () |
Create a vertical scrollbar. More... | |
Protected Member Functions inherited from GUIEditBox | |
void | setTextMarkers (s32 begin, s32 end) |
set text markers More... | |
void | sendGuiEvent (EGUI_EVENT_TYPE type) |
send some gui event to parent More... | |
bool | processKey (const SEvent &event) |
virtual void | inputChar (wchar_t c) |
s32 | getLineFromPos (s32 pos) |
returns the line number that the cursor is on More... | |
void | updateVScrollBar () |
update the vertical scrollBar (visibilty & position) More... | |
Additional Inherited Members | |
Protected Attributes inherited from GUIEditBox | |
gui::IGUIFont * | m_override_font = nullptr |
bool | m_override_color_enabled = false |
bool | m_word_wrap = false |
bool | m_multiline = false |
bool | m_autoscroll = true |
bool | m_border |
bool | m_passwordbox = false |
wchar_t | m_passwordchar = L'*' |
std::vector< core::stringw > | m_broken_text |
std::vector< s32 > | m_broken_text_positions |
EGUI_ALIGNMENT | m_halign = EGUIA_UPPERLEFT |
EGUI_ALIGNMENT | m_valign = EGUIA_CENTER |
u32 | m_blink_start_time = 0 |
s32 | m_cursor_pos = 0 |
s32 | m_hscroll_pos = 0 |
s32 | m_vscroll_pos = 0 |
u32 | m_max = 0 |
video::SColor | m_override_color = video::SColor(101, 255, 255, 255) |
core::rect< s32 > | m_current_text_rect = core::rect<s32>(0, 0, 1, 1) |
bool | m_writable |
bool | m_mouse_marking = false |
s32 | m_mark_begin = 0 |
s32 | m_mark_end = 0 |
gui::IGUIFont * | m_last_break_font = nullptr |
IOSOperator * | m_operator = nullptr |
core::rect< s32 > | m_frame_rect |
u32 | m_scrollbar_width = 0 |
GUIScrollBar * | m_vscrollbar = nullptr |
irr::gui::intlGUIEditBox::intlGUIEditBox | ( | const wchar_t * | text, |
bool | border, | ||
IGUIEnvironment * | environment, | ||
IGUIElement * | parent, | ||
s32 | id, | ||
const core::rect< s32 > & | rectangle, | ||
bool | writable = true , |
||
bool | has_vscrollbar = false |
||
) |
constructor
References breakText(), calculateScrollPos(), createVScrollBar(), GUIEditBox::m_border, GUIEditBox::m_frame_rect, GUIEditBox::m_operator, GUIEditBox::m_scrollbar_width, and GUIEditBox::setWritable().
|
inlinevirtual |
destructor
|
protectedvirtual |
Breaks the single text line.
Implements GUIEditBox.
References GUIEditBox::m_broken_text, GUIEditBox::m_broken_text_positions, GUIEditBox::m_last_break_font, GUIEditBox::m_multiline, GUIEditBox::m_override_font, GUIEditBox::m_scrollbar_width, and GUIEditBox::m_word_wrap.
Referenced by intlGUIEditBox(), draw(), and updateAbsolutePosition().
|
protectedvirtual |
calculates the current scroll position
Implements GUIEditBox.
References GUIEditBox::getLineFromPos(), GUIEditBox::m_autoscroll, GUIEditBox::m_broken_text, GUIEditBox::m_broken_text_positions, GUIEditBox::m_current_text_rect, GUIEditBox::m_cursor_pos, GUIEditBox::m_frame_rect, GUIEditBox::m_hscroll_pos, GUIEditBox::m_multiline, GUIEditBox::m_override_font, GUIEditBox::m_vscroll_pos, GUIEditBox::m_vscrollbar, GUIEditBox::m_word_wrap, GUIScrollBar::setPos(), and setTextRect().
Referenced by intlGUIEditBox().
|
protected |
Create a vertical scrollbar.
References GUIEditBox::m_frame_rect, GUIEditBox::m_override_font, GUIEditBox::m_scrollbar_width, GUIEditBox::m_vscrollbar, GUIScrollBar::setLargeStep(), and GUIScrollBar::setSmallStep().
Referenced by intlGUIEditBox().
|
virtual |
draws the element and its children
References breakText(), GUIEditBox::getLineFromPos(), porting::getTimeMs(), GUIEditBox::m_blink_start_time, GUIEditBox::m_border, GUIEditBox::m_broken_text, GUIEditBox::m_broken_text_positions, GUIEditBox::m_current_text_rect, GUIEditBox::m_cursor_pos, GUIEditBox::m_frame_rect, GUIEditBox::m_last_break_font, GUIEditBox::m_mark_begin, GUIEditBox::m_mark_end, GUIEditBox::m_multiline, GUIEditBox::m_override_color, GUIEditBox::m_override_color_enabled, GUIEditBox::m_override_font, GUIEditBox::m_passwordbox, GUIEditBox::m_passwordchar, GUIEditBox::m_word_wrap, GUIEditBox::m_writable, setTextRect(), and GUIEditBox::updateVScrollBar().
|
inlinevirtual |
|
inlinevirtual |
|
protectedvirtual |
Implements GUIEditBox.
References GUIEditBox::getActiveFont(), idx, GUIEditBox::m_broken_text, GUIEditBox::m_broken_text_positions, GUIEditBox::m_current_text_rect, GUIEditBox::m_multiline, GUIEditBox::m_word_wrap, rangelim, S32_MAX, and setTextRect().
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
virtual |
Sets whether to draw the background.
|
protectedvirtual |
sets the area of the given line
Implements GUIEditBox.
References GUIEditBox::m_broken_text, GUIEditBox::m_current_text_rect, GUIEditBox::m_frame_rect, GUIEditBox::m_halign, GUIEditBox::m_hscroll_pos, GUIEditBox::m_multiline, GUIEditBox::m_override_font, GUIEditBox::m_valign, GUIEditBox::m_vscroll_pos, and GUIEditBox::m_word_wrap.
Referenced by calculateScrollPos(), draw(), and getCursorPos().
|
virtual |
Updates the absolute position, splits text if required.
References breakText().