Input: 1.4 Input Flow: Input Hierarchies

Up: GEOS SDK TechDocs | Up | Prev: 1.3 Input Events | Next: 2 Mouse Input

Because the entire User Interface of GEOS is implemented as a hierarchy (tree) of objects, input messages naturally flow from the topmost object in the tree down to the object that should receive the input. At each level in the tree, the object decides whether to handle the event or pass it on to one of its children. Typically, the event will be passed all the way down the tree to a leaf node, where it will be handled or ignored.

To simplify and shorten this process, the UI maintains several special hierarchical input flow channels where special input should always flow. These hierarchies include the focus , the target , and the model . All three are described in full in Input Hierarchies .

The Focus is the object that should receive all Keyboard events. For example, a modal dialog box always has the focus; if the user presses Enter, the dialog box will take its default action. A text object into which the user is typing has the focus as long as the user does not click outside its bounds.

The Target is what is selected by the user: the object on which actions should be performed. Controller objects (of GenControlClass ) typically operate on the target. An example is a text object with selected text. When you set the text's style using a menu item (a style control object), that menu item sends its message to the current target object. The text object, set as the current Target, receives the message and sets the style of the selection.

An object is said to "have the focus" or "have the target" if it is the object specified by the hierarchy to receive that type of input. The system provides special travel options to allow you to send messages directly to the focus or target without knowing in advance which object is the destination.

The Model represents the non-visible model of the application's data. For example, a secondary selection in a database will not be acted on like the normal target, but it may still need to have similar properties. The Model hierarchy can be used to maintain this type of secondary or non-visible selection.


Up: GEOS SDK TechDocs | Up | Prev: 1.3 Input Events | Next: 2 Mouse Input