Public Member Functions |
bool | isHovering (void) const |
| return true if user is hovering over this widget (or it's pushed and user is not over it for highlight)
|
bool | isPushed (void) const |
| Return true if the button widget is in the pushed state.
|
bool | isOpened (void) const |
| Returns true if the popup menu attached to the menu item is open.
|
bool | isPopupClosing (void) const |
| Returns true if the menu item popup is closing or not.
|
bool | hasAutoPopup (void) const |
| Returns true if the menu item popup is closed or opened automatically if hovering with the mouse.
|
float | getAutoPopupTimeout (void) const |
| Returns the time, which has to elapse before the popup window is opened/closed if the hovering state changes.
|
void | setAutoPopupTimeout (float time) |
| Sets the time, which has to elapse before the popup window is opened/closed if the hovering state changes.
|
PopupMenu * | getPopupMenu (void) const |
| Get the PopupMenu that is currently attached to this MenuItem.
|
const UVector2 & | getPopupOffset (void) const |
| Returns the current offset for popup placement.
|
void | setPopupOffset (const UVector2 &popupOffset) |
| sets the current offset for popup placement.
|
void | setPopupMenu (PopupMenu *popup) |
| Set the popup menu for this item.
|
void | openPopupMenu (bool notify=true) |
| Opens the PopupMenu.
|
void | closePopupMenu (bool notify=true) |
| Closes the PopupMenu.
|
bool | togglePopupMenu (void) |
| Toggles the PopupMenu.
|
void | startPopupClosing (void) |
| starts the closing timer for the popup, which will close it if the timer is enabled.
|
void | startPopupOpening (void) |
| starts the opening timer for the popup, which will open it if the timer is enabled.
|
| MenuItem (const String &type, const String &name) |
| Constructor for MenuItem objects.
|
virtual | ~MenuItem (void) |
| Destructor for MenuItem objects.
|
Static Public Attributes |
static const String | EventNamespace |
| Namespace for global events.
|
static const String | WidgetTypeName |
| Window factory name.
|
static const String | EventClicked |
Protected Member Functions |
virtual void | onClicked (WindowEventArgs &e) |
| handler invoked internally when the MenuItem is clicked.
|
virtual void | onMouseMove (MouseEventArgs &e) |
| Handler called when the mouse cursor has been moved within this window's area.
|
virtual void | onMouseButtonDown (MouseEventArgs &e) |
| Handler called when a mouse button has been depressed within this window's area.
|
virtual void | onMouseButtonUp (MouseEventArgs &e) |
| Handler called when a mouse button has been released within this window's area.
|
virtual void | onCaptureLost (WindowEventArgs &e) |
| Handler called when this window loses capture of mouse inputs.
|
virtual void | onMouseLeaves (MouseEventArgs &e) |
| Handler called when the mouse cursor is no longer over this window's surface area. This will be called when the mouse is not over a part of this Window's actual surface - even though technically the mouse is still within the Window's area, for example if the mouse moves over a child window.
|
virtual void | onTextChanged (WindowEventArgs &e) |
| Handler called when the window's text is changed.
|
virtual void | updateSelf (float elapsed) |
| Perform actual update processing for this Window.
|
void | updateInternalState (const Vector2f &mouse_pos) |
| Update the internal state of the widget with the mouse at the given position.
|
void | closeAllMenuItemPopups () |
| Recursive function that closes all popups down the hierarcy starting with this one.
|
void | setPopupMenu_impl (PopupMenu *popup, bool add_as_child=true) |
| Set the popup menu for this item.
|
Protected Attributes |
bool | d_pushed |
| true when widget is pushed
|
bool | d_hovering |
| true when the button is in 'hover' state and requires the hover rendering.
|
bool | d_opened |
| true when the menu item's popup menu is in its opened state.
|
bool | d_popupClosing |
| true when the d_popupTimerTimeElapsed timer is running to close the popup (another menu item of our container is hovered)
|
bool | d_popupOpening |
| true when the d_popupTimerTimeElapsed timer is running to open the popup (the menu item is hovered)
|
float | d_autoPopupTimeout |
| the time in seconds, to wait before opening / closing the popup if the mouse is over the item / over another item in our container
|
float | d_autoPopupTimeElapsed |
| the current time, which is already elapsed if the timer is running (d_popupClosing or d_popupOpening is true)
|
PopupMenu * | d_popup |
| PopupMenu that this item displays when activated.
|
bool | d_popupWasClosed |
| Used internally to determine if a popup was just closed on a Clicked event.
|
UVector2 | d_popupOffset |
| current offset for popup placement.
|
Base class for menu items.