home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
VSCPPv8.zip
/
VACPP
/
IBMCPP
/
samples
/
IOC
/
HELLO5
/
AHELLOW5.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1995-04-07
|
14KB
|
189 lines
#ifndef _AHELLOW5_
#define _AHELLOW5_
/*****************************************************************************
* HELLO WORLD SAMPLE PROGRAM - Version 5: Class Header (ahellow5.hpp) *
* *
* 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.
#ifndef _IFRAME_ //V2
#include <iframe.hpp> //Include IFrameWindow class header V2
#endif //V2
#ifndef _ISTATTXT_ //V2
#include <istattxt.hpp> //Include IStaticText class header V2
#endif //V2
#ifndef _IINFOA_ //V2
#include <iinfoa.hpp> //Include IInfoArea class header V2
#endif //V2
#ifndef _IMENUBAR_ //V3
#include <imenubar.hpp> //Include IMenuBar class header V3
#endif //V3
#ifndef _ICMDHDR_ //V3
#include <icmdhdr.hpp> //Include ICommandHandler class header V3
#endif //V3
#ifndef _ISETCV_ //V4
#include <isetcv.hpp> //Include ISetCanvas class header V4
#endif //V4
#ifndef _IPUSHBUT_ //V4
#include <ipushbut.hpp> //Include IPushButton class header V4
#endif //V4
#ifndef _ISPLITCV_ //V5
#include <isplitcv.hpp> //Include ISplitCanvas class header V5
#endif //V5
#ifndef _ILISTBOX_ //V5
#include <ilistbox.hpp> //Include IListBox class header V5
#endif //V5
#ifndef _ISELHDR_ //V5
#include <iselhdr.hpp> //Include ISelectHandler class header V5
#endif //V5
#ifndef _IHELPHDR_ //V5
#include <ihelphdr.hpp> //Include IHelpHandler class header V5
#endif //V5
#ifndef _IHELP_ //V5
#include <ihelp.hpp> //Include IHelpWindow class header V5
#endif //V5
#ifndef _AEARTHW5_ //V5
#include "aearthw5.hpp" //Include AEarthWindow class header V5
#endif //V5
//Forward declarations for other classes:
class AHelloWindow; //V3
/************************************************************************** V3
* Class: ACommandHandler * V3
* * V3
* Purpose: New Command Handler class that handles commands * V3
* specifically for AHelloWindow class windows. * V3
* * V3
**************************************************************************/ //V3
class ACommandHandler : public ICommandHandler { //V3
public: //V3
ACommandHandler(AHelloWindow *helloFrame); //V3
virtual ~ACommandHandler() { } //V3
protected: //V3
/*------------------------ Override Command Function ---------------------| V3
| The command function is called to handle application command events. | V3
|------------------------------------------------------------------------*/ //V3
virtual Boolean //V3
command(ICommandEvent& cmdEvent); //V3
private: //V3
AHelloWindow *frame; //V3
}; //V3
/************************************************************************** V5
* Class: ASelectHandler * V5
* * V5
* Purpose: New Select Handler class that handles list box selections * V5
* specifically for AHelloWindow class windows. * V5
* * V5
**************************************************************************/ //V5
class ASelectHandler : public ISelectHandler { //V5
public: //V5
ASelectHandler(AHelloWindow *helloFrame); //V5
virtual ~ASelectHandler() { } //V5
protected: //V5
/*------------------------ Override Selected Function --------------------| V5
| The selected() function is called to handle list box selection events. | V5
|------------------------------------------------------------------------*/ //V5
virtual Boolean //V5
selected(IControlEvent& ctlEvent); //V5
private: //V5
AHelloWindow *frame; //V5
};
/************************************************************************** V5
* Class: AHelpHandler * V5
* * V5
* Purpose: New Help Handler class that only overrides one * V5
* IHelpHandler function, keysHelpId(). If keysHelpId() * V5
* is not overridden, then the default action sets the event * V5
* result to zero, which indicates that no action is required, * V5
* that is, no help information for keys is displayed. * V5
**************************************************************************/ //V5
class AHelpHandler : public IHelpHandler { //V5
public: //V5
virtual ~AHelpHandler() { } //V5
protected: //V5
/*----------------------- Override keysHelpId Function -------------------| V5
| The keysHelpId() function is called to set the event result to the | V5
| ID within the Hello World help libraries for Keys Help. | V5
|------------------------------------------------------------------------*/ //V5
virtual Boolean //V5
keysHelpId(IEvent& evt); //V5
};
/************************************************************************** V2
* Class: AHelloWindow * V2
* * V2
* Purpose: Main Window class for C++ Hello World sample application. * V2
* It is derived from IFrameWindow class. * V2
* * V2
**************************************************************************/ //V2
class AHelloWindow : public IFrameWindow //V2
{ //V2
public: //V2
AHelloWindow(unsigned long windowId); //V2
virtual ~AHelloWindow(); //Destructor for this class v3
/*------------------------ Hello Text Alignment --------------------------| V3
| The following enumeration type is used to specify the alignment of | V3
| text in the hello static text window. | V3
|------------------------------------------------------------------------*/ //V3
enum Alignment //V3
{ //V3
left, center, right //V3
}; //V3
/*---------------------- Hello Static Text Functions ---------------------| V3
| These functions are used to change the hello static text window. | V3
| setAlignment - Align the static text horizontally. The text is | V3
| always centered vertically by design. | V3
| editText - Use a modal dialog window to edit the text in the static | V4
| text window. | V4
| setTextFromListBox - Set the text to the first selected item in the | V5
| list box. | V5
|------------------------------------------------------------------------*/ //V3
virtual AHelloWindow //V3
&setAlignment(Alignment alignment), //V3
&editText(), //V4
&setTextFromListBox(); //V5
private: //V2
IMenuBar menuBar; //V3
IStaticText statusLine; //V3
ISplitCanvas clientWindow; //V5
ISplitCanvas helloCanvas; //V5
IStaticText hello; //V2
AEarthWindow earthWindow; //V5
IListBox listBox; //V5
ISetCanvas buttons; //V4
IPushButton leftButton; //V4
IPushButton centerButton; //V4
IPushButton rightButton; //V4
IPushButton helpButton; //V5
IInfoArea infoArea; //V2
ACommandHandler commandHandler; //V3
ASelectHandler selectHandler; //V5
AHelpHandler helpHandler; //V5
IHelpWindow helpWindow; //V5
AHelloWindow(const AHelloWindow&); //Default copy constructor V2
AHelloWindow //V2
&operator=(const AHelloWindow&); //Default assignment operator V2
}; //V2
#endif //V2