wavelength 1.0.0
Loading...
Searching...
No Matches
UINavigator Class Reference

Mover of a panel's focus between its components with the directional buttons. More...

#include <uinavigator.h>

Inheritance diagram for UINavigator:
Collaboration diagram for UINavigator:

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.

Detailed Description

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.

Member Enumeration Documentation

◆ 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.

Constructor & Destructor Documentation

◆ UINavigator()

UINavigator::UINavigator ( DataArray * pData,
UIPanel * pPanel )

Construct a navigator from its script description.

Parameters
pDataThe navigator array. Each entry from index 1 is a list.
pPanelThe panel whose focus the navigator moves.
Ghidra address:
NTSC-U/C: 0x0020ea20
Ghidra address:
PAL: 0x00217838

◆ ~UINavigator()

UINavigator::~UINavigator ( )
override

Destroy the navigator.

Ghidra address:
NTSC-U/C: 0x0020f3e8
Ghidra address:
PAL: 0x00218200

Member Function Documentation

◆ DispatchPriv()

bool UINavigator::DispatchPriv ( Message * pMsg)
overridevirtual

Move the focus for a directional button, and follow the focus and the choices of the panel.

Parameters
pMsgThe message.
Returns
False, for every message.
Ghidra address:
NTSC-U/C: 0x0020f5d0
Ghidra address:
PAL: 0x002183e8

Implements MsgSink.

◆ FindFocus()

int UINavigator::FindFocus ( int nAxis)

Find the focused component in the lists of a direction.

The list that holds the component becomes mRow.

Parameters
nAxisOne of Axis.
Returns
The index of the focused component in its list, or -1 when no list of the direction holds it.
Ghidra address:
NTSC-U/C: 0x0020f6a8
Ghidra address:
PAL: 0x002184c0

◆ HandleJoypad()

bool UINavigator::HandleJoypad ( JoypadInputMsg * pMsg)

Move the focus for a pressed directional button.

Parameters
pMsgThe message of the button.
Returns
False.
Ghidra address:
NTSC-U/C: 0x0020f790
Ghidra address:
PAL: 0x002185a8

◆ HandleFocusChange()

bool UINavigator::HandleFocusChange ( UIComponentFocusChangeMsg * pMsg)

Show the newly focused component of each list in the selected state.

Parameters
pMsgThe message of the focus change.
Returns
False.
Ghidra address:
NTSC-U/C: 0x0020f870
Ghidra address:
PAL: 0x00218688

◆ HandleSelectStart()

bool UINavigator::HandleSelectStart ( UIComponentSelectStartMsg * pMsg)

Stop moving the focus while a component is being chosen.

Parameters
pMsgThe message. The routine ignores it.
Returns
False.
Ghidra address:
NTSC-U/C: 0x0020f968
Ghidra address:
PAL: 0x00218780

◆ HandleSelect()

bool UINavigator::HandleSelect ( UIComponentSelectMsg * pMsg)

Move the focus again once a component has been chosen.

Parameters
pMsgThe message. The routine ignores it.
Returns
False.
Ghidra address:
NTSC-U/C: 0x0020f978
Ghidra address:
PAL: 0x00218790

◆ Highlight()

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.

Parameters
pFocusThe focused component, or null.
rowThe list.
Ghidra address:
NTSC-U/C: 0x0020f988
Ghidra address:
PAL: 0x002187a0

◆ Step()

void UINavigator::Step ( bool bForward,
int nButton,
int nIndex )

Move the focus along mRow to the next component that is enabled and showing.

Parameters
bForwardMove towards the end of the list rather than towards its start.
nButtonThe controller button that moves the focus.
nIndexThe index of the focused component in mRow, or -1 to do nothing.
Ghidra address:
NTSC-U/C: 0x0020fa50
Ghidra address:
PAL: 0x00218868

◆ SetEnabled()

void UINavigator::SetEnabled ( int nEnabled)
inline
Parameters
nEnabledWhether the directional buttons move the focus.

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