SmartTableTypes.h
The structs and enums the table's fields and nodes are made of.
Nothing here is a class you subclass. These are the shapes the panel and the nodes use: what a column is, how it sizes, which way a sort runs, how a menu is set up. Come here when a field name tells you less than its list of options would.
- Types
- 18
- Of which
- 9 enum, 9 struct
- Members
- 100
- Panel fields
- 39
FSmartTableColumn struct
One column, named once, so no row can differ from it.
This struct is step two of three: drop the widget, add columns, call SetItems. Every field it holds has a default that leaves the common case empty.
Public functions 3
Header when it says something, otherwise the id read as text. Every place that draws a column's name asks this, so a column cannot be called one thing in the header and another in a menu.
The binding used for ordering: SortBindingName when set, and the value binding when it is not.
BindingName when set, otherwise ColumnId.
Public variables 21
Smart Tables 15
The name of this column, and it must not move. Every model call is keyed by it, and a column number stops meaning anything as soon as a column is hidden or moved.
The label drawn in the header. Falls back to the column id.
- Options from
- GetBindableNames
What this column reads on the item: a property, or a BlueprintPure function that needs no input. It falls back to ColumnId, so a column named DisplayName binds itself.
A pure function is how a worked out column gets by with no model of its own. Distance is a property on nothing. GetDistance is a plain node on the item, and the type it gives back is a typed sort key.
With ColumnSource on Item Class or Data Table, this field is a dropdown of what that source can bind. File mode fills no dropdown, since a csv or a json carries headings and not a struct.
- AdvancedDisplay
- The panel hides it under the arrow.
For a column whose text and whose order come from different places, such as a cell reading unknown over a column that still sorts by number.
Free text and no dropdown. The Details panel builds one dropdown per GetOptions property per column, and on a wide table that cost lands on the click that opens it. This field is rarely set, and it falls back to the value binding.
Whether Width below is a share of the leftover space or a count of pixels.
- Minimum
- 0.0
A weight in Fill, pixels in Fixed. A resize or a stored layout wins over it.
Where the value sits in its cell. The header label has its own alignment field below.
Room around the value in every cell of this column, and in its header.
- Range
- 0 to 8
The most digits after the point a number binding draws.
Per column, and not per table. A plain float draws as 1234.567890, and the only way round that without this is a whole function giving back FText for one field.
Whether a header click and the header menu can sort by this column. Off, both go, and the Sort By Column node still works.
Whether the right edge of this column is a drag grip. Off, no resize cursor shows there and a drag on the edge does nothing.
Whether the header menu offers to hide this column. It gates the menu entries and nothing else, so Hidden By Default, a stored layout and Set Column Visible all still hide the column.
Starts hidden, and the Show Columns menu brings it back. A stored layout wins over it.
The widget every cell of this column is. Unset draws the built-in text cell, and a plain text column needs nothing else.
- AdvancedDisplay
- The panel hides it under the arrow.
What follows the cursor when a cell in this column is dragged. Unset copies CellClass.
A cell class and never a plain widget. What follows the pointer has to stand for a row. A cell is handed the same table, model, row and column the real one is, so it reads its own text and colour through the API it already has.
Three routes, least work first. Unset, the drag draws the field it started on. Named here, it draws whatever this points at, with no code. An override of MakeCellDragVisual on the cell draws any widget at all, or none. All three want bAllowCellDragDrop on the table.
Header 6
- AdvancedDisplay
- The panel hides it under the arrow.
Draw an icon to the left of the label.
A flag of its own, and not a test of whether HeaderIcon is set. A brush counts as set in several ways that all look right: a texture, a tint, a rounded box with neither of those.
- Editable when
- bShowHeaderIcon
- AdvancedDisplay
- The panel hides it under the arrow.
The icon drawn to the left of the label. The slot is collapsed while bShowHeaderIcon is off: an unset FSlateBrush asks for 32 by 32, and measuring one would push the label along.
- Minimum
- 0.0
- Editable when
- bShowHeaderIcon
- AdvancedDisplay
- The panel hides it under the arrow.
Pixels between the icon and the header label. Zero puts them side by side, and the room is only taken while the icon is shown.
- AdvancedDisplay
- The panel hides it under the arrow.
Give this column its own header text style, in the field below. Without it the whole header uses the style set on the table.
- Editable when
- bOverrideHeaderTextStyle
- AdvancedDisplay
- The panel hides it under the arrow.
The header text style this column alone uses, while the switch above is on. The rest of the header keeps the style set on the table.
- AdvancedDisplay
- The panel hides it under the arrow.
Where the header label sits, apart from where the values of the column sit. A number column aligned right usually wants its heading aligned right too.
FSmartTablePresentationChange struct
What moved in the presentation of a model, as separate facts.
Flags and not a scale. Every visible cell being stale and the row set having moved are two pieces of work, and Add ORs them so neither is ever dropped while a rebuild is out.
A live data sweep arriving while a dispatched sort still holds an older presentation has to keep both halves. One number could carry only the wider of the two, and rows that did not move would go on drawing values that did.
Not a USTRUCT: it goes through a plain C++ delegate, and nothing authors or saves it.
Public functions 9
Whether this says anything at all. Read by Scope and by Add, and no broadcast is gated on it.
How much this reaches, worked out from every field at once.
The one place the fields become an answer. A row number or a column id beside a moved order counts for nothing, since the whole screen is stale either way.
Folds Other in, losing nothing.
Every flag either side set stays set. Changes add up while a rebuild is out, and they go out together no matter how many arrive.
A row number lives on only while it is the only one in play. Two different rows, or a row beside anything wider, is no longer about one row, and saying otherwise would refresh one and skip the rest.
The column is nested inside that rule and never folded beside it. One column in two rows is two rows, so the column goes wherever the row number goes.
The values of one row moved. The cheap one, and what a live feed sends several times a second.
One value of one row moved, and the table reads that cell alone.
Narrower than OneRowsValues, and only for a model whose columns do not read each other. A bound pure function in another column can read the property just written, a total off a price being the usual case, and this change leaves that column drawing the old number.
The values of every row moved, and the order in use was put back over them.
Both parts, because RebuildPresentation sorts again: the rows may have moved and every cell is stale.
A different order and nothing else. What RebuildPresentation lands on by default, and what a model resets its held change to as a sort lands.
A text filter says this too, even one that drops rows, which is more than the name covers.
Rows arrived or left, which reorders whatever is still there. Diff says which ones they are, when the model knows them.
A different set of data: every row is a different row and every cell is stale.
Answered the same way as a row set change. Identity is mapped again and the selection is matched back up by row id, so a row id that also exists in the new data keeps the selection it had.
Public variables 6
Every visible cell has to read again. The values behind them moved, and where the rows sit may well not have moved at all.
The presented to natural map moved, so the row handles have to be rebuilt. A sort, or a filter.
Rows arrived or left. Identity is mapped again and the selection is matched back up by row id.
Which rows arrived and left, when the model said. Only ever set beside bRowSetMoved.
The one row this is about, when it is about one row. INDEX_NONE for anything wider.
The one column this is about, when it is about one cell of that row. NAME_None for anything wider, and only ever set beside a NaturalRow. A column with no row is a shape nothing here means.
FSmartTableHeaderMenuOptions struct
Which entries the built-in header menu offers.
All on by default. Every flag here cuts the menu down, and OnExtendHeaderMenu is what adds to it.
Public variables 6
Off, and no right click menu opens anywhere on the header.
With a pointer this menu is the only way back once every column is hidden. Move Left and Move Right are the only reorder a keyboard or a pad reaches with no code behind it.
SetColumnVisible, MoveColumn and ResetLayout are all still there for a table that shuts the menu.
Offer the sort entries in the header menu. Separate from the header click, which has its own switch on the table.
Offer Size to Content in the header menu. It fits a column to its widest value and marks that width as chosen.
Move Left and Move Right. Apart from bAllowColumnReorder, which gates dragging a header: a gamepad reaches this route and never that one.
Offer Hide This Column and the Show Columns submenu in the header menu. Both leave out a column with Hideable off.
Offer Reset Columns in the header menu. It puts widths, hidden columns and the sort back to how the table was authored.
FSmartTableMenuEntry struct
One entry of the right click menu of a row.
Authored in the Details panel, since a row menu belongs to the game. A table cannot know what a row means, so it has no entry of its own to offer here. The header menu is the other way round: its entries are built in, and its settings struct only cuts them down.
Nothing here is acted on by the table. It draws the entries and says which Id was picked.
Public variables 6
Sent back when this entry is picked. It names the action and never the label: a label is text a player reads, and those words change.
The text drawn in the menu.
Shown while the pointer rests on the entry. Empty for none.
Off, the entry draws greyed and not dropped, so the menu keeps its shape between rows.
This one means not right now, such as a Remove on a locked row. bVisible means not on this kind of row at all, where a greyed entry only asks a question the menu cannot answer.
Whether this entry is built at all. Off, it leaves no gap and no divider between its neighbours.
A divider above this entry. Ignored on the first, where it would draw a line against the border.
FSmartTableSortSpec struct
What order the rows should be in.
One value carrying every level. A two level sort cannot be said as a column plus a mode, and two calls in a row would rest on the model remembering the first.
Public functions 4
Which way this column is sorted, or None. The header arrows read it.
Zero for the primary sort column, one for the second level, INDEX_NONE when it is not sorted by.
Public variables 1
- SaveGame
- Carried by SaveGame serialisation.
Empty is unsorted. The header sends at most two, and the sort helpers take any number.
FSmartTableLayout struct
Everything about a table that a store keeps: widths, hidden columns and the sort.
Public variables 5
Raised when what a stored layout means changes, so a restore can spot an old file.
- SaveGame
- Carried by SaveGame serialisation.
Zero on anything written before layouts had a version.
- SaveGame
- Carried by SaveGame serialisation.
The drawn order, left to right. Empty means the order the columns were named in.
Apart from Columns, and neither array says anything about the other. An id here that names no column is dropped as this is read, and a column no id names goes back where it was named.
- SaveGame
- Carried by SaveGame serialisation.
What a column holds that is not its place: the width, whether it is hidden, and whether the width was chosen. The order of this array carries no meaning.
- SaveGame
- Carried by SaveGame serialisation.
The sort in force when this was saved. Empty is unsorted, which a restore puts back too.
ESmartTableColumnSource enum
What shape the columns of a table were written against.
One field and never three half answers. It picks which of ExpectedItemClass, SourceTable and SourceFile the panel shows. It also picks the struct behind the binding dropdown, the struct the compile checks against, and the source the column builder reads.
None of these loads a row. Data arrives at runtime through SetModel, SetItems or SetDataTable, so this is the author time shape and nothing more. A table pointed at a json file draws nothing until a model arrives.
Values 4
Columns are written out one by one, and nothing is checked against anything.
A UObject class, whose properties and pure functions are the shape.
A DataTable asset, whose row struct is the shape.
ESmartTableCellEditor enum
Which built-in editor a cell offers. None draws the value and takes no input.
Values 4
ESmartTableAssignReason enum
Why a cell or a row wrapper was just given a row.
This is what an entrance animation reads. All four arrive as the same call with the same arguments, and only the reason tells them apart. A table scrolling a million rows reassigns constantly, and an entrance played on every one of those flashes instead of animating.
Only Added is a row that has not been on screen yet.
Values 4
A recycled widget now draws a different row. The common case by far, and the one that has to stay quiet while it happens.
The same row as before, read again for a reason that is not its data: a skin change, a column resized, a refresh of everything. Nothing about what the row says has changed.
A row that was not in the table the last time it drew.
The values of this row moved, and it is the only row that did.
The live data case, and the one a cell flashes for. A refresh of everything stays Refreshed, since every cell on screen flashing at once says nothing.
ESmartTablePresentationScope enum
How much of the table a presentation change reaches.
Worked out from every field of the change at once, and never field by field at a call site. A change that moved the order or the row set reaches the whole screen, whatever row or column it also names.
Values 4
Says nothing, so there is nothing to do.
One named column of one named row.
Every column of one named row.
Every row the list has built. The order or the row set moved, or the values did and nothing names a single row.
FSmartTableColumnLayout struct
What a resize or a hide left on one column, and the part of a table a store keeps past the session.
Public variables 4
- SaveGame
- Carried by SaveGame serialisation.
Which column this entry is about.
- SaveGame
- Carried by SaveGame serialisation.
Pixels, and it means something only while bUserWidth is set. Zero and skipped otherwise.
An entry also exists for hiding a column, so an entry with no chosen width is normal.
Only a width set on purpose goes in here. Every other width is worked out again from the named sizing whenever the space changes. A worked out number filed as a choice is wrong at every window size but the one it was saved at.
- SaveGame
- Carried by SaveGame serialisation.
Set by a drag and by SetColumnWidth, which size to content also goes through. Cleared by ResetColumnWidth and by ResetLayout, and no width pass may take a set width back while it holds.
- SaveGame
- Carried by SaveGame serialisation.
Whether this column is hidden right now.
ESmartTableSortMode enum
The order a column is sorted in. None is unsorted, which is a third answer and not an error.
Values 3
ESmartTableSelectionMode enum
What a click on a row does. None also stops the caret, so no key selects anything either.
Values 3
Clicking a row does nothing to it. Right for a table of fields being edited, where the row mark is noise behind the field and there is nothing to pick.
One row at a time. The default, and what most tables mean by selection.
Control and Shift do what they do everywhere else.
FSmartTableSortColumn struct
One level of a sort: which column, and which way.
Public functions 1
Public variables 2
- SaveGame
- Carried by SaveGame serialisation.
The column this level orders by.
- SaveGame
- Carried by SaveGame serialisation.
Which way this level orders. The built-in sort reads anything that is not Descending as Ascending.
ESmartTableCellDragRole enum
What a cell is to a drag going on right now.
Three states and no more. A drag has one source, and at most one cell under the pointer. The table works the role out, the cell holds on to it, and the row draws the brush for it.
Values 3
Not part of the drag, or there is no drag.
The drag started on this cell. Drawn dimmer by default, since what it holds is on the move.
The pointer is over this cell right now, so this is where a release would drop it.
FSmartTableRowMenuOptions struct
Whether rows have a right click menu at all, and what it is called.
Off by default, unlike the header one. A table whose rows nothing can change has no entry to offer. Opening one with no RowMenuEntries and no OnExtendRowMenu handler warns once and draws nothing.
Public variables 3
Off, and a right click on a row opens nothing. OpenRowMenu still works.
The heading drawn above the entries. Empty for none, which is right for two or three.
Selects the row a menu opens on, before the menu is built.
Off, since selection belongs to the left button. On a Multi table a right click would add the row under it to the set and never replace the set. On is for a table whose menu works on a row that nothing else marks out.
ESmartTableColumnSizing enum
How a column works out its width. Both use Width: Fill as a weight, Fixed as a count of pixels.
Values 2
A share of the space left over, weighted by Width.
Exactly Width pixels, whatever size the table is.
ESmartTableHeight enum
How tall the table asks to be. Not how tall it is: a parent that gives it less always wins.
Values 2
Takes whatever height it is given and scrolls the rows that do not fit.
Asks for every row it has, so a parent that can grow shows all of them and no scrollbar shows up.
Next: SmartTableSorting.h