Protected Members
- virtual Bool keyPresentlyDown(const PCMotionEvent &ev)
Review Status
- Date Reviewed:
- yyyy/mm/dd
PCPositionEH
PCMotionEH
PCRefreshEH
Etymology
PCTool stands for PixelCanvas Tool.
Synopsis
This class is a base class upon which tools which respond to
various events on a PixelCanvas can be built. It wraps up
the position, motion and refresh events so that the programmer
sees them all coming into one class, where they can be dealt
with in a unified manner. PCTool is not actually abstract,
so the programmer need only write handlers for the events in
which they are interested.
Example
Motivation
The majority of tools written for the PixelCanvas will fall
into the category that this class serves: they respond to a
single key or mouse button, and they potentially need to
respond to position, motion and refresh events.
To Do
Member Description
Constructor. A PixelCanvas to attach to must be specified,
and normally a key to respond to as well.
Destructor.
virtual void enable()
virtual void disable()
Switch the tool on/off. This simply registers or unregisters the
event handlers.
Required operators for event handling. These are called when
events occur, and distribute the events to the "user-level"
methods.
Functions called by the local event handling operators. By
default they do nothing, so a derived class needs only implement
the events it cares about.
Get the PixelCanvas to which this Tool is attached.
virtual void setKey(const Display::KeySym &keysym)
virtual Display::KeySym getKey() const
Set/get which key to catch.
Indicate whether key is presently pressed.