rex_menufsm
Introduction
FSM to control the behavior of menu. It embeds the transfer logic of FSM inside this behavior.
FSM to control the behavior of menu. It embeds the transfer logic of FSM inside this behavior.
There are 2 main states of a menu - opened and closed, and 2 transition states - opening , and closing.
Open
When calling "Action:Open" at Closed state or Off state, current state will be transferred to "Opening" state, which is the transition state of "Opened". And "Condition:On opening" will be triggered.
Do transition actions like fade-in under "Condition:On opening", then call "Action:Finish transition event" to notify that this state has been finished, current state will be transferred to "Opened". And "Condition:On opened" will be triggered.
When calling "Action:Open" at Closed state or Off state, current state will be transferred to "Opening" state, which is the transition state of "Opened". And "Condition:On opening" will be triggered.
Do transition actions like fade-in under "Condition:On opening", then call "Action:Finish transition event" to notify that this state has been finished, current state will be transferred to "Opened". And "Condition:On opened" will be triggered.
The transfer from Closed to Opened is -
Closed -> Opening -> Opened
If "Has transition state" is "No" in properties table, the transition state will be skipped. so that the state transfer will become to
Closed -> Opened
"Condition:Is opened" will return true only if current state is at "Opened" state. User might test it under button clicked condition.
Close
Like opening, calling "Action:Close" could transfer state from "Opened" to "Closing". And trigger "Condition:On closing".
Do transition actions like fade-out, then call "Action:Finish transition event" to transfer state to "Closed", and "Condition:On closed" will be triggered.
Like opening, calling "Action:Close" could transfer state from "Opened" to "Closing". And trigger "Condition:On closing".
Do transition actions like fade-out, then call "Action:Finish transition event" to transfer state to "Closed", and "Condition:On closed" will be triggered.
The transfer from Opened to Closed is -
Opened -> Closing -> Closed
If "Has transition state" is "No" in properties table, the transition state will be skipped. so that the state transfer will become to
Opened -> Closed