home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
SAMPLES
/
ICLUI
/
HELLO6
/
AHELLOW6.HPP
< prev
next >
Wrap
Text File
|
1993-05-12
|
10KB
|
139 lines
#ifndef AHELLOWINDOW_HPP
#define AHELLOWINDOW_HPP
/******************************************************************************/
/* HELLO WORLD SAMPLE PROGRAM - Version 6: Class Header (AHELLOW6.HPP) */
/* */
/* COPYRIGHT: Copyright (C) International Business Machines Corp., 1992,1993. */
/* */
/* 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
#include <iframe.hpp> //Include IFrameWindow Class Header
#include <icmdhdr.hpp> //Include ICommandEvent & ICommandHandler v3
#include <ihelphdr.hpp> //Include IHelpHandler v5
#include <imenuhdr.hpp> //Include IMenuHandler v6
#include <iselhdr.hpp> //Include ISelectHandler v5
#include "atimehdr.hpp" //Include ATimerHandler v6
class ATextDialog; //Define the ATextDialog Class v4
class AEarthWindow; //Define the AEarthWindow Class v5
class IInfoArea; //Define the IInfoArea Class v6
class IMenuBar; //Define the IMenuBar Class v6
class IHelpWindow; //Define the IHelpWindow Class v6
class ISplitCanvas; //Define the ISplitCanvas Class v6
class IListBox; //Define the IListBox Class v6
class IStaticText; //Define the IStaticText Class v6
//**************************************************************************
// Class: AHelloWindow *
// *
// Purpose: Main Window for C++ Hello World sample application *
// It is a subclass of IFrameWindow, ICommandHandler, * v3
// ISelectHandler (Processing List Box Selection) and * v5
// ATimeHandler (Processing of Time Events) * v6
// *
//**************************************************************************
class AHelloWindow : public IFrameWindow,
public ICommandHandler, //v3
public ISelectHandler, //v5
public ATimeHandler //v6
{
public: //Define the Public Information
AHelloWindow(unsigned long windowId); //Constructor for this class
virtual ~AHelloWindow(); //Virtual Destructor for this class
virtual int speed(); //Return Demo Speed v6
virtual Boolean setSpeed(int value);//Set Demo Speed v6
protected: //Define Protected Member v3
virtual Boolean setupButtons(); //Setup Buttons v4
virtual Boolean setupClient(); //Setup Client Window v5
virtual Boolean setupHelp(); //Setup Help .
virtual Boolean setupInfoArea() ; //Setup Information Area .
virtual Boolean setupMenuBar(); //Setup Menu Bar .
virtual Boolean setupStatusArea(); //Setup Status Area v5
virtual Boolean selected(IControlEvent& evt); //v5
Boolean command(ICommandEvent& cmdEvent); //v3
virtual Boolean setLeftAlignment(); //Process Left Alignment v6
virtual Boolean setCenterAlignment();//Process Center Alignment .
virtual Boolean setRightAlignment();//Process Right Alignment v6
virtual Boolean setText(const char* text);//Set Text using String v5
virtual Boolean setText(const IResourceId& text);//Set Text via Resource v6
virtual Boolean openFile(); //Process OpenFile .
virtual Boolean openFont(); //Process OpenFont .
virtual Boolean openText(); //Process OpenText v6
virtual Boolean tick(IEvent& evt); //Send Tick for every WM_TIMER v6
virtual Boolean startDemo(); //Start Demo v6
virtual Boolean stopDemo(); //Stop Demo .
virtual Boolean nextDemoCode(); //Execute the next Demo Code v6
virtual Boolean openColor(); //Open Color Window v6
virtual Boolean openSpeed(); //Open Demo Speed Window v6
virtual Boolean readProfile(); //Read Profile v6
virtual Boolean updateProfile(); //Update Profile v6
private: //Define Private Information
IStaticText * hello; //Hello contains "Hello, World" text
IInfoArea * infoArea; //Define an Information Area v2
// Control to create an information .
// area beneath the client area v2
IStaticText * statusLine; //Status Line at top of client window v3
IMenuBar * menuBar; //Define Menu Bar v3
ATextDialog * textDialog; //Define Text Dialog v4
IPushButton * leftButton; //Define Left Button .
IPushButton * centerButton; //Define Center Button .
IPushButton * rightButton; //Define Right Button v4
IHelpWindow * help; //Define Help Window v5
AEarthWindow * earthWindow; //Define earthWindow v5
ISplitCanvas * clientWindow; //Define canvas as a Split Canvas v5
ISplitCanvas * helloCanvas; //Define hello canvas v5
IListBox * listBox; //Define ListBox v5
ISplitCanvas * statusCanvas; //Define status canvas v6
IStaticText * time; //Current Time v6
IStaticText * date; //Current Date v6
IString filename; //Name of File for Input/Output .
int demoIndex; //Demo Index .
Boolean demo; //Demo Flag .
int demoTicks; //Number of Ticks for each Demo .
int demoCount; //Counter for Timer v6
};
//************************************************************************** v6
// Class: AMenuHandler * .
// * .
// Purpose: Subclass of IMenuHandler so that the a PopUp Menu can be * .
// created. * .
// * .
//************************************************************************** .
class AMenuHandler: public IMenuHandler// .
{ // .
protected: //Define Protected Member .
Boolean makePopUpMenu(IMenuEvent& menuEvent); //v6
}; //v6
//************************************************************************** v5
// Class: AHelpHandler * .
// * .
// Purpose: Subclass of IHelpHandler so that the correct keys help * .
// panel can be displayed when keys help is requested. * .
// * .
//************************************************************************** .
class AHelpHandler: public IHelpHandler// .
{ // .
protected: //Define Protected Member .
virtual Boolean // .
keysHelpId(IEvent& evt); //Override this function .
}; //v5
#endif