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

The flexible GUI: fApplication

Derived from: public BApplication

Declared in: fGUI/fApplication.h

Library: fGUI.so


Overview

The fApplication class is one of the three connections from fGUI to the Be system. (The other two are fWindow and fView). When being created the fApplication object spawns a thread that generates the mouse status information needed by fGUI. This is a workaround but necessary as long as the mouse handling provided by Be remains as incomplete as it is today. (For details have a look at the private method mouseThread() in fApplication.cpp).

Furthermore the fApplication is responsible for holding a list of all instances of fWindow that are created by the application. This list is needed for distributing the events from the mouse thread and for finding objects either by name or by a pointer for delivery of other events (see locateObject()).

If you want to use fGUI your application has to use fApplication or a class derived from it.


Derived Classes

When your application needs a customized application object be careful that you do not interfere with the default operation of fApplication ! Although most member functions are declared virtual and thus allow overriding you normally leave them alone unless you know exactly what you are doing.


Constructor and Destructor


fApplication()

	fApplication( const char *Signature)
Creates a new fApplication object. The Signature is pased on to the BApplication and remembered internally. Therefore you can use the signature of the application as a target name in any fGUI event.

As mentioned above a new thread is spawned that watches the mouse status and sends mouse events to the application.


~fApplication()

	virtual ~fApplication( void)
This deletes the fApplication object, frees all internally allocated memory and stops the mouse thread.


Static Functions


getApplication()

	static fApplication * const getApplication( void)
Returns a pointer to the fApplication object. Used for example in fWindow::fWindow() to add the window to the list of fGUI windows. The main reason for this method is to avoid casting the be_app global pointer and accessing a global variable in the first place.


Member Functions


addWindow(), removeWindow()

	virtual void addWindow( const class fWindow *Window)
	virtual bool removeWindow( class fWindow *Window)
Adds or removes the window Window from the fApplications list of windows, respectively. You don't call these methods directly, they are called from the constructor and destructor of fWindow automatically.


locateObject()

	virtual const BLooper *locateObject( const fObject *ObjectPointer) const
	virtual const BLooper *locateObject( const char *ObjectName) const
Used for delivering an event these functions can locate every object in an application either by name or by its address. The methods return a pointer to a BLooper where a BMessage can be sent to to reach the destination object. They will not only find objects, but also windows (using fWindow::getWindowName()) and the application itself (using the applications signature).

You don't call these methods directly, they are called from the fEventRoute class which does all the event handling.


MessageReceived()

	virtual void MessageReceived( BMessage *Message)
In MessageReceived the messages from the mouse thread are dispatched to all windows in the fApplications window list.

Note: When you need to override this method in your own application remember to call fApplication::MessageReceived()! Otherwise there will be no mouse handling at all!


The flexible GUI, in HTML for the BeOS Release 3.

Copyright © 1997-1998 Stegemann & Co. All rights reserved.

Last modified May 19, 1998.