|
wavelength 1.0.0
|
Mover of a panel's focus between its components with the directional buttons. More...
#include <uinavigator.h>


Public Types | |
| enum | Axis { kAxisHorizontal = 0 , kAxisVertical = 1 } |
| The direction of a list, the values FindFocus() takes. More... | |
Public Member Functions | |
| UINavigator (DataArray *pData, UIPanel *pPanel) | |
| Construct a navigator from its script description. | |
| ~UINavigator () override | |
| Destroy the navigator. | |
| bool | DispatchPriv (Message *pMsg) override |
| Move the focus for a directional button, and follow the focus and the choices of the panel. | |
| int | FindFocus (int nAxis) |
| Find the focused component in the lists of a direction. | |
| bool | HandleJoypad (JoypadInputMsg *pMsg) |
| Move the focus for a pressed directional button. | |
| bool | HandleFocusChange (UIComponentFocusChangeMsg *pMsg) |
| Show the newly focused component of each list in the selected state. | |
| bool | HandleSelectStart (UIComponentSelectStartMsg *pMsg) |
| Stop moving the focus while a component is being chosen. | |
| bool | HandleSelect (UIComponentSelectMsg *pMsg) |
| Move the focus again once a component has been chosen. | |
| void | Highlight (UIComponent *pFocus, std::vector< UIComponent * > &row) |
| Show the focused component of a list in the selected state and the others in the normal state. | |
| void | Step (bool bForward, int nButton, int nIndex) |
| Move the focus along mRow to the next component that is enabled and showing. | |
| void | SetEnabled (int nEnabled) |
| Public Member Functions inherited from MsgSink | |
| void * | operator new (size_t nSize) |
| Allocate a sink from the pool heaps under the tag "MsgSink". | |
| void | operator delete (void *pBlock) |
| Return a sink to the pool heaps. | |
| virtual | ~MsgSink () |
| virtual bool | Dispatch (Message *pMsg) |
| Accept a message. | |
| void * | operator new (size_t size) |
| Allocate from the main heap under the name MsgSink. | |
| void | operator delete (void *mem) |
| Return memory to its heap. | |
| virtual | ~MsgSink () |
| Destroy the sink. | |
| virtual bool | Dispatch (Message *msg) |
| Handle a message. | |
Mover of a panel's focus between its components with the directional buttons.
The RTTI records the class as deriving from MsgSink. The object is 0x34 bytes. A panel creates one from the navigator array of its description. Each entry of the array is a horizontal or a vertical list of component names. Left and right move the focus along the horizontal list that holds the focused component, and up and down along the vertical one. A disabled or hidden component is passed over, and the focus wraps at the ends of a list.
The navigator also shows the focused component of each list in the selected state and the others in the normal state. It stops moving the focus while a component is being chosen.
| enum UINavigator::Axis |
The direction of a list, the values FindFocus() takes.
| Enumerator | |
|---|---|
| kAxisHorizontal | A list left and right move along. |
| kAxisVertical | A list up and down move along. |
Construct a navigator from its script description.
| pData | The navigator array. Each entry from index 1 is a list. |
| pPanel | The panel whose focus the navigator moves. |
|
override |
Destroy the navigator.
|
overridevirtual |
Move the focus for a directional button, and follow the focus and the choices of the panel.
| pMsg | The message. |
Implements MsgSink.
| int UINavigator::FindFocus | ( | int | nAxis | ) |
Find the focused component in the lists of a direction.
The list that holds the component becomes mRow.
| nAxis | One of Axis. |
| bool UINavigator::HandleJoypad | ( | JoypadInputMsg * | pMsg | ) |
Move the focus for a pressed directional button.
| pMsg | The message of the button. |
| bool UINavigator::HandleFocusChange | ( | UIComponentFocusChangeMsg * | pMsg | ) |
Show the newly focused component of each list in the selected state.
| pMsg | The message of the focus change. |
| bool UINavigator::HandleSelectStart | ( | UIComponentSelectStartMsg * | pMsg | ) |
Stop moving the focus while a component is being chosen.
| pMsg | The message. The routine ignores it. |
| bool UINavigator::HandleSelect | ( | UIComponentSelectMsg * | pMsg | ) |
Move the focus again once a component has been chosen.
| pMsg | The message. The routine ignores it. |
| void UINavigator::Highlight | ( | UIComponent * | pFocus, |
| std::vector< UIComponent * > & | row ) |
Show the focused component of a list in the selected state and the others in the normal state.
A disabled component keeps its state.
| pFocus | The focused component, or null. |
| row | The list. |
| void UINavigator::Step | ( | bool | bForward, |
| int | nButton, | ||
| int | nIndex ) |
Move the focus along mRow to the next component that is enabled and showing.
| bForward | Move towards the end of the list rather than towards its start. |
| nButton | The controller button that moves the focus. |
| nIndex | The index of the focused component in mRow, or -1 to do nothing. |
|
inline |
| nEnabled | Whether the directional buttons move the focus. |