FindFocusBoxAction

This branch action tracks and reports position of the current focus box.

Constructors

this
this(FocusIO focusIO)

Prepare the action. To work, it needs to know the FocusIO it will search in. At this point it can be omitted, but it has to be set before the action launches.

Members

Aliases

subscribe
alias subscribe = typeof(super).subscribe
Undocumented in source.
then
alias then = typeof(super).then
Undocumented in source.
then
alias then = Publisher!(Optional!Rectangle).then
Undocumented in source.

Functions

beforeDraw
void beforeDraw(Node node, Rectangle , Rectangle , Rectangle inner)
Undocumented in source. Be warned that the author may not have intended to support it.
started
void started()
Undocumented in source. Be warned that the author may not have intended to support it.
stopped
void stopped()
Undocumented in source. Be warned that the author may not have intended to support it.
subscribe
void subscribe(Subscriber!(Optional!Rectangle) subscriber)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

focusBox
Optional!Rectangle focusBox;

Focus box reported by the node, if any. Use .then((Rectangle) { ... }) to get the focus box the moment it is found.

focusIO
FocusIO focusIO;

System holding the focused node in question.

Inherited Members

From BranchAction

beforeTree
void beforeTree(Node , Rectangle )
beforeResize
void beforeResize(Node , Vector2 )
afterTree
void afterTree()
afterInput
void afterInput(bool )

A branch action can only hook to draw calls of specific nodes. It cannot bind into these hooks.

filterBeforeDraw
bool filterBeforeDraw(Node node)

Branch action excludes the start node from results.

filterAfterDraw
bool filterAfterDraw(Node node)

Branch action excludes the start node from results.

stopped
void stopped()
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

Using FindFocusBoxAction.

import fluid.node;
import fluid.space;

class MyNode : Space {

    FocusIO focusIO;
    FindFocusBoxAction findFocusBoxAction;

    this(Node[] nodes...) {
        super(nodes);
        this.findFocusBoxAction = new FindFocusBoxAction;
    }

    override void resizeImpl(Vector2 space) {

        require(focusIO);
        findFocusBoxAction.focusIO = focusIO;

        super.resizeImpl(space);

    }

    override void drawImpl(Rectangle outer, Rectangle inner) {

        // Start the action before drawing nodes
        auto frame = startBranchAction(findFocusBoxAction);
        super.drawImpl(outer, inner);

        // Inspect the result
        auto result = findFocusBoxAction.focusBox;

    }

}

Meta