848 Chapter 18 Object-Oriented Infrastructure
Mouse events include pressing a mouse button and moving the mouse, which
generates calls to
OnMouseClick, OnMotion, and OnPassiveMotion. If your develop-
ment platform is Microsoft Windows or X-Windows, you might have been tempted
to have more mouse callbacks such as
OnLeftMouseDown and OnMiddleMouseUp, which
is reasonable for hardware and operating systems that support multiple-button mice.
However, a Macintosh mouse has only a single button, so I refrained from having
anything other than
OnMouseClick. I do pass in the button type (iButton), a but-
ton state (
iState), and button modifiers (uiModifiers). The platform-independent
names I use for these are
class WindowApplication : public Application
{
public: