SmartTableColumnLayout.h
The column sums with no widget in them: where each edge lands, and where a moved column ends up.
The column width and order sums, with the widget taken out of them.
Nothing in here knows what an SListView or an SHeaderRow is. A width is worked out before any widget is built.
USmartTable is the way in. Its own member functions read the inputs off the named columns and the layout in force, call through to these, then write the answers back.
- Types
- 6
- Of which
- 1 enum, 1 namespace, 4 struct
- Members
- 27
SmartTable::ColumnLayout namespace
The column width and order sums, with the widget taken out of them.
Nothing in here knows what an SListView or an SHeaderRow is. A width is worked out before any widget is built.
USmartTable is the way in. Its own member functions read the inputs off the named columns and the layout in force, call through to these, then write the answers back.
Public functions 11
The pixel width of every shown column, for the space the table has right now.
A column with a UserWidth takes it. A Fixed one takes its named pixels. The Fill columns split what is left by weight, and weights adding up to nothing share it equally instead. bStretchLast then widens the last entry to close any gap under the total.
Everything is floored at MinWidth, a chosen width too, so the fixed and chosen columns alone can run the total over TotalWidth. Columns arrive in drawn order with the hidden ones dropped, and TotalWidth at or below zero answers with nothing: a column at the floor for one frame is worse than no answer.
Which column right edge, if any, the pointer is close enough to grab.
The walk adds widths left to right, and that running total is each column right edge, in the places the header draws them. LeadingOffset is whatever sits pinned left of the first column without being one, which is the row number gutter.
It gives up at the first column with no measured width. Past an unknown the total is a guess, and a grip on the wrong column is worse than no grip at all.
Works a resize drag out against the columns to its right.
Every number is measured from where the drag began. Never from the widths in force this frame, and never from the space the table has to fill. Filling a window is what ResolveWidths is for.
The dragged column grows until everything right of it sits at MinWidth. The cost comes one column at a time, starting with the neighbour along. What the drag pushes on is what moves first.
Which of the widths a drag answered for really moved, by index into Targets.
ResolveGrowDrag answers for every column right of the drag, and the first one or two take up the whole cost. The rest already sit at the width they are being set to. Only a column that really moved counts as chosen, and a chosen column is one ResolveWidths stops fitting to the window.
Drawn is what each column draws at now. A target with no drawn width beside it counts as moved, since an unknown is no match. Epsilon is how close two widths have to be to pass for the same one.
The width of the last column when the table is set to stretch it.
A floor and not an override. A last column dragged wider than the leftover keeps that width, and only one narrower than the gap is widened to close it.
The mode a header column is built in. A column goes Manual only once the widths are live and it can be resized. Before that, and for a column that cannot be resized, it keeps its authored Fixed or Fill.
Manual reads its pixel width from an attribute on every frame. The header and every row follow it through a resize, and nothing is built again. Fixed writes its width into the cell once, when the cell is built. A Fixed column only moves when the header is built again, and that drops every row to nothing for a frame.
A Manual column takes its width from a width pass. Before the first pass has run, a column that fills would draw with no width at all.
Which columns of a width pass moved since the last one, in the order After lists them.
A column moved when Before holds no width for it, or one further than Epsilon from its new width.
How far a resize drag pans the table this frame, from where the cursor sits in the viewport.
Step while the cursor is within EdgeZone of the right edge, the negative of Step within EdgeZone of the left edge, and nothing anywhere else. The right edge wins in a viewport narrow enough for the two zones to meet.
Folds a requested order into the authored one.
The requested ids lead, in the order asked for. Any that names no column is dropped, and a column named twice is placed once. Every column the request never names follows them, in the order it was authored, so a stored layout need not name them all.
Where the column at From lands after Delta steps along Order, as an index into the whole of Order.
Only a shown column counts as a step. Delta is places on screen, since that is what Move Left and Move Right are bound to. A hidden column between two shown ones would otherwise take the move and leave the header drawn as it was. Hidden columns keep their places, and only the moved one goes anywhere.
A Delta past the last shown column that way lands on that last one. INDEX_NONE when no shown column lies that way at all, and for a Delta of zero.
Which column holds LocalX, or NAME_None. A column holds its left edge and not its right, and the walk gives up at the first column with no measured width, exactly as FindEdgeAt does.
FColumn struct
One column, flattened to the numbers these functions work on.
Public variables 6
The name of this column, the same one the table and the model use.
Which of the two things AuthoredWidth means.
Pixels in Fixed, and a share of the leftover in Fill. Nothing in the type keeps the two apart.
A Fill share is usually 1.0. Handed back as a pixel count it draws a column one pixel wide.
The pixel width in force. Zero is not measured yet, and never a column zero pixels wide. The hit tests stop at the first zero they reach.
A column that cannot be resized is no grip target. It still counts in every total.
A width that was chosen by a drag, SetColumnWidth or SizeColumnToContent. ResolveWidths gives the column what it names here, floored at MinWidth, instead of working a width out for it.
Unset leaves the column to be sized. Optional and not a float, since zero is spoken for already: CurrentWidth uses it for not measured yet.
FGrantedDrag struct
What a resize drag really got, and what that cost the columns to its right.
Public variables 3
The width the dragged column really gets. Clamped to what the columns to its right can give up before they all sit at MinWidth.
The width every column right of the drag should now have. All of them, and not only the ones that moved.
Worked out from the snapshot on every call, never stepped on from the last frame. A drag that goes out and comes back lands on the snapshot again, and the neighbour is put back where it was.
False when a column on the right has no measured width, which is the one thing that stops the sums. Granted is then the ask, floored at MinWidth.
RightWidths comes back as the input, and none of it is written down. Those widths are unknown and not wrong, and one stored as a chosen width stays stuck wherever the guess put it.
EHeaderWidthMode enum
Which SHeaderRow sizing mode a header column is built in.
Values 3
FResolvedWidth struct
The answer for one column out of ResolveWidths. Every shown column comes back exactly once, so the whole result can be set against what was written the time before.
Public variables 2
Pixels, for the space the table has this frame.
FEdgeHit struct
Where FindEdgeAt landed, if anywhere.
Public variables 2
The column whose right edge was hit, or NAME_None when the pointer is on no grip.
Where that column starts, in the same space LocalX was given in.
Next: SmartTableBinding.h