KwikPeg Manuals
Home
PegDialog
Examples
Examples
Index
Index


Members
Styles
Signals
(none)
Overview Derived from class PegDecoratedWindow

The PegDialog class provides a decorated window for use as a dialog window. A dialog window is usually drawn with a frame and client area color which distinguishes it from other windows. The dialog window can have an optional title bar.

The PegDialog class supports modal and non-modal execution. A dialog window executes as a modal window when your application calls the window's Execute() member function. If the dialog window has no parent, it will be added to the invisible window maintained by the KwikPeg Presentation Manager, making the dialog window a top-level window.

Because dialog windows are intended for interactive dialog with a user, they attach special significance to buttons (objects) with the following reserved KwikPeg object IDs:

IDB_CLOSE
IDB_OK
IDB_CANCEL
IDB_ABORT
IDB_RETRY
IDB_YES
IDB_NO
IDB_APPLY

When an object with one of these reserved object IDs is selected, the dialog window will be closed. When defining a dialog window, you should ensure that at least one button added to the dialog is constructed with one of these object ID values. Otherwise, the dialog window will remain active forever unless some custom object added to the window forces the window to close.

When the dialog window is signalled by an object with one of these reserved object IDs, it sends a PM_DIALOG_NOTIFY message to its parent window to indicate that the dialog has been completed. The message iData member will contain the object ID of the object that terminated the dialog. In all cases (except for object ID IDB_APPLY), the dialog window will be closed after the parent window has received the PM_DIALOG_NOTIFY message.

If the dialog window is being executed modally, the Execute() member function will return to its caller, passing it the object ID of the button (object) that forced the dialog window to close.

When the IDB_APPLY object ID is detected, the dialog window sends the PM_DIALOG_NOTIFY message to its parent but the dialog window does not close.

When a dialog window is closed, the PM_DIALOG_NOTIFY message is normally directed to the dialog window's parent. However, when a dialog window is created, you can specify an alternate ReportTo window which will receive the closure notification instead of the parent.



 See Also

PegMessageWindow

PegMLMessageWindow



 Styles

The PegDialog 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.

Top of page


 Members

Constructors:

PegDialog(const PegRect &Rect,
  const PEGCHAR *Title = NULL,
  PegThing *ReportTo = NULL,
  WORD wStyle = FF_RAISED)
PegDialog(const PEGCHAR *Title = NULL,
  PegThing *ReportTo = NULL,
  WORD wStyle = FF_RAISED)

The first constructor creates a PegDialog object at a specific location within a rectangle specified by parameter Rect. The rectangle defines the mReal position of the window.

The second constructor creates a PegDialog object for which the size and position will be specified after the window has been constructed but before the window is first displayed.

For both constructors, parameter Title defines the title string to be placed in a title bar at the top of the dialog window. The title bar will include a system button and a close button. If Title is NULL, the dialog window will have no title bar.

For both constructors, parameter ReportTo identifies the KwikPeg object (window or control) to which the dialog window is to report when the window is closed. If ReportTo is NULL, the completion notice will be sent to the dialog window's parent.

 

Public Functions:

virtual SIGNED Message(const PegMessage &Mesg)

The PegDialog class overrides the Message() function to detect signals generated by objects having any of the reserved object IDs. The message is translated to a PM_DIALOG_NOTIFY message which is sent to the dialog window's parent or to the window to which the dialog has been advised to report.


Top of page


 Examples

The following example illustrates a PegDialog object containing a number of different child objects. The source code for a similar example is provided in the KPGnnn\EXAMPLES\KPG_DEMO installation directory.




Top of page
KwikPeg Manuals
Home
Index
Index

 
Copyright © 2000-2003