Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages

Testing::CFPSGraphicalObserver Class Reference

#include <testing.h>

Inheritance diagram for Testing::CFPSGraphicalObserver:

Inheritance graph
[legend]
Collaboration diagram for Testing::CFPSGraphicalObserver:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CFPSGraphicalObserver (CPoint &pos, CFont *font)
virtual void update (CModel *model)
virtual int do_handle_event (CEvent &event)

Detailed Description

Sample class for an observer of the CFPSTimer class. It's just a text label that displays the frames per second and updates itself whenever the CFPSTimer notifies it of a change.

Definition at line 15 of file testing.h.


Constructor & Destructor Documentation

Testing::CFPSGraphicalObserver::CFPSGraphicalObserver CPoint pos,
CFont font
[inline]
 

Create the observer, placing it at the given point, using the given font.

Definition at line 19 of file testing.h.


Member Function Documentation

virtual int Testing::CFPSGraphicalObserver::do_handle_event CEvent event  )  [inline, virtual]
 

If the user presses the 'f' key, toggle the display of this component.

Todo:
Very bad smell here. Even if we made the activation key a parameter, what if we wanted to toggle the visibility every time the user clicked the mouse? This is very good motivation for decoupling the view and controller parts of CComponent.

Reimplemented from CComponent.

Definition at line 35 of file testing.h.

References CEvent::get_key_ascii_value(), CEvent::get_type(), CComponent::set_visible(), CEvent::TYPE_KEY_DOWN, and CComponent::visible().

Here is the call graph for this function:

virtual void Testing::CFPSGraphicalObserver::update CModel model  )  [inline, virtual]
 

IObserver implementation, called by the CFPSTimer whenever it updates its state.

Implements IObserver.

Definition at line 22 of file testing.h.

References CTextLabel::set_text().

Here is the call graph for this function:


The documentation for this class was generated from the following file:
Generated on Wed Aug 27 11:59:33 2003 for GFW by doxygen 1.3.3