home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
VSCPPv8.zip
/
VACPP
/
IBMCPP
/
samples
/
IOC
/
HELLO1
/
AHELLOW1.CPP
next >
Wrap
C/C++ Source or Header
|
1995-04-07
|
4KB
|
59 lines
/*****************************************************************************
* HELLO WORLD SAMPLE PROGRAM - Version 1: Class Implementation (ahellow1.cpp)*
* *
* 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.
/************************************************************************** V1
* C++ Hello World History and Key Functions: * V1
* Version 1: (lines with V1 in column 79-80) * V1
* - Creates and runs a simple application * V1
* - Creates the main window (IFrameWindow) * V1
* - Creates a static text control set to "Hello, World!!!" as the * V1
* client window * V1
**************************************************************************/
//Include User Interface Class Library class headers:
#ifndef _IBASE_ //Make sure ibase.hpp is included
#include <ibase.hpp> // since that is where IC_<environ>
#endif // is defined.
#include <iapp.hpp> //IApplication class V1
#include <istattxt.hpp> //IStaticText class V1
#include <iframe.hpp> //IFrameWindow class V1
/************************************************************************** V1
* main - Application entry point for Hello World Version 1. * v1
* This simple application does the following: * V1
* 1) Creates a new object mainWindow of class IFrameWindow * V1
* 2) Creates a new object hello of class IStaticText * V1
* 3) Sets the static text value and aligns it * V1
* 4) Sets the static text as the client of the mainWindow * V1
* 5) Sets the size of mainWindow * V1
* 6) Sets the window focus to mainWindow * V1
* 7) Displays the mainWindow * V1
* 8) Starts the events processing for the application * V1
**************************************************************************/
int main() //V1
{ //V1
IFrameWindow mainWindow ("Hello World Sample - Version 1", 0x1000); //V1
IStaticText hello(0x8008, &mainWindow, &mainWindow); //V1
hello.setText("Hello, World!!!"); //V1
hello.setAlignment(IStaticText::centerCenter); //V1
mainWindow.setClient(&hello); //V1
mainWindow.sizeTo(ISize(400,300)); //V1
mainWindow.setFocus(); //V1
mainWindow.show(); //V1
IApplication::current().run(); //V1
return 0;
} /* end main */ //V1