|
resonance 1.0.1
|
Scrolling list of rows driven by a ListDataProvider. More...
#include <scrollinglist.h>
Public Member Functions | |
| ScrollingList (ListDataProvider *pProvider, int nRowPitch, int nRowCount, Rnd::View *pTemplate, Rnd::Mesh *pHighlight, Rnd::Mesh *pUpArrow, Rnd::Mesh *pDownArrow, int nContext) | |
| Build the rows from the template view. | |
| virtual | ~ScrollingList () |
| Delete every row clone together with every object it references. | |
| void | refresh () |
| Show the rows that have an item and fill their cells, and hide the rest. | |
| void | scrollUp () |
| Move the selection up by one item. | |
| void | scrollDown () |
| Move the selection down by one item. | |
| void | setItemCount (int nItemCount) |
| Record the number of items and clamp the selection to it. | |
| int | getSelected () |
| Report the selected item. | |
| void | setSelected (int nSelected) |
| Select one item and place the cursor row so the page ends at the last item where it can. | |
| void | setShowing (int nShowing) |
| Record the showing flag and pass it to the highlight mesh. | |
| void | setEntriesShowing (int nShowing) |
| Pass a showing flag to every Text cell. | |
Scrolling list of rows driven by a ListDataProvider.
Its RTTI descriptor is at 0x0086f6a0. It is a leaf class with no base. The class name is the RTTI spelling verbatim. No method name and no member name is attested anywhere in the image. Every name below is inferred from the routine's behaviour.
Following the g++ 2.x layout for a class with no base, the vptr sits after the data members at +0x94, and the object is 0xa0 bytes, which the operator new argument at each call site confirms. The two-entry vtable at 0x00815a20 runs the compiler-generated GetTypeInfo at 0x00400e88 and the destructor at 0x003fd380, so the destructor is the one virtual the class declares.
The list clones a template row view once per visible row, spacing the clones mRowPitch apart along z, and names each clone v_NN_ followed by the template's name. Each clone's Text and Mesh children become its cells. refresh() hands every cell of a visible row to the provider, a highlight mesh follows the cursor row, and two arrow meshes show whether items lie above or below the visible page.
MetFreqMakerDirectionsScreen, MetJukeboxBaseScreen, MetMCFreqDelScreen, MetRemixDelScreen, and MetRemixLoadScreen all drive one.
The rest of the translation unit is library code and is not declared. 0x004009b8 is the vector insert that appends a Cell, 0x00400500 and 0x00400928 are std::list<Rnd::Object *> sort and unique (shared with Rnd::Manager), 0x004003a0 is the merge that sort uses, 0x00400060 and 0x00400c60 are unreferenced vector insert emissions, and 0x004013d0 is the allocator's out-of-memory retry loop.
| ScrollingList::ScrollingList | ( | ListDataProvider * | pProvider, |
| int | nRowPitch, | ||
| int | nRowCount, | ||
| Rnd::View * | pTemplate, | ||
| Rnd::Mesh * | pHighlight, | ||
| Rnd::Mesh * | pUpArrow, | ||
| Rnd::Mesh * | pDownArrow, | ||
| int | nContext ) |
Build the rows from the template view.
The body runs with no memory zone selected and restores the caller's zone at the end. It shows every child of the template, clones one row per visible row, hides the template, and records the highlight mesh's local transform as the position of the first row. The item count starts at zero.
| pProvider | The provider the cells are filled from. |
| nRowPitch | The distance between two rows along z. |
| nRowCount | The number of visible rows. |
| pTemplate | The row view each row is cloned from. |
| pHighlight | The mesh that marks the cursor row, or null. |
| pUpArrow | The mesh shown while items lie above the page, or null. |
| pDownArrow | The mesh shown while items lie below the page, or null. |
| nContext | The value passed through to the provider. It is the one argument on the stack. |
|
virtual |
Delete every row clone together with every object it references.
The highlight first returns to the first row. For each row the body resolves the clone by name, gathers its animation, collision, draw, and transform descendants, removes duplicates, and deletes each one and then the clone itself.
| void ScrollingList::refresh | ( | ) |
Show the rows that have an item and fill their cells, and hide the rest.
The first visible item is the selection less the cursor row. Each cell goes to ListDataProvider::ProvideMesh() when it is a Mesh and to ListDataProvider::ProvideText() otherwise. The arrows are updated last.
| void ScrollingList::scrollUp | ( | ) |
Move the selection up by one item.
An empty list hides the highlight and does nothing else. Otherwise the highlight takes the low bit of mShowing, the selection and the cursor row each step up when they can, and the highlight and the rows are refreshed.
| void ScrollingList::scrollDown | ( | ) |
Move the selection down by one item.
The body mirrors scrollUp() with two differences. The highlight is not tested for null, and it is shown unconditionally rather than with the low bit of mShowing.
| void ScrollingList::setItemCount | ( | int | nItemCount | ) |
Record the number of items and clamp the selection to it.
A count that is not positive hides the highlight and does nothing else. Otherwise the highlight takes the low bit of mShowing, and the highlight is moved. The rows are not refreshed.
| nItemCount | The number of items. |
| int ScrollingList::getSelected | ( | ) |
Report the selected item.
| void ScrollingList::setSelected | ( | int | nSelected | ) |
Select one item and place the cursor row so the page ends at the last item where it can.
An empty list resets the selection and the cursor row to zero instead. The highlight is moved in both cases. The rows are not refreshed.
| nSelected | The index of the item to select. |
| void ScrollingList::setShowing | ( | int | nShowing | ) |
Record the showing flag and pass it to the highlight mesh.
The highlight receives zero while the list is empty, and the low bit of nShowing otherwise. A null highlight is skipped.
| nShowing | Non-zero to draw the list. |
| void ScrollingList::setEntriesShowing | ( | int | nShowing | ) |
Pass a showing flag to every Text cell.
The flag is forwarded unchanged and, unlike setShowing(), neither masked nor tested against the item count.
| nShowing | Non-zero to draw each cell. |