LEventDispatcher is a PowerPlant class that is used for handling all event processing after the application retrieves the event in the main event loop. This class is also responsible for adjusting the cursor, distributing time to idle-time processes, and initiating menu updates before displaying menus.
Methods :
The methods in this class are:
Data Members:
The data members in this class are:
Operation:
Most of the time, you won't need to override any functions in this class. PowerPlant supplies default behaviors that implement much of the functionality you could hope for.
Unless you use the Mac Toolbox directly for tasks such as running
a dialog box with ModelDialog(), all event processing goes through the main event loop and LEventDIspatcher,
even for modal dialogs.
Source files:
See also:
Purpose:
The constructor creates the object, initializing the menus so that they are unhilited, and saving a copy of the current Event Dispatcher.
Access:
Prototype:
LEventDispatcher();Parameters:
Purpose:
The destructor destroys the object, including disposal of the mouse region, and restoring of the previous Event Dispatcher.
Access:
Prototype:
virtual ~LEventDispatcher();Parameters:
Purpose:
Adjust the shape of the cursor (mouse pointer). If the cursor is inside an active, enabled, PowerPlant window, then the window is expected to handle cursor adjustment, using
Access:
Prototype:
virtual void AdjustCursor(Parameters:
const EventRecord &inMacEvent);
The parameter for this method is:
Return:
Purpose:
Respond to a mouse click in the menu bar.
Access:
Prototype:
virtual void ClickMenuBar(Parameters:
const EventRecord &inMacEvent);
The parameter for this method is:
Return:
Purpose:
This method processes a Mac OS Toolbox event.
Access:
Prototype:
virtual void DispatchEvent(Parameters:
const EventRecord &inMacEvent);
The parameter for this method is:
Return:
Purpose:
Respond to an Activate (or Deactivate) event by enabling the appropriate window and updating the command status.
Access:
Prototype:
virtual void EventActivate(Parameters:
const EventRecord &inMacEvent);
The parameter for this method is:
Return:
Purpose:
Access:
Prototype:
virtual void EventAutoKey(Parameters:
const EventRecord &inMacEvent);
The parameter for this method is:
Return:
Purpose:
Respond to a Disk-inserted event.
Access:
Prototype:
virtual void EventDisk(Parameters:
const EventRecord &inMacEvent);
The parameter for this method is:
Return:
Purpose:
Respond to a High Level (Apple) Event.
Access:
Prototype:
virtual void EventHighLevel(Parameters:
const EventRecord &inMacEvent);
The parameter for this method is:
Return:
Purpose:
Access:
Prototype:
virtual void EventKeyDown(Parameters:
const EventRecord &inMacEvent);
The parameter for this method is:
Return:
Purpose:
Respond to a Key Up event. Note that by default, the system masks out Key Up events.
Access:
Prototype:
virtual void EventKeyUp(Parameters:
const EventRecord& inMacEvent);
The parameter for this method is:
Return:
Purpose:
Respond to a Mouse Down event.
Access:
Prototype:
virtual void EventMouseDown(Parameters:
const EventRecord &inMacEvent);
The parameter for this method is:
Return:
Purpose:
Access:
Prototype:
virtual void EventMouseUp(Parameters:
const EventRecord &inMacEvent);
The parameter for this method is:
Return:
Purpose:
Respond to an OS event (MouseMoved, Suspend, Resume).
Access:
Prototype:
virtual void EventOS(Parameters:
const EventRecord &inMacEvent);
The parameter for this method is:
Return:
Purpose:
Access:
Prototype:
virtual void EventResume(Parameters:
const EventRecord& inMacEvent);
The parameter for this method is:
Return:
Purpose:
Access:
Prototype:
virtual void EventSuspend(Parameters:
const EventRecord& inMacEvent);
The parameter for this method is:
Return:
Purpose:
Access:
Prototype:
virtual void EventUpdate(Parameters:
const EventRecord &inMacEvent);
The parameter for this method is:
Return:
Purpose:
Tell all associated Attachments to execute themselves for the specified message.
Access:
Prototype:
virtual Boolean ExecuteAttachments(Parameters:
MessageT inMessage,
void *ioParam);
The parameters for this method are:
Return:
The return value specifies whether the default Host action should
be executed. The value is false if any Attachment's Execute() function returns false, otherwise it's true.
Purpose:
Get a pointer to the current LEventDispatcher object so that it can be later restored.
Access:
Prototype:
static LEventDispatcherParameters:
*GetCurrentEventDispatcher();
Return:
A LEventDispatcher pointer that points to the current LEventDispatcher.
Remarks:
This is a static method, and as such the same method will be called for every instance of the LEventDispatcher objects.
Purpose:
This method handles all the menu update operations that are required for event processing.
Access:
Prototype:
virtual void UpdateMenus();Parameters:
Return:
Remarks:
This method handles many cases, and is best understood by reading the source code.
Purpose:
Respond to a NULL or MouseMoved Event.
Access:
Prototype:
virtual void UseIdleTime(Parameters:
const EventRecord &inMacEvent);
The parameter for this method is:
Return:
Remarks:
Typically, all this method needs to do is devote time to processing idle tasks.
Purpose:
This data member provides a place to store the current EventDispatcher object pointer.
Access:
Prototype:
static LEventDispatcher *sCurrentDispatcher;
Purpose:
This data member provides a place to store the previous EventDispatcher object pointer. From this, the former EventDispatcher can be restored later.
Access:
Prototype:
LEventDispatcher *mSaveDispatcher;
Purpose:
This data member provides a place to store the mouse region handle.
Access:
Prototype:
RgnHandle mMouseRgnH;