| OGRE 1.11.1 Object-Oriented Graphics Rendering Engine

Public Member Functions | Static Public Member Functions | List of all members
OgreBites::SelectMenu Class Reference

Basic selection menu widget. More...

`#include <OgreTrays.h>`

Inheritance diagram for OgreBites::SelectMenu:
[legend]

## Public Member Functions
| SelectMenu (const Ogre::String &name, const Ogre::DisplayString &caption, Ogre::Real width, Ogre::Real boxWidth, size_t maxItemsShown)
| Do not instantiate any widgets directly. Use TrayManager. More...
void | _assignListener (TrayListener *listener)
void | _assignToTray (TrayLocation trayLoc)
void | _cursorMoved (const Ogre::Vector2 &cursorPos, float wheelDelta)
void | _cursorPressed (const Ogre::Vector2 &cursorPos)
void | _cursorReleased (const Ogre::Vector2 &cursorPos)
void | _focusLost ()
void | addItem (const Ogre::DisplayString &item)
void | cleanup ()
void | clearItems ()
bool | containsItem (const Ogre::DisplayString &item)
void | copyItemsFrom (SelectMenu *other)
const Ogre::DisplayString & | getCaption ()
const Ogre::StringVector & | getItems ()
const Ogre::String & | getName ()
size_t | getNumItems ()
Ogre::OverlayElement * | getOverlayElement ()
Ogre::DisplayString | getSelectedItem ()
int | getSelectionIndex ()
TrayLocation | getTrayLocation ()
void | hide ()
void | insertItem (size_t index, const Ogre::DisplayString &item)
bool | isExpanded ()
bool | isVisible ()
void | removeItem (const Ogre::DisplayString &item)
void | removeItem (size_t index)
void | selectItem (size_t index, bool notifyListener=true)
void | selectItem (const Ogre::DisplayString &item, bool notifyListener=true)
void | setCaption (const Ogre::DisplayString &caption)
void | setItems (const Ogre::StringVector &items)
void | show ()

## Static Public Member Functions
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. More...
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. More...
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. More...
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. More...
static void | nukeOverlayElement (Ogre::OverlayElement *element)
| Static utility method to recursively delete an overlay element plus all of its children from the system. More...

## Detailed Description

Basic selection menu widget.

## Constructor & Destructor Documentation

## ◆ SelectMenu()

OgreBites::SelectMenu::SelectMenu | ( | const Ogre::String & | name,
|  | const Ogre::DisplayString & | caption,
|  | Ogre::Real | width,
|  | Ogre::Real | boxWidth,
|  | size_t | maxItemsShown
| ) |  |

Do not instantiate any widgets directly. Use TrayManager.

## Member Function Documentation

## ◆ copyItemsFrom()

void OgreBites::SelectMenu::copyItemsFrom | ( | SelectMenu * | other | ) |

## ◆ isExpanded()

bool OgreBites::SelectMenu::isExpanded | ( |  | ) |
| inline

## ◆ getCaption()

const Ogre::DisplayString& OgreBites::SelectMenu::getCaption | ( |  | ) |
| inline

## ◆ setCaption()

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

## ◆ getItems()

const Ogre::StringVector& OgreBites::SelectMenu::getItems | ( |  | ) |
| inline

## ◆ getNumItems()

size_t OgreBites::SelectMenu::getNumItems | ( |  | ) |
| inline

## ◆ setItems()

void OgreBites::SelectMenu::setItems | ( | const Ogre::StringVector & | items | ) |

## ◆ addItem()

void OgreBites::SelectMenu::addItem | ( | const Ogre::DisplayString & | item | ) |
| inline

## ◆ insertItem()

void OgreBites::SelectMenu::insertItem | ( | size_t | index,
|  | const Ogre::DisplayString & | item
| ) |  |
| inline

## ◆ removeItem() [1/2]

void OgreBites::SelectMenu::removeItem | ( | const Ogre::DisplayString & | item | ) |

## ◆ removeItem() [2/2]

void OgreBites::SelectMenu::removeItem | ( | size_t | index | ) |

