
Home |
|
PegDecoratedWindow
|

Examples |

Index |
|
|
|
 |
|
Overview |
Derived from class
PegWindow
|
 |
|
The PegDecoratedWindow class provides a window
that supports the addition of common window decorations such as a
title bar (PegTitle), a menu (PegMenuBar),
a status bar (PegStatusBar) and
a tool bar (PegToolBar).
The PegDecoratedWindow class
makes it trivial to add (remove) these decorations to (from) a window.
It also maintains the content of these objects within the client area of
the decorated window.
Like all KwikPeg objects, a
PegDecoratedWindow object can have any other type of child
object added to it.
You can even nest PegDecoratedWindow objects within other
decorated windows.
|
|
PegMenuBar
PegStatusBar
PegTitle
PegToolBar
PegDialog
PegMessageWindow
PegMLMessageWindow
The PegDecoratedWindow class supports
the following style flags:
FF_NONE | No frame. |
FF_THIN | Thin frame. |
FF_THICK | Thick 3D frame. |
FF_RAISED | Raised 3D frame. |
FF_RECESSED | Recessed 3D frame. |
Constructors:
 |
 |
PegDecoratedWindow(const PegRect &Rect,
|
| |

WORD wStyle = FF_THICK)
|
This constructor creates a
PegDecoratedWindow object at a specific location within a
rectangle specified by parameter Rect.
The rectangle defines the mReal position of the window.
 |
 |
PegDecoratedWindow(WORD wStyle = FF_THICK)
|
This constructor creates a
PegWindow object.
The size and position of the window must be specified after the window has been
constructed but before the window is first displayed.
Public Functions:
 |
 |
virtual void Add(PegThing *What,
|
| |

BOOL bDraw = TRUE)
|
The PegDecoratedWindow class
overrides the Add() function to detect
the addition of non-client area decorations.
 |
 |
virtual void InitClient(void)
|
The PegDecoratedWindow class
overrides the InitClient() function to resize the client area
based on the presence or absence of a title bar, menu bar, status bar
or tool bar.
 |
 |
PegMenuBar *MenuBar(void)
|
This function returns
a pointer to the PegMenuBar object which has been added
to the decorated window. The function returns NULL if
the window has no menu bar.
 |
 |
virtual SIGNED Message(const PegMessage &Mesg)
|
The PegDecoratedWindow class
catches the PM_CURRENT and PM_NONCURRENT messages
in order to properly draw the window and its child objects as
the window gains or loses focus.
 |
 |
virtual PegThing *Remove(PegThing *Who,
|
| |

BOOL bDraw = TRUE)
|
The PegDecoratedWindow class
overrides the Remove() function to detect the
removal of non-client area decorations
 |
 |
void SetTitle(PEGCHAR *Text)
|
This function sets the text string assigned as the
window's title.
 |
 |
PegStatusBar *StatusBar(void)
|
This function returns
a pointer to the PegStatusBar object which has been added
to the decorated window. The function returns NULL if
the window has no status bar.
 |
 |
const PEGCHAR *Title(void)
|
This function returns
a pointer to the current title string assigned to the decorated window.
The function returns NULL if
the window has no title string.
 |
 |
PegTitle *TitleObject(void)
|
This function returns
a pointer to the current PegTitle assigned to the
decorated window.
The function returns NULL if the window has no title object.
 |
 |
PegToolBar *ToolBar(void)
|
This function returns
a pointer to the PegToolBar object which has been added
to the decorated window. The function returns NULL if
the window has no tool bar.
The following example illustrates a PegDecoratedWindow
object containing a title bar, menu bar and status bar. The decorated
window also contains a PegWindow child in its client area.
The source code for this example is provided in the
KPGnnn\EXAMPLES\KPG_DEMO installation directory.
