SmartTableOpenMenu.h
The one open menu and the style it paints from, kept together so neither outlives the other.
The one menu a table has open, and the Slate style it draws from.
The two live together because one has to end inside the other. A menu is its own Slate window and does not close with the widget that opened it. The style set holds the brushes that window paints with, and a set freed under a live menu leaves the next paint reading a freed brush.
Nothing outside holds the set. Style hands back a reference and never the pointer, so DropStyle and teardown are the only routes that free it, and both close the menu first. One menu has one owner, which is why this value is never copied.
- Struct
- FSmartTableOpenMenu
- Members
- 14
Constructors and destructor 4
Closes anything still open, before the style set is freed with this value. Slate is often down already by the time a table is taken apart, and the close is skipped then.
Public functions 5
The style every menu and submenu of this table draws from, built on first use.
Kept and not rebuilt per menu. FMenuBuilder takes a plain pointer to whatever style it is handed, and that has to outlive every menu built from it.
Drops the set built from a style that has moved. Closes the menu first, and a menu left up would paint from brushes that are about to go.
Opens a menu on an anchor path, and keeps it so teardown can close it.
TableRoot is the table's own Slate widget, held weakly. Slate ties a menu window to nothing else, so a table taken off screen would leave its menu drawn over whatever follows.
DrivingUserIndex is the Slate "user" the menu takes focus for, and whose focus is put back when it shuts. INDEX_NONE means the one whose pointer is over the table, and the keyboard one when no pointer is. The menu stack shuts a menu the moment its "user" focuses something else. A real click on a table drawn off screen goes to the game viewport and takes the focus of "user" 0. The pointer over such a table is a virtual "user", and a menu that belongs to it stays open through that click.
Closes whatever is open. Safe with nothing open, and safe to call twice.
The Slate "user" the open menu was pushed for, as Push resolved it. A flyout inside that menu has to be opened for the same one, or it dies when the focus of that "user" moves.
Private functions 2
Closes the menu once the table stops being drawn.
Holds the menu and the table's widget weakly, and the tick comes off once the menu is gone. Two missed frames and not one: a re-parent breaks the path for a single frame while the table is well.
The widget path and not the visibility. A UWidgetSwitcher changing tabs sets nothing at all on the page it leaves, and offers only its live page to a walk.
Gives focus back to whatever held it before the menu went up, on the next frame, and only while nothing else has taken it by then.
A menu takes focus on the way up. Nothing gives it back on the way down, so a table left behind by a closed menu takes no keys at all. Every binding goes quiet at once, which reads as lost input and not as lost focus.
Private variables 3
Written on every push, so a flyout opened later can be given the same "user".
Next: SmartTableLog.h