Important: The information in this document is obsolete and should not be used for new development.
Chapter 15 -
This chapter includes recipes and sample code that demonstrate how to
Working With the Mouse
MacApp's handling of mouse operations is described in detail in "Mouse Handling," beginning on page 224.
- implement a recordable command for drawing with the mouse
- support drawing specified by an Apple event
- drag with the mouse (a general outline)
- implement autoscrolling
Mouse event dispatching is described in Chapter 5, "Events and Commands."
Managing the cursor image as the user moves the mouse over a view is described in Chapter 8, "Displaying, Manipulating, and Printing Data." Managing the cursor for drag-and-drop operations is described in Chapter 9, "Drag and Drop."
Chapter Contents
- Overview
- Recipes--The Mouse
- Recipe--Implementing a Recordable Drawing Command
- Define a Command Constant for a Drawing Command
- Add a Buzzwords Menu Entry
- Define a Subclass of TTracker to Track the Mouse and Perform Drawing
- Constructor
- Destructor
- Initialization Method
- TrackConstrain
- TrackFeedback
- TrackMouse
- Define a Class to Send an Apple Event Describing the Drawing Operation
- Override DoMouseCommand to Create and Post a Drawing Command
- Recipe--Supporting Drawing Specified by an Apple Event
- Define a Command Constant for a Draw Points Command
- Add a Buzzwords Menu Entry
- Describe the Draw Points Event in the 'aete' Resource
- Map the Draw Points Event to a Command Number
- Define a Command Class to Work With the Draw Points Event
- Constructor and Destructor
- Initialization Method
- DoIt Method
- UndoIt and RedoIt Methods
- Override DoScriptCommand to Create a Draw Points Command
- Dragging With the Mouse--A General Outline
- Recipe--Implementing Autoscrolling