Home |
Obtaining a Pointer to PegPresentationManager Determining the Position of an Object Messages |
MessagesMessages are identified by the 16-bit member field wType of structure PegMessage. The first 8000h message wType values are reserved for internal messages, which leaves message values 8000h through FFFFh available for user definition. The first message value which is available for user defined messages is FIRST_USER_MESSAGE, declared in Peg.hpp. Below are the system messages which would potentially be of interest in the application level software: PM_ADDThis message can be sent to add an object to another object. The message pTarget field should contain a pointer to the parent object, and the message pSource field should contain a pointer to the child object. PM_CLOSERecognized by PegWindow derived objects, and causes the recipient to remove itself from its parent and delete itself from memory. PM_CURRENTSent when an object becomes a member of the branch of the presentation tree which has input focus. PM_DESTROYThis message can be sent to PegPresentationManager to destroy an object. The pSource member of the message should point to the object to be destroyed. PM_DIALOG_NOTIFYSent to the owner of a PegDialog when the dialog window is closed if the dialog window is executed non-modally. The message iData member will contain the ID of the button used to close the dialog window. PM_DRAWSent to an object to force that object to redraw itself. PM_EXITSent to PegPresentationManager causes termination of the program. PM_HIDESent whenever an object is removed from a visible parent. PM_GAINED_KEYBOARDThis message is sent to an object when it gains keyboard input focus. PM_KEYSent to the current input object when keyboard input is received. The message iData member contains the corresponding ASCII character code, if any, and the lData member of the message contains the keyboard scan code, if available. PM_LBUTTONDOWNSent when the user generates mouse click input. The position of the mouse click is included in the message Point field. PM_LBUTTONUPSent when the user releases the left mouse button. PM_LOST_KEYBOARDThis message is sent to an object when it loses keyboard input focus. PM_MAXIMIZEThis message can be sent to any PegWindow derived object. If the target window is sizable (as determined by the the PSF_SIZEABLE status flag), it will resize itself to fill the client rectangle of its parent. PM_MINIMIZESimilar to PM_MAXIMIZE, this message can be sent to any PegWindow derived object. If the window is sizable, it will create a proxy PegIcon, add the icon to the parent window, and remove itself from its parent. PM_NONCURRENTThis message is sent to an object when it loses membership in the branch of the presentation tree which has input focus. PM_PARENTSIZEDSent to all children of a PegWindow derived object if the window is resized. This makes it very easy for child windows that want to maintain a certain proportional spacing or position within their parent to catch this message and resize themselves whenever the parent window is sized PM_POINTER_ENTERSent to an object when the mouse pointer passes over it. PM_POINTER_EXITSent to an object when the mouse pointer leaves it. PM_POINTER_MOVESent to an object whenever the mouse pointer moves over it. PM_SHOWSent to an object when it is added to a visible parent, before the object is first drawn. This allows an object to perform any necessary initialization prior to drawing itself on the screen. PM_SIZECause an object to resize or move. This is equivalent to calling the Resize() function. Note that there is no difference between moving and resizing an object. The new size and position is included in the message Rect field. PM_RESTORECan be sent to any sizeable PegWindow derived object to cause that window to restore its size and position after it has been maximized or minimized. PM_RBUTTONDOWNThe right mouse button is pressed. RTPEG-32 objects do not process right mouse button messages. PM_RBUTTONUPThe right mouse button is released. RTPEG-32 objects do not process right mouse button messages. PM_TIMERThis message is sent to an object that has started a timer via the PegMessageQueue TimerSet function when that timer expires. The ID of the timer is included in the iData member of the message. PM_POINTER_WHEELThe mouse has been wheeled. iData is > 0 for rotations away from the user (up) and < 0 for rotations towards the user (down). Parameter iUserData[2] has the current keyboard state flags. Classes PegWindow, PegVertList, PegComboBox, and PegVScroll understand and process this message. Overriding the Message() Method
|