home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / ioc / hello1 / ahellow1.cpp next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  3.3 KB  |  60 lines

  1. /******************************************************************************
  2. * .FILE:        ahellow1.cpp                                                  *
  3. *                                                                             *
  4. * .DESCRIPTION: Hello World Sample Program Version 1:  Implementation         *
  5. *                                                                             *
  6. * .CLASSES:                                                                   *
  7. *                                                                             *
  8. * .COPYRIGHT:                                                                 *
  9. *    Licensed Material - Program-Property of IBM                              *
  10. *    (C) Copyright IBM Corp. 1992, 1996 - All Rights Reserved                 *
  11. *                                                                             *
  12. * .DISCLAIMER:                                                                *
  13. *   The following [enclosed] code is sample code created by IBM               *
  14. *   Corporation.  This sample code is not part of any standard IBM product    *
  15. *   and is provided to you solely for the purpose of assisting you in the     *
  16. *   development of your applications.  The code is provided 'AS IS',          *
  17. *   without warranty of any kind.  IBM shall not be liable for any damages    *
  18. *   arising out of your use of the sample code, even if they have been        *
  19. *   advised of the possibility of such damages.                               *
  20. *                                                                             *
  21. * .NOTE: WE RECOMMEND USING A FIXED SPACE FONT TO LOOK AT THE SOURCE          *
  22. *                                                                             *
  23. ******************************************************************************/
  24.  
  25. #include <ibase.hpp>
  26. #include <iapp.hpp>
  27. #include <istattxt.hpp>
  28. #include <iframe.hpp>
  29. #include <icoordsy.hpp>
  30. #include "ahellow1.h"
  31.  
  32. /**************************************************************************
  33. * main  - Application entry point for Hello World Version 1.              *
  34. *                                                                         *
  35. * Creates a new object mainWindow of class IFrameWindow                   *
  36. * Creates a new object hello of class IStaticText                         *
  37. * Sets the static text value and aligns it                                *
  38. * Sets the static text as the client of the mainWindow                    *
  39. * Sets the size of mainWindow                                             *
  40. * Sets the window focus to mainWindow                                     *
  41. * Displays the mainWindow                                                 *
  42. * Starts the events processing for the application                        *
  43. **************************************************************************/
  44. int main()
  45. {
  46.   ICoordinateSystem::setApplicationOrientation(
  47.           ICoordinateSystem::originLowerLeft );
  48.   IFrameWindow mainWindow (WND_MAIN);
  49.   IStaticText hello(WND_HELLO, &mainWindow, &mainWindow);
  50.   hello.setText(STR_HELLO);
  51.   hello.setAlignment(IStaticText::centerCenter);
  52.   mainWindow.setClient(&hello);
  53.  
  54.   mainWindow.sizeTo(ISize(400,300));
  55.   mainWindow.setFocus();
  56.   mainWindow.show();
  57.   IApplication::current().run();
  58.   return 0;
  59. } /* end main() */
  60.