|
wavelength 1.0.0
|
Component that shows a scrolling window of rows over a longer list of items. More...
#include <uilist.h>


Classes | |
| struct | Cell |
| One cell of a row. More... | |
Public Member Functions | |
| UIList (DataArray *pData, const char *pszPanel) | |
| Construct a list from its script description, cloning the template row once for each row. | |
| ~UIList () override | |
| Destroy the row clones and every object cloned with them. | |
| bool | DispatchPriv (Message *pMsg) override |
| Pass a controller button to HandleJoypad(). | |
| void | Print (PrnStream &stream) override |
| Write a description of the list. | |
| virtual void | UpdateRow (int nRow, int nItem) |
| Fill the cells of a row with an item. | |
| virtual void | UpdateCursor () |
| Move the cursor to the row with the selection, or dim it when the list is empty. | |
| virtual void | SetCursorSelected (bool bSelected) |
| Give the cursor the material of the selected or of the normal state. | |
| virtual bool | HandleJoypad (JoypadInputMsg *pMsg) |
| Scroll for up and down, and pass the cross button to the panel's cursor component. | |
| virtual void | ScrollUp () |
| Select the previous item. | |
| virtual void | ScrollDown () |
| Select the next item. | |
| RndView * | CloneRow (int nRow, RndView *pTemplate) |
| Clone the template row for one row. | |
| void | BuildRowCells (RndView *pRow) |
| Record the cells of a row, emptying each text and hiding each mesh. | |
| void | SetCellMat (int nRow, int nColumn, RndMat *pMat) |
| Show the mesh of a cell with a material. | |
| void | SetCellText (int nRow, int nColumn, const char *pszText) |
| Set the text of a cell. | |
| void | SetCellFont (int nRow, int nColumn, RndFont *pFont) |
| Set the font of a cell's text. | |
| void | SetRowFont (int nRow, RndFont *pFont) |
| Set the font of every text of a row. | |
| void | SetSelected (int nSelected) |
| Select an item, keeping the number of items. | |
| void | Refresh (int nItemCount, int nSelected) |
| Set the number of items and the selection, and fill the rows. | |
| int | GetSelected () const |
| int | GetItemCount () const |
| int | GetRowCount () const |
| RndMesh * | GetUpArrow () const |
| RndMesh * | GetDownArrow () const |
| void | SetShowUpArrow (int nShow) |
| void | SetShowDownArrow (int nShow) |
| Public Member Functions inherited from UIComponent | |
| UIComponent (DataArray *pData) | |
| Construct a showing component in the normal state. | |
| bool | Dispatch (Message *pMsg) override |
| Offer a message to the focused panel of the current screen, then handle it here. | |
| virtual bool | IsShowing () const |
| Report whether the component is showing. | |
| virtual void | SetShowing (bool bShowing) |
| Show or hide the component. | |
| virtual const char * | Text () const |
| Report the text the component shows. | |
| virtual void | SetText (const char *pszText) |
| Replace the text the component shows. | |
| virtual int | GetState () const |
| Report the state the component shows. | |
| virtual void | SetState (int nState, bool bForce) |
| Change the state the component shows. | |
| virtual void | Focus () |
| React to the panel giving the component the focus. | |
| virtual void | Unfocus () |
| React to the panel taking the focus away. | |
| virtual void | Poll (float fTime) |
| Advance the component to a time. | |
| const char * | GetName () const |
| int | GetShowing () const |
| 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 () |
| 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. | |
Static Public Member Functions | |
| static UIComponent * | New (DataArray *pData, const char *pszPanel) |
| Create a list from its script description. | |
| Static Public Member Functions inherited from UIComponent | |
| static void | Init (DataArray *pConfig) |
| Read the parameters of the flash a button shows when it is chosen. | |
Static Public Attributes | |
| static constexpr int | kKeepSelection = -99999 |
| The value of Refresh()'s selection that keeps the selected item. | |
Protected Attributes | |
| UIStyle * | mStyle |
| int | mItemCount |
| int | mRowCount |
| int | mColumnCount |
| int | mCursorRow |
| int | mSelected |
| int | mRowPitch |
| std::list< std::vector< Cell > > | mRowCells |
| std::vector< RndView * > | mRows |
| std::vector< RndText * > | mTextCells |
| const char * | mPanelName |
| RndMesh * | mCursor |
| RndMesh * | mUpArrow |
| RndMesh * | mDownArrow |
| Transform | mCursorXfm |
| int | mShowUpArrow |
| int | mShowDownArrow |
| Protected Attributes inherited from UIComponent | |
| const char * | mName |
| int | mShowing |
| int | mState |
Additional Inherited Members | |
| Public Types inherited from UIComponent | |
| enum | State { kStateNormal = 0 , kStateSelected = 1 , kStateDisabled = 2 } |
| The state a component shows, the values of mState and the index UIStyle selects with. More... | |
| Static Protected Attributes inherited from UIComponent | |
| static int | sNumFlashes |
| Number of times a chosen button flashes before it reports the choice. | |
| static float | sSelectedMs |
| Milliseconds of each flash a chosen button spends in the selected state. | |
| static float | sNormalMs |
| Milliseconds of each flash a chosen button spends in the normal state. | |
Component that shows a scrolling window of rows over a longer list of items.
The RTTI records the class as deriving from UIComponent. The object is 0xc0 bytes, and the vtable is at 0x003d2268. Index 2 of the script description names the style, index 3 the number of rows, index 4 the number of columns, and index 5 the distance between rows. The panel's file provides the template row <panel>_<name>_row.view, the cursor <panel>_<name>_cursor.mesh, and the arrows <panel>_<name>_up.mesh and <panel>_<name>_down.mesh.
The constructor clones the template once for each row, the clone of row N being named v_NN_<template>, and spaces the clones down by the row distance. Each text or mesh the template draws becomes one cell of the row. A derived list fills the cells of a row in UpdateRow().
| UIList::UIList | ( | DataArray * | pData, |
| const char * | pszPanel ) |
Construct a list from its script description, cloning the template row once for each row.
| pData | The script description. |
| pszPanel | The name of the panel the list belongs to. |
|
override |
Destroy the row clones and every object cloned with them.
|
inlinestatic |
Create a list from its script description.
UIManager::Init() registers the routine for the entry type list_comp.
| pData | The script description. |
| pszPanel | The name of the panel the list belongs to. |
|
overridevirtual |
Pass a controller button to HandleJoypad().
| pMsg | The message. |
Reimplemented from UIComponent.
|
overridevirtual |
Write a description of the list.
The routine writes nothing.
| stream | The stream to write to. |
Implements UIComponent.
|
inlinevirtual |
Fill the cells of a row with an item.
The base routine does nothing.
| nRow | The row. |
| nItem | The item. |
Reimplemented in FreqLoadList, NetMainLaunchpadsList, NetMainLobbiesList, NetMainPlayersList, NetRankedPlayersList, PlayList, RemixDownloadList, RemixLoadList, and SongSelList.
|
virtual |
Move the cursor to the row with the selection, or dim it when the list is empty.
Reimplemented in FreqLoadList, NetMainLaunchpadsList, NetMainPlayersList, NetRankedPlayersList, NetSortedLaunchpadsList, PlayList, RemixDownloadList, RemixLoadList, and SongSelList.
|
virtual |
Give the cursor the material of the selected or of the normal state.
| bSelected | Whether the cursor shows the selected state. |
Reimplemented in NetMainPlayersList, and NetRankedPlayersList.
|
virtual |
Scroll for up and down, and pass the cross button to the panel's cursor component.
| pMsg | The message of the button. |
Reimplemented in NetMainLaunchpadsList, NetMainLobbiesList, and NetMainPlayersList.
|
virtual |
Select the previous item.
Reimplemented in FreqList, NetRankedPlayersList, and NetSortedLaunchpadsList.
|
virtual |
Select the next item.
Reimplemented in FreqList, NetRankedPlayersList, and NetSortedLaunchpadsList.
Clone the template row for one row.
| nRow | The row. |
| pTemplate | The template row. |
| void UIList::BuildRowCells | ( | RndView * | pRow | ) |
Record the cells of a row, emptying each text and hiding each mesh.
| pRow | The row. |
| void UIList::SetCellMat | ( | int | nRow, |
| int | nColumn, | ||
| RndMat * | pMat ) |
Show the mesh of a cell with a material.
| nRow | The row. |
| nColumn | The column. |
| pMat | The material. |
| void UIList::SetCellText | ( | int | nRow, |
| int | nColumn, | ||
| const char * | pszText ) |
Set the text of a cell.
| nRow | The row. |
| nColumn | The column. |
| pszText | The text. |
| void UIList::SetCellFont | ( | int | nRow, |
| int | nColumn, | ||
| RndFont * | pFont ) |
Set the font of a cell's text.
| nRow | The row. |
| nColumn | The column. |
| pFont | The font. |
| void UIList::SetRowFont | ( | int | nRow, |
| RndFont * | pFont ) |
Set the font of every text of a row.
| nRow | The row. |
| pFont | The font. |
| void UIList::SetSelected | ( | int | nSelected | ) |
Select an item, keeping the number of items.
| nSelected | The item. |
| void UIList::Refresh | ( | int | nItemCount, |
| int | nSelected ) |
Set the number of items and the selection, and fill the rows.
The selection stays within the items, and the cursor stays within the rows.
| nItemCount | The number of items. |
| nSelected | The item to select, or kKeepSelection. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| nShow | Whether the up arrow shows even when no item lies above. |
|
inline |
| nShow | Whether the down arrow shows even when no item lies below. |
|
staticconstexpr |
The value of Refresh()'s selection that keeps the selected item.
|
protected |
The style of the cursor.
|
protected |
The number of items.
|
protected |
The number of rows.
|
protected |
The number of cells of each row.
|
protected |
The row of the selected item.
|
protected |
The selected item.
|
protected |
The distance between rows.
|
protected |
The cells of each row.
|
protected |
The row clones.
|
protected |
The text cells of every row.
|
protected |
The name of the panel the list belongs to.
|
protected |
The cursor, or null.
|
protected |
The arrow above the rows, or null.
|
protected |
The arrow below the rows, or null.
|
protected |
The cursor's transform on the first row.
|
protected |
Whether the up arrow shows even when no item lies above.
|
protected |
Whether the down arrow shows even when no item lies below.