OWLNext 7.0
Borland's Object Windows Library for the modern age
|
TEventHandler is a base class from which you can derive classes that handle messages. More...
#include <owl/eventhan.h>
Classes | |
class | TEventInfo |
A nested class, TEventInfo provides specific information about the type of message sent, the class that contains the function to be handled, the corresponding response table entry, and the dispatch function that processes the message. More... | |
Public Types | |
typedef bool(* | TEqualOperator) (const TGenericTableEntry &, const TEventInfo &) |
Public Member Functions | |
virtual bool | Find (TEventInfo &info, TEqualOperator op=0) |
Searches the list of response table entries looking for a match. | |
TResult | Dispatch (TEventInfo &info, TParam1, TParam2=0) |
Takes the message data from TEventInfo's Msg data member and dispatches it to the correct event-handling function. | |
TResult | DispatchMsg (TMsgId, uint id, TParam1, TParam2) |
Search for the event given the message and it and dispatch to the event handler if found. | |
Protected Member Functions | |
bool | SearchEntries (const TGenericTableEntry *entries, TEventInfo &info, TEqualOperator op) |
Low-level response table search function. | |
TEventHandler is a base class from which you can derive classes that handle messages.
Specifically, TEventHandler performs the following event-handling tasks:
Most of ObjectWindows' classes are derived from TEventHandler and, therefore, inherit this event-handling behavior. In addition, any user-defined class derived from TEventHandler can handle message response functions that are associated with a particular window message.
Definition at line 162 of file eventhan.h.
typedef bool(* owl::TEventHandler::TEqualOperator) (const TGenericTableEntry &, const TEventInfo &) |
Definition at line 193 of file eventhan.h.
TResult owl::TEventHandler::Dispatch | ( | TEventInfo & | info, |
TParam1 | param1, | ||
TParam2 | param2 = 0 ) |
Takes the message data from TEventInfo's Msg data member and dispatches it to the correct event-handling function.
Definition at line 396 of file eventhan.cpp.
References PRECONDITION.
Search for the event given the message and it and dispatch to the event handler if found.
Definition at line 413 of file eventhan.cpp.
References Dispatch(), and Find().
|
virtual |
Searches the list of response table entries looking for a match.
Because TEventHandler doesn't have any entries, TEventHandler's implementation of this routine returns false.
Reimplemented in owl::TApplication.
Definition at line 371 of file eventhan.cpp.
|
protected |
Low-level response table search function.
Allows optional equal operator function to be provided. Searches the entries in the response table for an entry that matches TEventInfo or, if so designated, an entry that TEqualOperator specifies is a match. Fills in Entry member of eventInfo and returns true if found.
Definition at line 431 of file eventhan.cpp.