PixelLightAPI
.
|
Abstract base class for widgets that display a menu. More...
#include <AbstractMenu.h>
Classes | |
struct | SItem |
Position and state data for a menu item. More... | |
Protected Member Functions | |
virtual PLGUI_API void | OnItemClicked (MenuItem *pItem) |
Called when a menu item has been clicked. | |
virtual PLGUI_API PLMath::Vector2i | OnPreferredSize (const PLMath::Vector2i &vRefSize) const override |
Called when the widget is to calculate it's preferred size. | |
virtual PLGUI_API void | OnMouseMove (const PLMath::Vector2i &vPos) override |
Called when the mouse is moved within the widget or captured by it. | |
virtual PLGUI_API void | OnMouseButtonDown (PLCore::uint32 nButton, const PLMath::Vector2i &vPos) override |
Called when a mouse button is pressed. | |
virtual PLGUI_API void | OnMouseButtonUp (PLCore::uint32 nButton, const PLMath::Vector2i &vPos) override |
Called when a mouse button is released. | |
virtual PLGUI_API void | OnKeyDown (PLCore::uint32 nKey, PLCore::uint32 nModifiers) override |
Called when a key was pressed. | |
virtual PLGUI_API void | OnGetFocus () override |
Called when the widget gets the keyboard focus. | |
virtual PLGUI_API void | OnLooseFocus () override |
Called when the widget looses the keyboard focus. | |
PLGUI_API void | OpenSubmenu (MenuItem *pItem, int nItem) |
Open submenu. | |
PLGUI_API void | CloseSubmenu () |
Close submenu. | |
PLGUI_API void | PressShortcut (char nShortcut) |
Activate menu shortcut. | |
PLGUI_API void | UpdateMenuData () |
Update menu data. | |
PLGUI_API void | DeleteMenuData () |
Delete menu data. | |
PLGUI_API int | GetItemFromMousePos (const PLMath::Vector2i &vPos) |
Check which item is selected based on mouse position. | |
PLGUI_API void | SetControlledMenu (AbstractMenu *pMenu) |
Set currently active menu in the chain of sub-menus. | |
PLGUI_API PLMath::Vector2i | CalculateItemSize (EOrientation nOrientation, MenuItem *pItem) |
Calculate size of menu item. | |
Protected Attributes | |
Menu * | m_pMenu |
EOrientation | m_nOrientation |
ESide | m_nOpenSideHorizontal |
ESide | m_nOpenSideVertical |
int | m_nSelection |
SItem * | m_pItems |
int | m_nItems |
int | m_nSize |
int | m_nMaxWidth |
int | m_nMouseOver |
MenuItem * | m_pSelectedItem |
PopupMenu * | m_pPopupMenu |
int | m_nIgnoreMouse |
AbstractMenu * | m_pParentMenu |
AbstractMenu * | m_pController |
AbstractMenu * | m_pControlMenu |
bool | m_bAllowButtonUp |
Abstract base class for widgets that display a menu.
virtual PLGUI_API void PLGui::AbstractMenu::OnItemClicked | ( | MenuItem * | pItem | ) | [protected, virtual] |
Called when a menu item has been clicked.
[in] | pItem | Menu item |
virtual PLGUI_API PLMath::Vector2i PLGui::AbstractMenu::OnPreferredSize | ( | const PLMath::Vector2i & | vRefSize | ) | const [override, protected, virtual] |
Called when the widget is to calculate it's preferred size.
[in] | vRefSize | Precalculated reference size, can be (-1, -1) if no reference size is available |
Reimplemented from PLGui::Widget.
Reimplemented in PLGui::MenuBar.
virtual PLGUI_API void PLGui::AbstractMenu::OnMouseMove | ( | const PLMath::Vector2i & | vPos | ) | [override, protected, virtual] |
Called when the mouse is moved within the widget or captured by it.
[in] | vPos | Mouse position within the widget |
Reimplemented from PLGui::WidgetFunctions.
virtual PLGUI_API void PLGui::AbstractMenu::OnMouseButtonDown | ( | PLCore::uint32 | nButton, |
const PLMath::Vector2i & | vPos | ||
) | [override, protected, virtual] |
Called when a mouse button is pressed.
[in] | nButton | Mouse button that is pressed |
[in] | vPos | Mouse position within the widget |
Reimplemented from PLGui::WidgetFunctions.
virtual PLGUI_API void PLGui::AbstractMenu::OnMouseButtonUp | ( | PLCore::uint32 | nButton, |
const PLMath::Vector2i & | vPos | ||
) | [override, protected, virtual] |
Called when a mouse button is released.
[in] | nButton | Mouse button that is released |
[in] | vPos | Mouse position within the widget |
Reimplemented from PLGui::WidgetFunctions.
virtual PLGUI_API void PLGui::AbstractMenu::OnKeyDown | ( | PLCore::uint32 | nKey, |
PLCore::uint32 | nModifiers | ||
) | [override, protected, virtual] |
Called when a key was pressed.
[in] | nKey | Pressed key |
[in] | nModifiers | Modifier keys pressed |
Reimplemented from PLGui::WidgetFunctions.
virtual PLGUI_API void PLGui::AbstractMenu::OnGetFocus | ( | ) | [override, protected, virtual] |
Called when the widget gets the keyboard focus.
Reimplemented from PLGui::WidgetFunctions.
virtual PLGUI_API void PLGui::AbstractMenu::OnLooseFocus | ( | ) | [override, protected, virtual] |
Called when the widget looses the keyboard focus.
Reimplemented from PLGui::WidgetFunctions.
PLGUI_API void PLGui::AbstractMenu::OpenSubmenu | ( | MenuItem * | pItem, |
int | nItem | ||
) | [protected] |
PLGUI_API void PLGui::AbstractMenu::CloseSubmenu | ( | ) | [protected] |
Close submenu.
PLGUI_API void PLGui::AbstractMenu::PressShortcut | ( | char | nShortcut | ) | [protected] |
Activate menu shortcut.
[in] | nShortcut | ASCII value of shortcut |
PLGUI_API void PLGui::AbstractMenu::UpdateMenuData | ( | ) | [protected] |
Update menu data.
PLGUI_API void PLGui::AbstractMenu::DeleteMenuData | ( | ) | [protected] |
Delete menu data.
PLGUI_API int PLGui::AbstractMenu::GetItemFromMousePos | ( | const PLMath::Vector2i & | vPos | ) | [protected] |
Check which item is selected based on mouse position.
[in] | vPos | Current mouse position |
PLGUI_API void PLGui::AbstractMenu::SetControlledMenu | ( | AbstractMenu * | pMenu | ) | [protected] |
Set currently active menu in the chain of sub-menus.
[in] | pMenu | Menu that shall be controlled by the keyboard |
PLGUI_API PLMath::Vector2i PLGui::AbstractMenu::CalculateItemSize | ( | EOrientation | nOrientation, |
MenuItem * | pItem | ||
) | [protected] |
Calculate size of menu item.
[in] | nOrientation | Orientation |
[in] | pItem | Menu item |
Menu* PLGui::AbstractMenu::m_pMenu [protected] |
Menu that is displayed
EOrientation PLGui::AbstractMenu::m_nOrientation [protected] |
Menu orientation
ESide PLGui::AbstractMenu::m_nOpenSideHorizontal [protected] |
Side on which a submenu is opened (horizontal)
ESide PLGui::AbstractMenu::m_nOpenSideVertical [protected] |
Side on which a submenu is opened (vertical)
int PLGui::AbstractMenu::m_nSelection [protected] |
Currently selected item
SItem* PLGui::AbstractMenu::m_pItems [protected] |
Items
int PLGui::AbstractMenu::m_nItems [protected] |
Size of m_pItems
int PLGui::AbstractMenu::m_nSize [protected] |
Size of all items
int PLGui::AbstractMenu::m_nMaxWidth [protected] |
Max width of all items
int PLGui::AbstractMenu::m_nMouseOver [protected] |
Index of currently selected item
MenuItem* PLGui::AbstractMenu::m_pSelectedItem [protected] |
Currently open item
PopupMenu* PLGui::AbstractMenu::m_pPopupMenu [protected] |
Currently open submenu
int PLGui::AbstractMenu::m_nIgnoreMouse [protected] |
Ignore mouse-move events for n times
AbstractMenu* PLGui::AbstractMenu::m_pParentMenu [protected] |
Menu widget that has opened this menu widget
AbstractMenu* PLGui::AbstractMenu::m_pController [protected] |
Menu widget that has the control (focus)
AbstractMenu* PLGui::AbstractMenu::m_pControlMenu [protected] |
Menu that is currently controlled by the keyboard
bool PLGui::AbstractMenu::m_bAllowButtonUp [protected] |
Only right after popup, the release of the mouse button can cause a click-event
|