Events and Handlers

There's a description of event handling here; this document is just a manifest of what handlers are provided with JLib.

All handler classes are derived from JHandler, which is defined in <JHandler.hpp>. All event classes are derived from JEvent, which is defined in <JEvent.hpp> along with JEventData.

JCmdHandler<JCmdH.hpp> WM_COMMAND & WM_SYSCOMMAND messages, from menu selections and button presses. Usually not used directly because of the command handler built into JMother.
JCtlHandler<JCtlH.hpp> WM_CONTROL messages, sent by a control to its owner when it has something to say. Often not used in favour of deriving from the control, overriding its virtual methods and using adopt() in the owner.
JKeyHandler<JKeyH.hpp> WM_CHAR messages, when the user types something.
JMouseHandler
JCUAMouseHandler
JMouseEnterExitHandler
<JMouseH.hpp> Handles mouse events. The CUA handler may be more appropriate, depending on your application. JMouseEnterExitHandler will not work on Warp 3 pre fixpak 32, and possibly neither on Warp 4 below a (low) fixpak number.
JPaintHandler<JPaintH.hpp> Window painting events. There are several options here. When responding to a paint event, you must call begin() in the event before painting, and end() afterwards. This is done for you by default, but if (for some reason, perhaps calling the default window procedure) you wish to manage this yourself, supply false in the handler's constructor.

If you wish to use your own presentation space for painting, use the setPS() method. If not called, a new (cached micro) presentation space is used on each call. Read about WinBeginPaint & WinEndPaint in the pm ref for further clarification!

JPositionHandler<JPosnH.hpp> Window repositioning events. There's one event triggered just before the window's position is changed (so you can alter the new position), and one triggered just after the position has changed (so you can, eg. re-layout the dialog).
JFocusChangeHandler<JFocusH.hpp> Handles events generated when the focus changes to or from the window in question.
JOwnerDrawHandler<JOwnerDH.hpp> Some controls are owner draw (I think only the custom listbox and slider at the moment) and support isn't provided directly by JLib. In these cases, you can use this handler to draw the control.
JDragHandler
JDiscardHandler
JPrintHandler
<JDragH.hpp> Attach to windows you wish to drag things from. Note that the container and valueset controls don't need this, as they have builtin support for drag and drop.

The print & discard handlers are for handling callbacks from the shredder and the printer.

JDropHandler<JDropH.hpp> Attach this to windows you wish to act as drop targets. Note that this doesn't apply to containers, which have built-in support for drag and drop.
JMsgHandler<JMsgH.hpp> This is a simple template handler for handling one sort of PM message.
JScrollHandler<JScrollH.hpp> Used to handle events generated by scrollbars. You shouldn't need to use this, for the same reason you shouldn't need to use scrollbars.
JCnrHandler<JCnrH.hpp> This is used internally by the container control, and not for public consumption!


John Fairhurst 11th June 1998