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

  1. //************************************************************
  2. // Advanced Frame - 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 <imle.hpp>
  9. #include <ifont.hpp>
  10. #include "infoview.hpp"
  11. #include "hwinobj.hpp"
  12. #include "winview.h"
  13.  
  14.  
  15. InfoView::InfoView ( HWindowObject& object )
  16.   : HWindowObjectView( clientWindow(),
  17.                        object,
  18.                        "Information View" )
  19.   {
  20.   populate();
  21.   }
  22.  
  23. InfoView &InfoView::populate ( )
  24.   {
  25.   IMultiLineEdit
  26.    *mle = (IMultiLineEdit*)( client() );
  27.   (*mle)
  28.     .addLineAsLast( "Handle:   " +
  29.                     object()->hWindow().asHexString() )
  30.     .addLineAsLast( "Id:       " +
  31.                     object()->hWindow().id() )
  32.     .addLineAsLast( "Style:    " +
  33.                     object()->hWindow().style() )
  34.     .addLineAsLast( "Rectangle:" +
  35.                     object()->hWindow().rectangle() )
  36.     .addLineAsLast( "Class:    " +
  37.                     object()->hWindow().windowClass() )
  38.     .addLineAsLast( "Text:     " +
  39.                     object()->hWindow().text() );
  40.   return *this;
  41.   }
  42.  
  43. IMultiLineEdit* InfoView::clientWindow ( )
  44.   {
  45.   IMultiLineEdit
  46.    *p = new IMultiLineEdit( IC_FRAME_CLIENT_ID,
  47.                             IWindow::objectWindow(),
  48.                             IWindow::objectWindow(),
  49.                             IRectangle(),
  50.                             IMultiLineEdit::classDefaultStyle |
  51.                             IMultiLineEdit::readOnly );
  52. #ifdef IC_PM
  53.   IFont
  54.     font( "System Monospaced", 12 );
  55. #else
  56.   IFont
  57.     font( "Fixedsys",          12 );
  58. #endif
  59.   (*p)
  60.     .setFont( font )
  61.     .setAutoDeleteObject( true );
  62.   return p;
  63.   }
  64.