## ◆ clearItems()

void OgreBites::SelectMenu::clearItems | ( |  | ) |

## ◆ selectItem() [1/2]

void OgreBites::SelectMenu::selectItem | ( | size_t | index,
|  | bool | notifyListener = `true`
| ) |  |

## ◆ containsItem()

bool OgreBites::SelectMenu::containsItem | ( | const Ogre::DisplayString & | item | ) |

## ◆ selectItem() [2/2]

void OgreBites::SelectMenu::selectItem | ( | const Ogre::DisplayString & | item,
|  | bool | notifyListener = `true`
| ) |  |

## ◆ getSelectedItem()

Ogre::DisplayString OgreBites::SelectMenu::getSelectedItem | ( |  | ) |

## ◆ getSelectionIndex()

int OgreBites::SelectMenu::getSelectionIndex | ( |  | ) |
| inline

## ◆ _cursorPressed()

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

Reimplemented from OgreBites::Widget.

## ◆ _cursorReleased()

void OgreBites::SelectMenu::_cursorReleased | ( | const Ogre::Vector2 & | cursorPos | ) |
| inline virtual

Reimplemented from OgreBites::Widget.

## ◆ _cursorMoved()

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

Reimplemented from OgreBites::Widget.

## ◆ _focusLost()

void OgreBites::SelectMenu::_focusLost | ( |  | ) |
| inline virtual

Reimplemented from OgreBites::Widget.

## ◆ cleanup()

void OgreBites::Widget::cleanup | ( |  | ) |
| inherited

## ◆ nukeOverlayElement()

static void OgreBites::Widget::nukeOverlayElement | ( | Ogre::OverlayElement * | element | ) |
| static inherited

Static utility method to recursively delete an overlay element plus all of its children from the system.

## ◆ isCursorOver()

static bool OgreBites::Widget::isCursorOver | ( | Ogre::OverlayElement * | element,
|  | const Ogre::Vector2 & | cursorPos,
|  | Ogre::Real | voidBorder = `0`
| ) |  |
| static inherited

Static utility method to check if the cursor is over an overlay element.

## ◆ cursorOffset()

static Ogre::Vector2 OgreBites::Widget::cursorOffset | ( | Ogre::OverlayElement * | element,
|  | const Ogre::Vector2 & | cursorPos
| ) |  |
| static inherited

Static utility method used to get the cursor's offset from the center of an overlay element in pixels.

## ◆ getCaptionWidth()

static Ogre::Real OgreBites::Widget::getCaptionWidth | ( | const Ogre::DisplayString & | caption,
|  | Ogre::TextAreaOverlayElement * | area
| ) |  |
| static inherited

Static utility method used to get the width of a caption in a text area.

## ◆ fitCaptionToArea()

static void OgreBites::Widget::fitCaptionToArea | ( | const Ogre::DisplayString & | caption,
|  | Ogre::TextAreaOverlayElement * | area,
|  | Ogre::Real | maxWidth
| ) |  |
| static inherited

Static utility method to cut off a string to fit in a text area.

## ◆ getOverlayElement()

Ogre::OverlayElement* OgreBites::Widget::getOverlayElement | ( |  | ) |
| inline inherited

## ◆ getName()

const Ogre::String& OgreBites::Widget::getName | ( | void |  | ) |
| inline inherited

## ◆ getTrayLocation()

TrayLocation OgreBites::Widget::getTrayLocation | ( |  | ) |
| inline inherited

## ◆ hide()

void OgreBites::Widget::hide | ( |  | ) |
| inline inherited

## ◆ show()

void OgreBites::Widget::show | ( |  | ) |
| inline inherited

## ◆ isVisible()

bool OgreBites::Widget::isVisible | ( | void |  | ) |
| inline inherited

## ◆ _assignToTray()

void OgreBites::Widget::_assignToTray | ( | TrayLocation | trayLoc | ) |
| inline inherited

## ◆ _assignListener()

void OgreBites::Widget::_assignListener | ( | TrayListener * | listener | ) |
| inline inherited

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

- OgreTrays.h