Event, Flow Control and Action

In ForeUI, you can freely define the behavior of each element. The behavior can be defined as one or more event handlers. The form of event handler will look like this:

The event handler has three factors: Event, Flow Control and Action. They will be laid out as a tree structure that represent the flow chart of behavior.

Event is the starting point, the event handler will be invoked when the specified event occur.

Flow Control will take charge of the flow direction, it can branch the flow or make the looping. It can be omitted if no branching or looping are needed.

Action is the factor that really do something. There are many kinds of actions available.

You can define many event handlers for a specified element, thus the element can respond multiple events.

There is a special kind of event named "Custom Event", you can assign a name to it and build its handler, the event handler will be invoked once the Custom Event is triggered by a "Trigger Custom Event" action.

Here's a sample, two element handlers are defined. The first event is "Element Clicked", the second event is "Button Updated", which is a custom event.