Home |
Class PegDecoratedWindow HMI (Human-Machine Interface) Classes |
Class PegDecoratedWindowPegDecoratedWindow is a PegWindow derived class that supports the addition of common window decorations such as PegTitle, PegMenuBar, and and PegStatusBar. PegDecoratedWindow provides functions to facilitate easy access to the decorations added to the window. PegDecoratedWindow also maintains the actual client area available after the addition or removal of any of these decorations. Like all PEG objects, PegDecoratedWindow can also have any other types of child objects added. You can even nest PegDecoratedWindow objects with themselves, creating complex and interesting window types. class PegDecoratedWindow : public PegWindow { public: PegDecoratedWindow(const PegRect &Rect, PEGUINT wStyle = FF_THICK); PegDecoratedWindow(PEGUINT wStyle = FF_THICK); virtual void Add(PegThing * What, BOOL bDraw = TRUE); virtual PegThing * Remove(PegThing * Who, BOOL bDraw = TRUE); virtual PEGINT Message(const PegMessage &Mesg); virtual void InitClient(void); PegStatusBar * StatusBar(void); PegMenuBar * MenuBar(void); const PEGCHAR * Title(void); void SetTitle(const PEGCHAR * Text); protected: PegTitle * mpTitle; PegMenuBar * mpMenuBar; PegStatusBar * mpStatusBar; }; Demo program PegDemo uses this class. Style FlagsFF_NONE, FF_THIN, FF_RAISED, FF_RECESSED, FF_THICK. ConstructorsThe first constructor defines the window size and position at the time the window is created. The second requires that the window size and position be determined after the window is constructed, but before the window is displayed. Method AddAdd catches the addition of non-client decorations. Method InitClientInitClient resizes the client area based on the presence, or absence, of a title bar, menu bar and status bar. Method MenuBarReturns a pointer to the PegMenuBar added to the window, or NULL if no menu bar is present. Method MessageCatches the PM_CURRENT and PM_NONCURRENT messages. Method RemoveThe Remove() function catches the removal of non-client decorations. Method SetTitleModifies the window title. Method StatusBarReturns a pointer to the decorated window status bar, or NULL if no status bar is present. Method TitleReturns a pointer to the decorated window title, or NULL if no title is present. ExampleThe following is a decorated window with a title bar, status bar, and menu bar. The decorated window also contains a PegWindow child in the decorated window client area. The full source code for this window can be found in the file Pegdemo.cpp.
|