home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
VSCPPv8.zip
/
VACPP
/
IBMCPP
/
samples
/
IOC
/
MSGBOX
/
MSGBOX.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1995-04-07
|
5KB
|
111 lines
#ifndef _MSGBOX_
#define _MSGBOX_
/*****************************************************************************
* FILE NAME: msgbox.hpp (Message Box Sample Program) *
* *
* COPYRIGHT: Copyright (C) International Business Machines Corp., 1992,1995. *
* *
* DISCLAIMER OF WARRANTIES: *
* The following [enclosed] code is sample code created by IBM *
* Corporation. This sample code is not part of any standard IBM product *
* and is provided to you solely for the purpose of assisting you in the *
* development of your applications. The code is provided "AS IS", *
* without warranty of any kind. IBM shall not be liable for any damages *
* arising out of your use of the sample code, even if they have been *
* advised of the possibility of such damages. *
*****************************************************************************/
//NOTE: WE RECOMMEND USING A FIXED-SPACE FONT TO LOOK AT THE SOURCE.
/**************************************************************************
* IBM User Interface Class Library - Message Box Sample *
* The purpose of this sample application is to show various types of *
* message boxes. A frame window with an IMultiLineEdit client window *
* is used to display information about the progress of the sample. *
* Information is also traced to the trace destination. Tracing *
* information is turned on by setting the ICLUI_TRACE environment *
* variable to ON and the destination is set using the ICLUI_TRACETO *
* environment variable. *
**************************************************************************/
//Include User Interface Class Library class headers:
#ifndef _IMSGBOX_
#include <imsgbox.hpp> //Include IMessageBox class header
#endif
#ifndef _IWINDOW_
#include <iwindow.hpp> //Include IWindow class header
#endif
#ifndef _IFRAME_
#include <iframe.hpp> //Include IFrameWindow class header
#endif
#ifndef _IEXCEPT_
#include <iexcept.hpp> //Include IException class header
#endif
#ifndef _IRESLIB_
#include <ireslib.hpp> //Include IResourceId class header
#endif
#ifndef _ITRACE_
#include <itrace.hpp> //Include ITrace class header
#endif
#ifndef _ISTRING_
#include <istring.hpp> //Include IString class header
#endif
#ifndef _IHELP_
#include <ihelp.hpp> //Include IHelpWindow class header
#endif
#ifndef _IMLE_
#include <imle.hpp> //Include IMultiLineEdit class header
#endif
#ifndef _ICCONST_
#include <icconst.h> //Include IC_* constants
#endif
#include "msgbox.h" //Include symbolic definitions
/**************************************************************************
* Class: AMsgBoxDemo *
* *
* Purpose: New class that displays a series of message boxes with status *
* being written to this frame's client, an IMultiLineEdit object.*
* This class inherits from IFrameWindow. *
* *
**************************************************************************/
class AMsgBoxDemo : public IFrameWindow
{
public:
AMsgBoxDemo(unsigned long windowId); //Constructor
virtual ~AMsgBoxDemo() { }; //Default destructor
/*--------------------- Run Message Box Demonstration --------------------|
| The runDemo function loops through a series of IMessageBox::show |
| function calls, with the final show prompting the user for another |
| time through the loop. This function traces its progress to the |
| ITrace destination and to the IMultiLineEdit window in the frame. |
|------------------------------------------------------------------------*/
AMsgBoxDemo
&runDemo();
protected:
/*--------------------- Run Message Box Demonstration --------------------|
| The following protected functions are used by runDemo to produce the |
| demonstration: |
| traceReply - Formats the message box reply to an IString, traces |
| traces the IString to the ITrace destination, |
| returns the IString to the caller. |
| throwException - Generates an IAccessError to demonstrate use of |
| a message box to display an exception. |
|------------------------------------------------------------------------*/
AMsgBoxDemo
&traceReply(IMessageBox::Response);
void
throwException();
private:
IMultiLineEdit mbResponses;
IMessageBox mb;
IHelpWindow mbHelp;
AMsgBoxDemo(const AMsgBoxDemo&); //Default copy constructor
AMsgBoxDemo
&operator=(const AMsgBoxDemo&); //Default assignment operator
};
#endif