ContentsWhat is fGUI ?
fGUI basics The classesfApplicationfClassInfo fColor fGroup fObject fPoint |
Event model
IntroductionEvents are an essential part of fGUI. Most of the communication between objects is done using events and not direct calls to methods. This allows the GUIs to be more flexible and more robust to changes.To deliver events fGUI uses the BMessage class with its own extensions. The what-field of a BMessage in an event is always FGUI_EVENT. The only exception from this rule are the Messages that are sent to the windows from the mouse thread (see fApplication). These BMessages have the type F_MOUSE_THREAD_EVENT. The events that occur in fGUI can be divided in two categories, system generated events and object generated events. System generated eventsSystem events come either from the mouse thread (see fApplication) or from the Be system itself (for example B_KEY_DOWN).
Object generated eventsObjects can send events to other objects, windows or applications as a result of user actions or a previous event.Default fieldsfGUI defines these fields that can be present in any event, but often only a subset is really present.fAction
fEvent
fTimeStamp
fSourcePointer
fTargetPointer
SourceName
fTargetName
Event processingThe event routeThe fEventRoute is the basic class for sending events to other objects, windows or applications. Each object has a list of event routes which is empty by default in fObject but can be filled with events in derived classes.Three stages of processingEvents are processed by the window and then dispatched to the object that is affected by the event. The processing of events is done in three stages.First the objects checks if the event matches one in his list of eventroutes and triggers them if they match. Secondly if the event is one of the predefined events for that a corresponding method is defined in the fObject class the parameter needed for the call are extracted from the message and the method is called (Examples: mouseDown(), setFocus()). Finally messageReceived() is called to handle all nonstandard events.
The flexible GUI, in HTML for the BeOS Release 3. Copyright © 1997-1998 Stegemann & Co. All rights reserved. Last modified May 19, 1998. |