home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / advframe / winview / iconview.cpp < prev    next >
Text File  |  1996-10-29  |  2KB  |  54 lines

  1. //************************************************************
  2. // Advanced Frame - Window Viewer Example
  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 "iconview.hpp"
  9. #include "winview.h"
  10.  
  11.  
  12. IconView::IconView ( HWindowObject& object )
  13.   : HWindowObjectView( clientWindow(),
  14.                        object,
  15.                        "Child View" ),
  16.     handler( )
  17. {
  18.   handler.handleEventsFor(
  19.     (IContainerControl*)( this->client() ) );
  20.   populate();
  21. }
  22.  
  23. IconView &IconView::populate ( )
  24. {
  25.   IContainerControl
  26.    *cnr = (IContainerControl*)( client() );
  27.   HWindow::ChildCursor cursor( object()->hWindow() );
  28.   for ( cursor.setToFirst();
  29.         cursor.isValid();
  30.         cursor.setToNext() )
  31.     {
  32.     HWindowObject* child =
  33.       new HWindowObject( cursor.hWindow(), APP_ICON_ID, cnr);
  34.     cnr->addObject( child );
  35.     }
  36.   cnr -> arrangeIconView();
  37.   return *this;
  38. }
  39.  
  40. IContainerControl* IconView::clientWindow ( )
  41. {
  42.   IContainerControl* p =
  43.      new IContainerControl( IC_FRAME_CLIENT_ID,
  44.                             IWindow::objectWindow(),
  45.                             IWindow::objectWindow(),
  46.                             IRectangle(),
  47.                             IContainerControl::defaultStyle() |
  48.                             IContainerControl::noSharedObjects );
  49.   p -> setDeleteObjectsOnClose( true );
  50.   p -> showIconView();
  51.   p -> setAutoDeleteObject( true );
  52.   return p;
  53. }
  54.