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

  1. //************************************************************
  2. // Container Control - Name 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. #include "nameview.h"
  12.  
  13. void main ()
  14. {
  15.  
  16. // Create the frame window with the container in the
  17. // client area.
  18. IFrameWindow cnrFrame("Container Name View");
  19. IContainerControl cnr(0x101,
  20.                       &cnrFrame,
  21.                       &cnrFrame);
  22. cnrFrame.setClient(&cnr);
  23.  
  24.  
  25. // Create the objects with text and an icon.
  26. IContainerObject* obj1 = new
  27.                IContainerObject("Object 1",  ICON_FOLDER);
  28. IContainerObject* obj2 = new
  29.                IContainerObject("Object 2", ICON_FOLDER);
  30.  
  31. // Add the objects to the container.
  32. cnr.addObject(obj1);
  33. cnr.addObject(obj2);
  34.  
  35. // Show the objects in the name view.
  36. cnr.showNameView();
  37.  
  38. // Give focus to the frame and show it.
  39. cnrFrame.show();
  40. cnrFrame.setFocus();
  41.  
  42. IApplication::current().run();
  43. }
  44.