Loading...
Searching...
No Matches
OgreBites::TextBox Class Reference
Optional Components » Bites » Trays

Scrollable text box widget. More...

`#include <OgreTrays.h>`

Inheritance diagram for OgreBites::TextBox:
[legend]

## Public Member Functions

| TextBox (const Ogre::String &name, const Ogre::DisplayString &caption, Ogre::Real width, Ogre::Real height)
| Do not instantiate any widgets directly. Use TrayManager.
void | _cursorMoved (const Ogre::Vector2 &cursorPos, float wheelDelta) override
void | _cursorPressed (const Ogre::Vector2 &cursorPos) override
void | _cursorReleased (const Ogre::Vector2 &cursorPos) override
void | _focusLost () override
void | appendText (const Ogre::DisplayString &text)
void | clearText ()
const Ogre::DisplayString & | getCaption ()
unsigned int | getHeightInLines ()
| Gets how many lines of text can fit in this window.
Ogre::Real | getPadding ()
Ogre::Real | getScrollPercentage ()
| Gets how far scrolled down the text is as a percentage.
const Ogre::DisplayString & | getText ()
void | refitContents ()
| Makes adjustments based on new padding, size, or alignment info.
void | setCaption (const Ogre::DisplayString &caption)
void | setPadding (Ogre::Real padding)
void | setScrollPercentage (Ogre::Real percentage)
| Sets how far scrolled down the text is as a percentage.
void | setText (const Ogre::DisplayString &text)
| Sets text box content.
void | setTextAlignment (Ogre::TextAreaOverlayElement::Alignment ta)
| Sets text box content horizontal alignment.
Public Member Functions inherited from OgreBites::Widget
| Widget ()
virtual | ~Widget ()
void | _assignListener (TrayListener *listener)
void | _assignToTray (TrayLocation trayLoc)
void | cleanup ()
const Ogre::String & | getName ()
Ogre::OverlayElement * | getOverlayElement ()
TrayLocation | getTrayLocation ()
void | hide ()
bool | isVisible ()
void | show ()

## Additional Inherited Members

Static Public Member Functions inherited from OgreBites::Widget
static Ogre::Vector2 | cursorOffset (Ogre::OverlayElement *element, const Ogre::Vector2 &cursorPos)
| Static utility method used to get the cursor's offset from the center of an overlay element in pixels.
static void | fitCaptionToArea (const Ogre::DisplayString &caption, Ogre::TextAreaOverlayElement *area, Ogre::Real maxWidth)
| Static utility method to cut off a string to fit in a text area.
static Ogre::Real | getCaptionWidth (const Ogre::DisplayString &caption, Ogre::TextAreaOverlayElement *area)
| Static utility method used to get the width of a caption in a text area.
static bool | isCursorOver (Ogre::OverlayElement *element, const Ogre::Vector2 &cursorPos, Ogre::Real voidBorder=0)
| Static utility method to check if the cursor is over an overlay element.
static void | nukeOverlayElement (Ogre::OverlayElement *element)
| Static utility method to recursively delete an overlay element plus all of its children from the system.

## Detailed Description

Scrollable text box widget.

## Constructor & Destructor Documentation

## TextBox()

OgreBites::TextBox::TextBox | ( | const Ogre::String & | name,
|  | const Ogre::DisplayString & | caption,
|  | Ogre::Real | width,
|  | Ogre::Real | height )

Do not instantiate any widgets directly. Use TrayManager.

## Member Function Documentation

## setPadding()

void OgreBites::TextBox::setPadding | ( | Ogre::Real | padding | ) |

## getPadding()

Ogre::Real OgreBites::TextBox::getPadding | ( |  | ) |

inline

## getCaption()

const Ogre::DisplayString & OgreBites::TextBox::getCaption | ( |  | ) |

inline

## setCaption()

void OgreBites::TextBox::setCaption | ( | const Ogre::DisplayString & | caption | ) |

inline

## getText()

const Ogre::DisplayString & OgreBites::TextBox::getText | ( |  | ) |

inline

Referenced by appendText().

## setText()

void OgreBites::TextBox::setText | ( | const Ogre::DisplayString & | text | ) |

Sets text box content.

Most of this method is for wordwrap.

Referenced by appendText(), and clearText().

## setTextAlignment()

void OgreBites::TextBox::setTextAlignment | ( | Ogre::TextAreaOverlayElement::Alignment | ta | ) |

Sets text box content horizontal alignment.

## clearText()

void OgreBites::TextBox::clearText | ( |  | ) |

inline

References setText().

## appendText()

void OgreBites::TextBox::appendText | ( | const Ogre::DisplayString & | text | ) |

inline

References getText(), and setText().

## refitContents()

void OgreBites::TextBox::refitContents | ( |  | ) |

Makes adjustments based on new padding, size, or alignment info.

## setScrollPercentage()

void OgreBites::TextBox::setScrollPercentage | ( | Ogre::Real | percentage | ) |

Sets how far scrolled down the text is as a percentage.

## getScrollPercentage()

Ogre::Real OgreBites::TextBox::getScrollPercentage | ( |  | ) |

inline

Gets how far scrolled down the text is as a percentage.

## getHeightInLines()

unsigned int OgreBites::TextBox::getHeightInLines | ( |  | ) |

inline

Gets how many lines of text can fit in this window.

## _cursorPressed()

void OgreBites::TextBox::_cursorPressed | ( | const Ogre::Vector2 & | cursorPos | ) |

override virtual

Reimplemented from OgreBites::Widget.

## _cursorReleased()

void OgreBites::TextBox::_cursorReleased | ( | const Ogre::Vector2 & | cursorPos | ) |

inline override virtual

Reimplemented from OgreBites::Widget.

## _cursorMoved()

void OgreBites::TextBox::_cursorMoved | ( | const Ogre::Vector2 & | cursorPos,
|  | float | wheelDelta )

override virtual

Reimplemented from OgreBites::Widget.

## _focusLost()

void OgreBites::TextBox::_focusLost | ( |  | ) |

inline override virtual

Reimplemented from OgreBites::Widget.

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

- OgreTrays.h