home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1994, by WATCOM International Inc. All rights %
- % reserved. No part of this software may be reproduced or %
- % used in any form or by any means - graphic, electronic or %
- % mechanical, including photocopying, recording, taping or %
- % information storage and retrieval systems - except with the %
- % written permission of WATCOM International Inc. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- /*************************************************************************
- *
- * WMessageBox -- Wrapper for the Windows 95 Message box control.
- *
- * Events:
- *
- *************************************************************************/
-
- #ifndef _WMSGDLG_HPP_INCLUDED
- #define _WMSGDLG_HPP_INCLUDED
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,8);
- #pragma enum int;
- #endif
-
- #ifndef _WOBJECT_HPP_INCLUDED
- # include "wobject.hpp"
- #endif
-
- class WMessageBox;
- class WWindow;
-
- enum WMessageBoxReturn {
- WMBReturnOk = 1,
- WMBReturnCancel = 2,
- WMBReturnAbort = 3,
- WMBReturnRetry = 4,
- WMBReturnIgnore = 5,
- WMBReturnYes = 6,
- WMBReturnNo = 7,
- WMBReturnClose = 8,
- WMBReturnHelp = 9,
- WMBReturnUnknown = 10,
- };
-
- typedef WStyle WMsgBStyle;
-
- //
- // MessageBox styles
- //
-
- #define WMsgBSOk ((WMsgBStyle)0x00000000L)
- #define WMsgBSOkCancel ((WMsgBStyle)0x00000001L)
- #define WMsgBSAbortRetryIgnore ((WMsgBStyle)0x00000002L)
- #define WMsgBSYesNoCancel ((WMsgBStyle)0x00000003L)
- #define WMsgBSYesNo ((WMsgBStyle)0x00000004L)
- #define WMsgBSRetryCancel ((WMsgBStyle)0x00000005L)
-
- #define WMsgBSIconError ((WMsgBStyle)0x00000010L)
- #define WMsgBSIconQuestion ((WMsgBStyle)0x00000020L)
- #define WMsgBSIconWarning ((WMsgBStyle)0x00000030L)
- #define WMsgBSIconInformation ((WMsgBStyle)0x00000040L)
- #define WMsgBSIconHand WMsgBSIconError
- #define WMsgBSIconStop WMsgBSIconError
- #define WMsgBSIconExclamation WMsgBSIconWarning
- #define WMsgBSIconAsterisk WMsgBSIconInformation
-
- #define WMsgBSDefButton1 ((WMsgBStyle)0x00000000L)
- #define WMsgBSDefButton2 ((WMsgBStyle)0x00000100L)
- #define WMsgBSDefButton3 ((WMsgBStyle)0x00000200L)
- #define WMsgBSDefButton4 ((WMsgBStyle)0x00000300L)
-
- #define WMsgBSApplModal ((WMsgBStyle)0x00000000L)
- #define WMsgBSApplicationModal ((WMsgBStyle)0x00000000L)
- #define WMsgBSSystemModal ((WMsgBStyle)0x00001000L)
- #define WMsgBSTaskModal ((WMsgBStyle)0x00002000L)
- #define WMsgBSHelp ((WMsgBStyle)0x00004000L)
-
- #define WMsgBSLeft ((WMsgBStyle)0x00000000L)
- #define WMsgBSRight ((WMsgBStyle)0x00080000L)
-
- #define WMsgBSRtlReading ((WMsgBStyle)0x00100000L)
-
- #define WMsgBSNoFocus ((WMsgBStyle)0x00008000L)
- #define WMsgBSSetForeground ((WMsgBStyle)0x00010000L)
- #define WMsgBSDefaultDesktopOnly ((WMsgBStyle)0x00020000L)
- #define WMsgBSServiceNotification ((WMsgBStyle)0x00040000L)
-
- #define WMsgBSTypeMask ((WMsgBStyle)0x0000000FL)
- #define WMsgBSUserIcon ((WMsgBStyle)0x00000080L)
- #define WMsgBSIconMask ((WMsgBStyle)0x000000F0L)
- #define WMsgBSDefMask ((WMsgBStyle)0x00000F00L)
- #define WMsgBSModeMask ((WMsgBStyle)0x00003000L)
- #define WMsgBSMiscMask ((WMsgBStyle)0x0000C000L)
-
- enum WMessageBoxButton {
- WMBButtonOk = WMsgBSOk,
- WMBButtonOkCancel = WMsgBSOkCancel,
- WMBButtonAbortRetryIgnore = WMsgBSAbortRetryIgnore,
- WMBButtonYesNoCancel = WMsgBSYesNoCancel,
- WMBButtonYesNo = WMsgBSYesNo,
- WMBButtonRetryCancel = WMsgBSRetryCancel,
- };
-
- enum WMessageBoxLevel {
- WMBLevelPlain = 0,
- WMBLevelInfo = WMsgBSIconInformation,
- WMBLevelQuestion = WMsgBSIconQuestion,
- WMBLevelReminder = WMsgBSIconWarning,
- WMBLevelWarning = WMsgBSIconWarning,
- WMBLevelError = WMsgBSIconError,
- };
-
- enum WMessageBoxDefaultButton {
- WMBDefault1 = WMsgBSDefButton1,
- WMBDefault2 = WMsgBSDefButton2,
- WMBDefault3 = WMsgBSDefButton3,
- WMBDefault4 = WMsgBSDefButton4,
- };
-
- enum WMessageBoxAttribute {
- WMBAttributeNormal = WMsgBSTaskModal,
- WMBAttributeSystemModal = WMsgBSSystemModal,
- WMBAttributeNoFocus = WMsgBSNoFocus,
- WMBAttributeTaskModal = WMsgBSTaskModal,
- WMBAttributeApplModal = WMsgBSApplModal,
- WMBAttributeApplicationModal = WMsgBSApplicationModal,
- };
-
- class WCMCLASS WMessageBox : public WObject {
- WDeclareSubclass( WMessageBox, WObject );
-
- public:
-
- /*******************************************************
- * Constructors and Destructors
- *******************************************************/
-
- WMessageBox();
-
- ~WMessageBox();
-
- /*******************************************************
- * Properties
- *******************************************************/
-
- /*******************************************************
- * Methods
- *******************************************************/
-
- // Messagef
-
- static WMessageBoxReturn Messagef( WWindow * parent,
- WMsgBStyle style,
- const WChar * caption,
- const WChar * format, ... );
- static WMessageBoxReturn Messagef( WWindow * parent,
- WMessageBoxLevel level,
- WMessageBoxButton button,
- const WChar * caption,
- const WChar * format, ... );
- static WMessageBoxReturn MessageFormat( WWindow * parent,
- WMsgBStyle style,
- const WChar * caption,
- const WChar * format, ... );
- static WMessageBoxReturn MessageFormat( WWindow * parent,
- WMessageBoxLevel level,
- WMessageBoxButton button,
- const WChar * caption,
- const WChar * format, ... );
-
- // Message
-
- static WMessageBoxReturn Message( WWindow * parent, WMsgBStyle style,
- const WChar * caption,
- const WChar * text );
- static WMessageBoxReturn Message( WWindow * parent,
- WMessageBoxLevel level,
- WMessageBoxButton button,
- const WChar * caption,
- const WChar * text,
- WMessageBoxDefaultButton
- defaultButton = WMBDefault1,
- WMessageBoxAttribute
- attribute = WMBAttributeNormal );
-
- // Info
-
- static void Info( WWindow * parent, const WChar * caption,
- const WChar * format, ... );
-
- /*******************************************************
- * Others
- *******************************************************/
-
- private:
-
- static WMessageBoxReturn DoMessage( WWindow * parent,
- WMsgBStyle style,
- const WChar * text,
- const WChar * caption );
- static WMessageBoxReturn DoMessage( WWindow * parent,
- WMessageBoxLevel level,
- WMessageBoxButton button,
- const WChar * text,
- const WChar * caption,
- WMessageBoxDefaultButton
- defaultButton = WMBDefault1,
- WMessageBoxAttribute
- attribute = WMBAttributeNormal );
- };
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WMSGDLG_HPP_INCLUDED
-