SmartTableColumnSelection.h
The column a pad or a keyboard is aiming at, kept apart from the row selection.
Which column the table is aimed at, and the four rules that move that aim.
SmartTable::ColumnLayout answers where a column sits: widths, edges, order. This answers which column the next key press works on, and the two move for different reasons.
The aim names a column and never a place. Reordering the columns, by a header drag or by MoveColumn, would otherwise leave it pointing at whatever moved into that place.
- Struct
- FSmartTableColumnSelection
- Members
- 6
Public functions 4
Aims at one column, or clears the aim when given NAME_None.
A column that is not in ShownIds is refused and never stored. Storing one would leave every later intent given no column of its own working on a column nothing can see.
Returns true only where the aim really moved, which is what tells a caller it owes an event. Aiming again at the column already aimed at brings LastIndex up to date and gives back false.
Walks the aim along the shown columns, wrapping at both ends.
From no aim at all it jumps to the far end the move was heading for. A negative Delta lands on the last shown column and anything else on the first, so the very first press always shows. A table showing no columns clears the aim.
The column an intent should work on: the one it named, or the aim when it named none.
A named column is aimed at as well as given back, which leaves the resize key after a sort by name on that same column. A name that is not shown comes straight back and the aim does not move.
Given none, Revalidate runs first. A table with no aim yet then takes the first shown column, and the first press of a binding always reaches something.
Moves the aim off a column that is no longer shown, onto whatever now stands in its place.
Clamped and never wrapped. Hiding the last column leaves the aim on the new last one, and hiding the aimed column keeps an aim and does not drop to none.
Hiding every column is the one case that does drop it. Nothing is left to clamp onto, and an intent given no column of its own then has nothing to work on either.
Public variables 2
NAME_None until something aims it, which is the true answer for a table not yet touched.
Where Selected stands in the shown order, brought up to date every time the aim is set.
Revalidate is the only reader. Hiding the third column leaves the aim on whatever is third now, where clearing this would send it back to the first. That is a long walk on a pad.