SmartTableScrollMove.h
The scroll a table drives itself: one smooth move to a row, and where the view goes when rows arrive or leave.
- Types
- 6
- Of which
- 1 enum, 5 struct
- Members
- 31
FSmartTableScrollMove struct
The scroll a table drives itself: one move, where the view sits, and whether the opening scroll is paid.
It takes numbers, a view of the drawn order, and a way to name a row. It holds no table, no list and no model, and every rule in here reads with no widget built.
Public functions 7
Works out the move to a row and stores it.
False on three counts: Seconds asks for a jump, the view is already there, or the row is the last one and the view sits at or past the target. All three leave the view to be placed on the row outright.
PresentedRow and Row are the same row in the two spaces, and both are known at the call site.
RowsOnScreen: the viewport height over the named row height. It counts too many the moment a row draws taller, which the last-row refusal above covers. Seconds: how long the whole move may take. Zero or less asks for a jump.
One step of the move, from the timer the table already runs.
Gives back the natural row the move arrived at, or INDEX_NONE while it is still going. Arrival stops the move. OutOffset is written on both answers.
The row comes back because the last step belongs to the list. The target splits the viewport by the named row height, so a table whose rows draw taller stops short of the row it aimed at.
Nothing is moving. The view and the opening scroll are left as they are, since neither belongs to the move that just ended.
A whole fresh value, for a new model or a new widget. One assignment, so a field added to this type is reset along with the rest.
Whether the move going is aimed at this row.
Whether the view sits at the end of the list.
Within EndSlackRows of the bottom counts as the end. A list showing nothing counts as at the end too. Exactly zero would stop a table following over a drag that ended a pixel short. A whole row of slack pulls a reader who has just begun to scroll up back to the end as the next row arrives.
RemainingFraction is the scrollbar's own distance from the bottom, as a fraction of the list, so nothing here has to guess how many rows fit. NumPresented is the drawn count, since that fraction is over what the list shows.
What the view does after rows arrived or left, whichever route they took.
- A replaced set scrolls nothing, and neither does a table that drew no row before. Their rows did not arrive one by one.
- With bScrollToAddedRow on and rows arrived, bStickToEnd moves a view that sat at the end to the new last row, when the list grew. With bStickToEnd off the view moves to the arrived row drawn last.
- Otherwise a view off the top and off the end holds its top row, when the diff names rows and no move is going. At the top the new rows above show, and at the end the list keeps its own bottom.
LastDrawnArrival: the drawn place of the arrived row drawn last, or INDEX_NONE when none is drawn. Asked only when the answer depends on it, since finding the rows can cost a walk.
Public variables 5
The move going on, or unset while nothing is moving. Step asserts that something is, so every caller tests this before it steps.
Where the view was as of the last tick, never a fresh read. Starts true, which is also what an empty list samples as, so the rows a fresh table gets before its first tick are followed.
Whether bStartAtEnd has had its one scroll. Cleared by a new widget and by a new model, and it covers the opening position and nothing after it.
The row at the top of the view as the table left it, after its last rebuild of the rows.
The rows on screen are built again only when the list draws. A second change in the same frame finds them still showing the rows from before the first. It reads the top row here instead, while the view has not moved since.
How far from the bottom a view still counts as at the end, in rows.
FSmartTableRowSetFacts struct
What ScrollAfterRowSet reads, gathered by the table around the rebuild of its rows.
Public variables 7
As sampled on the tick before the change, since the list has already grown by the time it lands. A move the table runs to its last row counts as at the end too.
Whether a move is still going once the rebuild has aimed it again. The move owns the offset then.
The list offset before the change, in drawn places.
FSmartTableHeldRow struct
The row at the top of the view before a row set change, by the id the row on screen drew.
Never by asking the model. The model already holds the new rows when the table hears of the change, and the old number names a different row there.
Public functions 1
The offset that puts this row back at the top, now that it is drawn at PresentedNow.
Public variables 3
None when no built row sat at the top.
The list offset, whose fraction past PresentedRow is kept.
ESmartTableRowSetScroll enum
What the view of a table does once rows arrived or left.
Values 3
Nothing. The list keeps its offset.
A move to a drawn row.
The row that sat at the top of the view goes back to the top.
FSmartTableScrollTarget struct
Where one smooth scroll is heading, and how fast.
Public variables 3
In drawn places, which is what a list scroll offset counts.
The row it is heading to. Step hands its number back on arrival, for the list to place.
Kept, and not only a number. A move runs for ScrollToRowSeconds, and a live feed adds and drops several rows in that time.
Items per second, worked out from the distance at the moment the move started.
FSmartTableRowSetScroll struct
The answer ScrollAfterRowSet gives. PresentedRow is set for ToRow and for nothing else.
Public variables 2
Next: SmartTableArrivals.h