
Home |
|
PegPresentationManager
|

Index |
|
 |
|
|
 |
|
Overview |
Derived from class
PegWindow
|
 |
|
The KwikPeg Presentation Manager is an instance of the
PegPresentationManager class. The class name
PegPresentationManager is frequently used as the
name of the abstract KwikPeg Presentation Manager which it represents.
The PegPresentationManager object
is a transparent background window that operates as the desktop
window for all KwikPeg GUI applications.
PegPresentationManager keeps track of
all of the windows and related objects present on the display device.
It also monitors which objects are drawn 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.
PegPresentationManager keeps track of the object having input focus.
It is this object which will receive user input such as keyboard keys or
screen pointer actions.
PegPresentationManager::Execute
is the main execution loop within the KwikPeg Task.
This member function is executed by the KwikPeg Task once you have started your
KwikPeg application. Execution continues until you GUI application chooses to
shut down, if ever. It is the magic of the KwikPeg OS Interface that ensures that
the rest of your application continues to operate without interference by KwikPeg.
|
|
 |
 |
|
PegWindow
Viewports
Starting and Stopping KwikPeg
Application GUI Hooks
Constructors:
 |
 |
PegPresentationManager(PegRect &Size)
|
This constructor
determines the size in pixels of the PegPresentationManager window.
Rectangle Size determines
the outer limits of your child windows and controls. PegPresentationManager
is normally sized to equal the pixel dimensions of the display device.
Public Functions:
 |
 |
void Add(PegThing *What, BOOL bDraw = TRUE)
|
PegPresentationManager
overrides the Add() function to set focus to newly added top-level windows.
 |
 |
void CapturePointer(PegThing *Who)
|
This function can
be called to capture all screen pointer input. This is done by modal windows
during resize and move operations. It can also be done by the application
level software at any time. The application software should call ReleasePointer()
to end the CapturePointer() operation.
 |
 |
void ClearScratchPad(void)
|
This function resets the PegPresentationManager
scratchpad buffer and frees the associated memory.
 |
 |
virtual SIGNED DispatchMessage(PegThing *From, PegMessage *pSend)
|
This function, used only by the KwikPeg Presentation Manager,
routes a message to the correct object.
The routing follows a predetermined precedence order:
| 1) |
If the message has a non-NULL pTarget value,
route to the object specified by pTarget.
|
| 2) |
If the message is a screen pointer message, route to lowest level object
that can handle pointer position changes. |
| 3) |
If the message is any other system message, route to object which has focus.
|
| 4) |
If the message is a custom user defined message and the iData
message member is not 0, the Find() function is called to locate
the object with an object ID matching iData. If such an object
is found, the message is routed to that object.
Otherwise, the message is ignored.
|
 |
 |
void Draw(void)
|
PegPresentationManager
overrides the Draw() function to provide a simplified and faster drawing
routine and to draw the wallpaper bitmap, if required. Custom implementations
often override PegPresentationManager::Draw to implement hardware alpha
blending and other custom operations.
 |
 |
SIGNED Execute(void)
|
PegPresentationManager
overrides the PegWindow::Execute function to provide the main KwikPeg message
looping operation. This function is used only by the KwikPeg Presentation Manager.
 |
 |
PegThing *FindLowestThingContaining(PegThing *Start, PegPoint Where)
|
This function determines
the lowest child object that contains the point Where. The object must
be enabled and selectable. A pointer to the child object is returned.
 |
 |
PegThing *GetCurrentThing(void)
|
This function returns
a pointer to the leaf object which has input focus. This function will
return NULL if no object has input focus.
 |
 |
PegThing *GetPointerOwner(void)
|
This function returns a pointer to the object, if any,
that has captured the screen pointer.
Otherwise, this function will return NULL.
 |
 |
PEGCHAR *GetScratchPad(void)
|
This function returns
a pointer to the text string which has been copied to the scratchpad or
NULL if no string is available.
The PegPresentationManager scratchpad is used
to cut, copy and paste strings between PegString,
PegTextBox and PegTerminalWin classes.
 |
 |
