Home Gadgetman Forum Book Reviews Links Contact me X-UFO
Gadgets Processors Programming School Old news
In the last section we defined 4 buttons...

Those buttons also need matching proedures.
The naming convention is:
cmdtbdownXX%:
Where XX is the Keyvalue given when the button was created.

The value of XX is a single letter if the keyvalue was a small letter, and s+letter if it was a Capital...

In the Event loop we need to add some code. Specifically we need to change the 'Pen event' part if it don't already exist.
We will use the procedure TBarOffer: to send ALL pen events to the Toolbar routines.
TBarOffer returns true(-1) if it used the event itself, and False(0) if it didn't:

      ELSEIF eventdata&(1) = KEvPtr&  REM Pointer event?
         IF NOT TBarOffer%:(eventdata&(3),eventdata&(4)
                           ,eventdata&(6),eventdata&(7))
            handlepointer:
         ENDIF
You MUST use TBarOffer%: becaause the Toolbar module uses it to do housekeeping work.
(Like changing the look of the clock)
<<2. Adding the tools>>
<<User friendliness>>
<<Useful tips>>