Contents

What is fGUI ?

fGUI basics
The factory
Event model
Legal Issues
Things to do
History

Tree of classes
About

The classes

fApplication
fClassInfo
fColor
fGroup
fObject
fPoint

Event model


Introduction

Events 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 events

System events come either from the mouse thread (see fApplication) or from the Be system itself (for example B_KEY_DOWN).

Object generated events

Objects can send events to other objects, windows or applications as a result of user actions or a previous event.

Default fields

fGUI defines these fields that can be present in any event, but often only a subset is really present.

fAction

Type: int32
Name: fAction
Description: The fAction field in the message tells the target object about how they should react to the message.
Examples: F_SET_VALUE, F_SCROLLBAR_SMALL_INCREASE

fEvent

Type: int32
Name: fEvent
Description: This variable holds the kind of event that has happended and totally depends on what type of object has sent the message.
Examples: F_CHECKBOX_UNCHECKED, F_TEXTINPUT_CURSOR_PULSE

fTimeStamp

Type: bigtime_t
Name: fTimeStamp
Description: Gives the time the message was sent. [from system_time()]

fSourcePointer

Type: fObject *
Name: fSourcePointer
Description: A pointer to the object that has sent the message.


fTargetPointer

Type: fObject *
Name: fTargetPointer
Description: A pointer to the object the message is delivered to. This can also be the pointer to an instance of fWindow or a pointer to the application.


SourceName

Type: char *
Name: fSourceName
Description: The name of the object that has sent the message. Will only be filled in when the object name is set correctly.


fTargetName

Type: char *
Name: fTargetName
Description: The name of the object the message is delivered to. This can also be the name of an instance of fWindow or the signature of an application.


Event processing

The event route

The 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 processing

Events 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.