Home |
Class PegPresentationManager HMI (Human-Machine Interface) Classes |
Class PegPresentationManagerClass PegPresentationManager is derived from PegWindow. It is a transparent background window that can be thought of as the the desktop window for all PEG applications. PegPresentationManager keeps track of all of the windows and sub-objects present on the display device. In addition, PegPresentationManager keeps track of which object has the input focus (i.e. which object should receive user input such as keyboard input), and which objects are on top of other objects. There is no limit to the number of windows and/or controls that may be present on the screen at one time. class PegPresentationManager : public PegWindow { public: void Draw(void); PEGINT Message(const PegMessage &Mesg); void Add(PegThing * What, BOOL bDraw = TRUE); PegThing * Remove(PegThing * What, BOOL bDraw = TRUE); int Execute(void); void MoveFocusTree(PegThing * Current); PegThing * FindLowestThingContaining(PegThing * Start, PegPoint Point); void NullInput(PegThing * Current); BOOL IsPointerCaptured(void); void SetScratchPad(PEGCHAR * pText); PEGCHAR * GetScratchPad(void); void ClearScratchPad(void); void CapturePointer(PegThing * Who); void ReleasePointer(PegThing * Who); void SetWallpaper(PegBitmap * pBm); } Method DrawPegPresentationManager overrides PegThing's Draw() function to provide a simplified and faster drawing routine, and also to draw the wallpaper bitmap, if any. Method AddPegPresentationManager overrides PegThing's Add() method to set focus to newly added top-level windows. Method RemovePresentationManager overrides the PegThing's Remove method to check for the last object being removed, which signals PresentationManager to return from the Execute() function. As stated, PresentationManager will terminate by sending a PM_EXIT message to itself if the last window or control is removed from the screen. When PresentationManager receives the PM_EXIT message it verifies that no top-level windows exist, and if not terminates the message loop. Method ExecutePegPresentationManager overrides the PegWindow's Execute() to provide the main PEG message looping operation. Function PegExecute calls Execute(). Method MoveFocusTreeForces the branch of the display tree containing the specified object to get focus. This function may be called at any time to move the input focus to any visible object. Method FindLowestThingContainingDetermines the lowest child object that contains the point Where. The object must be enabled and selectable. A pointer to the child object is returned. Method NullInputResets the PresentationManager input focus status if parameter Current is the object which has input focus. Also resets input focus if a child of Current has input focus. Method IsPointerCapturedReturns TRUE if the mouse pointer is captured, else FALSE. Method SetScratchPadCopies the indicated text string into the PresentationManager scratchpad buffer. This is used by user-editable text objects to support cut, copy, and paste operations. Method GetScratchPadReturns a pointer to the text string which has been copied to the scratchpad, or NULL if no string is available. The PresentationManager scratchpad is used to cut, copy, and paste strings between PegString, PegTextBox, and PegTerminalWin classes. Method ClearScratchPadResets the PresentationManager scratchpad buffer, and frees the associated memory. Method CapturePointerThis method can be called to capture all mouse pointer input. This is done by modal windows, during re-size and move operations, and can also be done by the application level software at any time. The application software should call ReleasePointer() to end the CapturePointer() operation. Method ReleasePointerReleases a captured mouse pointer. This function should always be called after the CapturePointer() function to return to normal operation. Method SetWallpaperAssigns a PegBitmap that PresentationManager will tile over the entire screen background. The wallpaper bitmap defaults to NULL. A solid color background can also be specified by setting the PresentationManager PCI_NORMAL color: Presentation()->SetColor(PCI_NORMAL, ANYCOLOR);
|