BOOL IsPointerCaptured(void)
|
Returns TRUE if
the screen pointer is captured, else FALSE.
 |
 |
PegThing *LastPointerOver(void)
|
This function returns a pointer to the object, if any,
that the screen pointer was last over.
Otherwise, this function will return NULL.
 |
 |
void LastPointerOver(PegThing *pOver)
|
This function establishes the object referenced by parameter
pOver as the object that the screen pointer
was last over. Set pOver to NULL
to indicate that the screen pointer is no longer
over any object.
 |
 |
SIGNED Message(const PegMessage &Mesg)
|
PegPresentationManager
overrides the Message() function to provide additional input focus adjustment
and shutdown services.
 |
 |
void MoveFocusTree(PegThing *Current)
|
Makes Current the
input object and forces the branch of the display tree containing Current
to get focus. This function may be called at any time to move the input
focus to any visible object.
 |
 |
void NullInput(PegThing *Current)
|
Resets the PegPresentationManager
input focus status if Current is the object which has input focus. Also
resets the input focus if a child of object Current has input focus.
 |
 |
void ReleasePointer(PegThing *Who)
|
Releases a captured screen pointer.
This function should always be called after the CapturePointer()
function to return to normal operation.
 |
 |
PegThing *Remove(PegThing *What, BOOL bDraw = TRUE)
|
PegPresentationManager
overrides the Remove() function to check objects as they are removed.
If all objects are removed from a top-level window,
PegPresentationManager sends a PM_EXIT message to itself.
If no other top-level windows exist when the PM_EXIT message is
serviced, PegPresentationManager returns from its Execute()
function, forcing the KwikPeg Task to shut down.
 |
 |
void SetScratchPad(PEGCHAR *pText)
|
This function copies the indicated text
string into the PegPresentationManager scratchpad buffer.
The scratchpad buffer is used by
user editable text objects which support cut, copy and paste operations.
 |
 |
void SetWallpaper(PegBitmap *pBm)
|
This function assigns
a PegBitmap that PegPresentationManager will tile over
the entire screen background. By default, there is no wallpaper bitmap.
To remove a wallpaper bitmap, use NULL as the bitmap pointer
parameter pBm.
A solid color background
can also be specified by setting the PegPresentationManager's
PCI_NORMAL color index as follows:
Presentation()->SetColor(PCI_NORMAL, GREEN);
Protected Members:
 |
 |
void ChangeInputThing(PegThing *Who)
|
This function gives the keyboard input device
to the object referenced by parameter Who.
The object will receive a PM_GAINED_KEYBOARD message.
The object, if any, that previously owned the keyboard will
receive a PM_LOST_KEYBOARD message.
 |
 |
void InsureBranchHasFocus(PegThing *Current)
|
This function ensures
that object Current has input focus and sends
PM_CURRENT messages to the new input object if required.
 |
 |
void KillFocus(PegThing *Start)
|
This function removes input focus
from the specified object.
It also sends PM_NONCURRENT messages to the objects which are losing
focus, if required.
 |
 |
void SetFocus(PegThing *Start)
|
This function assigns input focus
to the specified object.
It also sends PM_CURRENT messages to the new input object if required.
 |
 |
PegThing *mpInputThing
|
Pointer to the object
which has input focus, or NULL.
 |
 |
PegThing *mpLastPointerOver
|
Pointer to the object which
the screen pointer was last over, or NULL.
 |
 |
PEGCHAR *mpScratchPad
|
Pointer to the current string
contained in the scratchpad buffer, or NULL.
 |
 |
PegBitmap *mpWallpaper
|
Pointer to the currently assigned wallpaper bitmap, or NULL.
 |
 |
UCHAR muPointerCaptures
|
Indicates the current pointer
capture nesting level. If there are no outstanding pointer captures,
muPointerCaptures is 0.