Support Forum G3D Web Page |
Text box with multiple line support for entering strings. More...
Inherits G3D::GuiTextBox.
Public Types | |
enum | Update { IMMEDIATE_UPDATE, DELAYED_UPDATE } |
IMMEDIATE_UPDATE - Update the string and fire a GUI_ACTION every time the text is changed DELAYED_UPDATE - Wait until the box loses focus to fire an event and update the string. More... | |
Public Member Functions | |
GuiMultiLineTextBox (GuiContainer *parent, const GuiText &caption, const Pointer< String > &value, Update update, GuiTheme::TextBoxStyle style) | |
const GuiText & | caption () const |
float | captionHeight () const |
For controls that have a caption outside the bounds of the control on the top or bottom, this is the size reserved for the caption. More... | |
float | captionWidth () const |
For controls that have a caption outside the bounds of the control on the left, this is the size reserved for the caption. More... | |
const Rect2D & | clickRect () const |
Used by GuiContainers. More... | |
virtual float | defaultCaptionHeight () const |
Default caption size for this control. More... | |
virtual float | defaultCaptionWidth () const |
bool | enabled () const |
virtual void | findControlUnderMouse (Vector2 mouse, GuiControl *&control) |
Return the enabled, visible control containing the mouse. More... | |
bool | focused () const |
Vector2 | fromOSWindowCoords (const Vector2 &v) const |
Transforms v from OS window coordinates to this control's coordinates. More... | |
String | highlightedText () |
Returns copy of highlighted text. More... | |
bool | mouseOver () const |
void | moveBy (const Vector2 &delta) |
void | moveBy (float dx, float dy) |
void | moveRightOf (const GuiControl *control, const Vector2 &offset) |
If these two controls have the same parent, move this one immediately to the right of the argument. More... | |
void | moveRightOf (const GuiControl *control, float offsetX=0.0f) |
const Rect2D & | rect () const |
virtual void | render (RenderDevice *rd, const shared_ptr< GuiTheme > &theme, bool ancestorsEnabled) const override |
Only methods on theme may be called from this method by default. More... | |
virtual void | setCaption (const GuiText &caption) |
virtual void | setCaptionHeight (float c) |
virtual void | setCaptionWidth (float c) |
virtual void | setEnabled (bool e) |
void | setEventSource (GuiControl *c) |
void | setFocused (bool b) |
Grab or release keyboard focus. More... | |
void | setHeight (float h) |
void | setPosition (const Vector2 &v) |
void | setPosition (float x, float y) |
virtual void | setRect (const Rect2D &) override |
If you explicitly change the rectangle of a control, the containing pane may clip its borders. More... | |
void | setSize (const Vector2 &v) |
void | setSize (float x, float y) |
void | setVisible (bool b) |
void | setWidth (float w) |
shared_ptr< GuiTheme > | theme () const |
virtual bool | toolStyle () const |
Return true if this is in tool button style. More... | |
Vector2 | toOSWindowCoords (const Vector2 &v) const |
Returns the coordinates of v, which is in the coordinate system of this object, relative to the OSWindow on which it will be rendered. More... | |
Rect2D | toOSWindowCoords (const Rect2D &r) const |
bool | visible () const |
GuiWindow * | window () const |
Get the window containing this control. More... | |
Protected Types | |
enum | { LEFT_CAPTION_WIDTH = 80, TOP_CAPTION_HEIGHT = 20 } |
Protected Member Functions | |
void | backspaceCharacter () |
virtual void | commit () |
Called to change the value to the typed value. More... | |
virtual int | coordsToCursorPos (Vector2 coords) override |
void | deleteCharacter () |
void | fireEvent (GEventType type) |
Fires an event. More... | |
Vector2int32 | highlightedRange () |
Returns begin and end indices of highlighted string in left-to-right order. More... | |
void | insertCharacter (char c) |
Inserts character at cursor position and fires update events. More... | |
void | moveCursorDown () |
virtual void | moveCursorEnd () override |
Moves cursor to end position (End key). More... | |
virtual void | moveCursorHome () override |
Moves cursor to home position (Home key). More... | |
void | moveCursorLeft () |
void | moveCursorRight () |
void | moveCursorUp () |
virtual bool | onEvent (const GEvent &event) override |
Events are only delivered (by GuiWindow) to a GuiControl when the control has the key focus. More... | |
void | processRepeatKeysym () |
Called from render and onEvent to enact the action triggered by the repeat key. More... | |
void | replaceHighlightedText (const String &s) |
void | setRepeatKeysym (GKeySym key) |
Called from onEvent when a key is pressed. More... | |
void | stopHighlighting () |
void | unsetRepeatKeysym () |
Called from onEvent when the repeat key is released. More... | |
Protected Attributes | |
GuiText | m_caption |
float | m_captionHeight |
float | m_captionWidth |
Rect2D | m_clickRect |
Rect bounds used for mouse actions. More... | |
GuiText | m_cursor |
String to be used as the cursor character. More... | |
int | m_cursorPos |
Character position in m_userValue of the cursor. More... | |
bool | m_editing |
True if currently being edited, that is, if the user has changed the string more recently than the program has changed it. More... | |
bool | m_enabled |
GuiControl * | m_eventSource |
Sent events should appear to be from this object, which is usually "this". More... | |
GuiWindow * | m_gui |
The window that ultimately contains this control. More... | |
bool | m_highlighting |
True if currently highlighting text with mouse button down. More... | |
int | m_highlightPos |
Character position of the highlight start position. More... | |
RealTime | m_keyDownTime |
Time at which setRepeatKeysym was called. More... | |
RealTime | m_keyRepeatTime |
Time at which the key will repeat (if down). More... | |
String | m_oldValue |
Original value before the user started editing. More... | |
GuiContainer * | m_parent |
Parent pane. More... | |
Rect2D | m_rect |
Rect bounds used for rendering and layout. More... | |
GKeySym | m_repeatKeysym |
Key that is currently auto-repeating. More... | |
GuiTheme::TextBoxStyle | m_style |
Update | m_update |
String | m_userValue |
The value currently being set by the user. More... | |
Pointer< String > | m_value |
The string that this box is associated with. More... | |
bool | m_visible |
Text box with multiple line support for entering strings.
Enter adds a line break instead of firing GEventType::GUI_ACTION like GuiTextBox does.
Events:
|
inherited |
G3D::GuiMultiLineTextBox::GuiMultiLineTextBox | ( | GuiContainer * | parent, |
const GuiText & | caption, | ||
const Pointer< String > & | value, | ||
Update | update, | ||
GuiTheme::TextBoxStyle | style | ||
) |
|
protectedinherited |
|
inherited |
Referenced by G3D::GuiPane::addDropDownList(), G3D::GuiPane::addMultiLineTextBox(), and G3D::GuiPane::addTextBox().
|
inherited |
For controls that have a caption outside the bounds of the control on the top or bottom, this is the size reserved for the caption.
|
inherited |
For controls that have a caption outside the bounds of the control on the left, this is the size reserved for the caption.
|
inlineinherited |
Used by GuiContainers.
|
protectedvirtualinherited |
Called to change the value to the typed value.
Reimplemented in G3D::GuiNumberBox< Value >::MyTextBox.
Referenced by G3D::GuiNumberBox< Value >::MyTextBox::commit().
|
overrideprotectedvirtual |
Reimplemented from G3D::GuiTextBox.
|
inlinevirtualinherited |
Default caption size for this control.
Reimplemented in G3D::GuiFunctionBox.
|
inlinevirtualinherited |
|
protectedinherited |
|
inherited |
Referenced by G3D::GuiNumberBox< int >::render().
|
inlinevirtualinherited |
Return the enabled, visible control containing the mouse.
The default implementation returns itself if the mouse is within its bounds. GuiContainers should override this to iterate through children. Since only one (non-overlapping) child will write to control, it is sufficient to call this on all children without testing to see if one already wrote to control.
Reimplemented in G3D::GuiNumberBox< Value >, G3D::GuiNumberBox< float >, G3D::GuiNumberBox< int >, G3D::GuiTextureBox, G3D::GuiPane, G3D::GuiScrollPane, G3D::GuiFrameBox, and G3D::GuiTabPane.
Referenced by G3D::GuiNumberBox< int >::findControlUnderMouse().
|
protectedinherited |
Fires an event.
|
inherited |
Transforms v from OS window coordinates to this control's coordinates.
|
protectedinherited |
Returns begin and end indices of highlighted string in left-to-right order.
|
inherited |
Returns copy of highlighted text.
|
protectedinherited |
Inserts character at cursor position and fires update events.
|
inherited |
|
inherited |
|
inherited |
|
protected |
|
overrideprotectedvirtual |
Moves cursor to end position (End key).
Reimplemented from G3D::GuiTextBox.
|
overrideprotectedvirtual |
Moves cursor to home position (Home key).
Reimplemented from G3D::GuiTextBox.
|
protectedinherited |
|
protectedinherited |
|
protected |
|
inherited |
If these two controls have the same parent, move this one immediately to the right of the argument.
offset | May be negative |
Referenced by G3D::GuiControl::moveRightOf().
|
inlineinherited |
|
overrideprotectedvirtual |
Events are only delivered (by GuiWindow) to a GuiControl when the control has the key focus.
If the control does not consume the event, the event is delivered to each of its GUI parents in order, back to the window's root pane.
Key focus is transferred during a mouse down event.
Reimplemented from G3D::GuiTextBox.
|
protectedinherited |
Called from render and onEvent to enact the action triggered by the repeat key.
|
inherited |
|
overridevirtual |
Only methods on theme may be called from this method by default.
To make arbitrary RenderDevice calls, wrap them in GuiTheme::pauseRendering ... GuiTheme::resumeRendering.
Reimplemented from G3D::GuiTextBox.
|
protectedinherited |
|
virtualinherited |
Reimplemented in G3D::GuiNumberBox< Value >, G3D::GuiNumberBox< float >, G3D::GuiNumberBox< int >, G3D::GuiTextureBox, and G3D::GuiPane.
Referenced by G3D::GuiNumberBox< int >::setCaption().
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
Reimplemented in G3D::GuiNumberBox< Value >, G3D::GuiNumberBox< float >, G3D::GuiNumberBox< int >, and G3D::GuiFrameBox.
Referenced by G3D::GuiNumberBox< int >::setEnabled().
|
inlineinherited |
|
inherited |
Grab or release keyboard focus.
|
inherited |
|
inherited |
|
inherited |
|
overridevirtualinherited |
If you explicitly change the rectangle of a control, the containing pane may clip its borders.
Call pack() on the containing pane (or window) to resize that container appropriately.
Reimplemented from G3D::GuiControl.
Referenced by G3D::GuiNumberBox< int >::setRect().
|
protectedinherited |
Called from onEvent when a key is pressed.
|
inherited |
Referenced by G3D::GuiPane::addRadioButton().
|
inherited |
|
inherited |
|
inherited |
|
protectedinherited |
|
inherited |
|
inlinevirtualinherited |
Return true if this is in tool button style.
Reimplemented in G3D::GuiRadioButton, G3D::GuiButton, and G3D::GuiCheckBox.
Returns the coordinates of v, which is in the coordinate system of this object, relative to the OSWindow on which it will be rendered.
Referenced by G3D::GuiControl::toOSWindowCoords().
|
protectedinherited |
Called from onEvent when the repeat key is released.
|
inherited |
|
inherited |
Get the window containing this control.
|
protectedinherited |
Referenced by G3D::GuiNumberBox< int >::render().
|
protectedinherited |
|
protectedinherited |
Referenced by G3D::GuiNumberBox< int >::setRect().
|
protectedinherited |
|
protectedinherited |
String to be used as the cursor character.
|
protectedinherited |
Character position in m_userValue of the cursor.
|
protectedinherited |
True if currently being edited, that is, if the user has changed the string more recently than the program has changed it.
|
protectedinherited |
|
protectedinherited |
Sent events should appear to be from this object, which is usually "this".
Other controls can set the event source to create compound controls that seem atomic from the outside.
Referenced by G3D::GuiSlider< int >::GuiSlider(), G3D::GuiNumberBox< Value >::MyTextBox::MyTextBox(), and G3D::GuiControl::setEventSource().
|
protectedinherited |
The window that ultimately contains this control.
|
protectedinherited |
True if currently highlighting text with mouse button down.
|
protectedinherited |
Character position of the highlight start position.
-1 when not highlighting.
|
protectedinherited |
Time at which setRepeatKeysym was called.
|
protectedinherited |
Time at which the key will repeat (if down).
|
protectedinherited |
Original value before the user started editing.
This is used to detect changes in m_value while the user is editing.
|
protectedinherited |
Parent pane.
|
protectedinherited |
Rect bounds used for rendering and layout.
Relative to the enclosing pane's clientRect.
Referenced by G3D::GuiControl::findControlUnderMouse(), G3D::GuiNumberBox< int >::render(), G3D::GuiNumberBox< int >::setCaption(), and G3D::GuiNumberBox< int >::setRect().
|
protectedinherited |
Key that is currently auto-repeating.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
The value currently being set by the user.
When in IMMEDIATE_UPDATE mode, this is continually synchronized with m_value.
The string that this box is associated with.
This may be out of date if editing and in DELAYED_UPDATE mode.
|
protectedinherited |