home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / canvas / mcgroup / mcgroup.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-29  |  1.7 KB  |  65 lines

  1. #ifndef _MCGROUP_
  2. #define _MCGROUP_
  3. //*********************************************************
  4. // Canvas - IMultiCellCanvas with Smarter Group Boxes
  5. //
  6. // Copyright (C) 1994, Law, Leong, Love, Olson, Tsuji.
  7. // Copyright (c) 1997 John Wiley & Sons, Inc. 
  8. // All Rights Reserved.
  9. //*********************************************************
  10. #include <ifont.hpp>
  11. #include <igroupbx.hpp>
  12. #include <imcelcv.hpp>
  13.  
  14. class GroupBoxForMultiCell : public IGroupBox {
  15. public:
  16.   GroupBoxForMultiCell ( unsigned long     windowId,
  17.                          IMultiCellCanvas* parentAndOwner,
  18.                          unsigned long     row = 0 )
  19.     : IGroupBox( windowId, parentAndOwner, parentAndOwner ),
  20.       fRow( row )
  21.   { }
  22. GroupBoxForMultiCell
  23.  &setMultiCellRow ( unsigned long row )
  24.   {
  25.     fRow = row;
  26.     return this->setRowHeight();
  27.   }
  28.  
  29. protected:
  30. virtual GroupBoxForMultiCell
  31.  &setLayoutDistorted ( unsigned long flagsOn,
  32.                        unsigned long flagsOff )
  33.   {
  34.     if ( flagsOn & IWindow::fontChanged )
  35.     {
  36.        this->setRowHeight();
  37.     }
  38.     this->IGroupBox::setLayoutDistorted( flagsOn, flagsOff );
  39.     return *this;
  40.   }
  41.  
  42. private:
  43.   GroupBoxForMultiCell ( const GroupBoxForMultiCell& );
  44. GroupBoxForMultiCell
  45.  &operator=            ( const GroupBoxForMultiCell& );
  46. GroupBoxForMultiCell
  47.  &setRowHeight ( )
  48.   {
  49.     if ( fRow )
  50.     {
  51.       IFont
  52.         font( this );
  53.       IMultiCellCanvas
  54.        *canvas = (IMultiCellCanvas*)( this->parent() );
  55.       ( *canvas)
  56.        .setRowHeight( fRow, font.maxCharHeight() );
  57.     }
  58.     return *this;
  59.   }
  60. unsigned long
  61.  fRow;
  62. }; // GroupBoxForMultiCell
  63.  
  64. #endif // _MCGROUP_
  65.