OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TEventHandler Class Reference

TEventHandler is a base class from which you can derive classes that handle messages. More...

#include <owl/eventhan.h>

Inheritance diagram for owl::TEventHandler:
owl::TApplication owl::TDocManager owl::TDragListEventHandler owl::THelpFileManager owl::TRecentFiles owl::TSerializeReceiver owl::TTabbedBase owl::TView owl::TWindow

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.
 

Detailed Description

TEventHandler is a base class from which you can derive classes that handle messages.

Specifically, TEventHandler performs the following event-handling tasks:

  • 1. Analyzes a window message.
  • 2. Searches the class's response table entries for an appropriate event-handling function.
  • 3. Dispatches the message to the designated event-handling function.

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.

Member Typedef Documentation

◆ TEqualOperator

typedef bool(* owl::TEventHandler::TEqualOperator) (const TGenericTableEntry &, const TEventInfo &)

Definition at line 193 of file eventhan.h.

Member Function Documentation

◆ Dispatch()

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.

◆ DispatchMsg()

TResult owl::TEventHandler::DispatchMsg ( TMsgId msg,
uint id,
TParam1 p1,
TParam2 p2 )

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().

◆ Find()

bool owl::TEventHandler::Find ( TEventInfo & info,
TEqualOperator op = 0 )
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.

◆ SearchEntries()

bool owl::TEventHandler::SearchEntries ( const TGenericTableEntry * entries,
TEventInfo & eventInfo,
TEqualOperator equal )
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.


The documentation for this class was generated from the following files: