home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / cnr / textview / textview.cpp < prev   
Encoding:
C/C++ Source or Header  |  1996-10-29  |  1.3 KB  |  50 lines

  1. //************************************************************
  2. // Container Control - Text View                              
  3. //
  4. // Copyright (C) 1994, Law, Leong, Love, Olson, Tsuji.
  5. // Copyright (c) 1997 John Wiley & Sons, Inc. 
  6. // All Rights Reserved.
  7. //************************************************************
  8. #include <iframe.hpp>
  9. #include <icnrctl.hpp>
  10. #include <iapp.hpp>
  11.  
  12. void main ()
  13. {
  14.  
  15. IFrameWindow cnrFrame("Container Text View");
  16.  
  17. IContainerControl cnr(0x101,        
  18.                       &cnrFrame,    
  19.                       &cnrFrame);
  20.  
  21. // Put container in client area
  22. cnrFrame.setClient(&cnr);
  23.  
  24. // Create the objects
  25. // Note: Windows doesn't support new line characters.
  26. #ifdef IC_PM
  27.   IContainerObject* obj1 = new 
  28.                IContainerObject("Object 1 \n  Line 1 \n  Line 2 ");
  29.   IContainerObject* obj2 = new 
  30.                IContainerObject("Object 2 \n  Line 1 \n  Line 2 ");
  31. #else
  32.   IContainerObject* obj1 = new IContainerObject("Object 1");
  33.   IContainerObject* obj2 = new IContainerObject("Object 2");
  34. #endif
  35.  
  36. // Add the objects to the container
  37. cnr.addObject(obj1);
  38. cnr.addObject(obj2);
  39.  
  40. // Flowed Text view
  41. cnr.showFlowedTextView();
  42.  
  43. cnrFrame.sizeTo(ISize(280,200));
  44. cnrFrame.show();
  45. cnrFrame.setFocus();
  46.  
  47.  
  48. IApplication::current().run();
  49. }
  50.