home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / Developer University / DU Projects / Sample1 / Sources / Frame.cpp < prev    next >
Encoding:
Text File  |  1996-08-22  |  1.7 KB  |  61 lines  |  [TEXT/CWIE]

  1. //    Release Version:    $ ODF 2 $
  2. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  3.  
  4. //=======================================================================
  5. #ifndef FRAME_H
  6. #include "Frame.h"
  7. #endif
  8.  
  9. #ifndef PART_H
  10. #include "Part.h"
  11. #endif
  12.  
  13. // ----- Framework Layer -----
  14. #ifndef FWCONTXT_H
  15. #include "FWContxt.h"            // FW_CViewContext
  16. #endif
  17.  
  18. // ----- Graphic Includes -----
  19. #ifndef FWRECT_H
  20. #include <FWRect.h>                // FW_CRect
  21. #endif
  22.  
  23. #ifndef FWRECSHP_H
  24. #include "FWRecShp.h"            // FW_CRectShape
  25. #endif
  26.  
  27. //========================================================================================
  28. #ifdef FW_BUILD_MAC
  29. #pragma segment Sample1
  30. #endif
  31.  
  32. //========================================================================================
  33. FW_DEFINE_AUTO(CSample1Frame)
  34.  
  35. //========================================================================================
  36. CSample1Frame::CSample1Frame(Environment* ev, ODFrame* odFrame, 
  37.                                     FW_CPresentation* presentation, CSample1Part* sample1Part)
  38.   : FW_CFrame(ev, odFrame, presentation, sample1Part)
  39. {
  40.     FW_END_CONSTRUCTOR
  41. }
  42.  
  43. //----------------------------------------------------------------------------------------
  44. CSample1Frame::~CSample1Frame()
  45. {
  46.     FW_START_DESTRUCTOR
  47. }
  48.  
  49. //----------------------------------------------------------------------------------------
  50. void 
  51. CSample1Frame::Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape)    // Override
  52. {
  53.     FW_CViewContext context(ev, this, odFacet, invalidShape);
  54.     FW_CRect frameRect = this->GetBounds(ev);
  55.  
  56.     // fill frame with green  
  57.     FW_CRectShape rectShape(frameRect, FW_kFill);
  58.     rectShape.GetInk().SetForeColor(FW_kRGBGreen);
  59.     rectShape.Render(context);
  60. }
  61.