home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / profile / advprof / appview.cpp next >
Text File  |  1996-10-29  |  2KB  |  68 lines

  1. //************************************************************
  2. // GUI Profile 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 "appview.hpp"
  9. #include "keyview.hpp"
  10. #include "profview.h"
  11.  
  12. ProfileAppObject :: ProfileAppObject ( EnhancedProfile   &profile,
  13.                                        const IString     &appName,
  14.                                        IContainerControl *cnr )
  15.   : ProfileObject( appName, APP_ICON_ID, cnr ),
  16.     app( profile, appName )
  17.   {
  18.   }
  19.  
  20. ProfileObjectView *ProfileAppObject :: newView ( )
  21.   {
  22.   return new ApplicationView( *this );
  23.   }
  24.  
  25. ProfileApplication &ProfileAppObject :: application ( )
  26.   {
  27.   return app;
  28.   }
  29.  
  30. ApplicationView :: ApplicationView ( ProfileAppObject &appObj )
  31.   : ProfileObjectView( clientWindow(),
  32.                        appObj,
  33.                        "Icon View" ),
  34.     appObj( appObj )
  35.   {
  36.   handler.handleEventsFor( (IContainerControl*)( this->client() ) );
  37.   populate();
  38.   }
  39.  
  40. ApplicationView &ApplicationView :: populate ( )
  41.   {
  42.   IContainerControl
  43.    *cnr = (IContainerControl*)( client() );
  44.   IContainerControl::ObjectCursor
  45.     cursor( *(appObj.container()), &appObj );
  46.   for ( cursor.setToFirst();
  47.         cursor.isValid();
  48.         cursor.setToNext() )
  49.     {
  50.     ProfileKeyObject
  51.      *next = (ProfileKeyObject*)( appObj.container()->objectAt( cursor ) );
  52.     cnr -> addObject( next );
  53.     }
  54.   cnr -> arrangeIconView();
  55.   return *this;
  56.   }
  57.  
  58. IContainerControl *ApplicationView :: clientWindow ( )
  59.   {
  60.   IContainerControl
  61.    *p = new IContainerControl( 0, 
  62.                                IWindow::objectWindow(),
  63.                                IWindow::objectWindow() );
  64.   p -> showIconView();
  65.   p -> setAutoDeleteObject( true );
  66.   return p;
  67.   }
  68.