Home |
Class PegMLMessageWindow HMI (Human-Machine Interface) Classes |
Class PegMLMessageWindowPegMLMessageWindow is a popup window class for display warning, error, or other status information to the user. The basic behavior of this class is identical to the PegMessageWindow class, except that this class allows the display of multiple lines of text in the message. The PegMLMessageWindow class provides a quick way to display information messages. PegMLMessageWindow may contain a title bar, several message lines, and miscellaneous buttons. PegMLMessageWindow supports both modal and non-modal execution. In addition, the signal generated when the MessageWindow is closed by the user may be directed to any top-level window. Modal execution is achieved by calling the Execute() function. Execute() will add the window to PegPresentationManager if the window has no parent at the time Execute() is called. Execute() will not return until the user selects one of the window option buttons. Execute() will return the ID of the option button selected to close the window. Several button ID values are reserved by RTPEG-32 for use with PegMLMessageWindow (and PegDialog). These ID values correlate to the common options presented on a message window. Additional options may be presented by deriving from and extending the PegMLMessageWindow class. The buttons included on the message window are specified by the message window style flags. There is one style flag for each of the pre-defined message window buttons. class PegMLMessageWindow : public PegWindow { public: PegMLMessageWindow(const PegRect &Rect, const PEGCHAR * Title, const PEGCHAR * Message = NULL, PEGUINT wStyle = MW_OK|FF_RAISED, PegBitmap * pIcon = NULL, PegThing * Owner = NULL); PegMLMessageWindow(const PEGCHAR * Title, const PEGCHAR * Message = NULL, PEGUINT wStyle = MW_OK|FF_RAISED, PegBitmap * pIcon = NULL, PegThing * Owner = NULL); virtual void Draw(void); virtual PEGINT Message(const PegMessage& Mesg); }; Style FlagsFF_NONE, FF_THIN, FF_RAISED, FF_RECESSED, FF_THICK, MW_OK, MW_YES, MW_NO, MW_ABORT, MW_RETRY, MW_CANCEL. ConstructorsThe first constructor allows you to specify the overall message window size. This constructor is used in cases where you would like to add additional decorations to the message window. If the size of the window is specified with a PegRect and the message text is too large to fit in the available space, the sizing algorithm will grow the height of the rectangle until all of the text fits properly. The left, top and right members of the specified rectangle will not change, only the bottom. When the second constructor is used, the message window calculates the required height and width of the window in order to fit the message text and all specified option buttons. The second constructor is most commonly used. The pIcon parameter allows you to specify a bitmap that will be displayed to the left of the text message. The Owner pointer allows you to specify a window that should receive a PM_MWCOMPLETE message. This is only useful when the message window is not executed modally. When the window is executed modally, the Execute() function returns the ID of the button used to close the message window. Method DrawPegMLMessageWindow overrides the Draw() function to display the message text and bitmap, if specified, in the window client area. Method MessagePegMLMessageWindow catches option button signals to close the message window.
|