home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / Developer University / DUProjects / Sample / Sources / Frame.cpp < prev    next >
Encoding:
Text File  |  1996-08-16  |  1.7 KB  |  65 lines  |  [TEXT/CWIE]

  1. //    Copyright © 1995 Apple Computer, Inc. All rights reserved.
  2. //    Release Version:    $ 1.0 d11 $
  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 FWUTIL_H
  15. #include "FWUtil.h"                // FW_CFacetContext, FW_Beep()
  16. #endif
  17.  
  18. #ifndef FWCONTXT_H
  19. #include "FWContxt.h"            // FW_CViewContext
  20. #endif
  21.  
  22. // ----- Graphic Includes -----
  23. #ifndef FWRECT_H
  24. #include <FWRect.h>                // FW_CRect
  25. #endif
  26.  
  27. #ifndef FWRECSHP_H
  28. #include "FWRecShp.h"            // FW_CRectShape
  29. #endif
  30.  
  31. //========================================================================================
  32. #ifdef FW_BUILD_MAC
  33. #pragma segment Sample
  34. #endif
  35.  
  36. //========================================================================================
  37. FW_DEFINE_AUTO(CSampleFrame)
  38.  
  39. //========================================================================================
  40. CSampleFrame::CSampleFrame(Environment* ev, ODFrame* odFrame, 
  41.                                     FW_CPresentation* presentation, CSamplePart* samplePart)
  42.   : FW_CFrame(ev, odFrame, presentation, samplePart)
  43. {
  44.     FW_END_CONSTRUCTOR
  45. }
  46.  
  47. //----------------------------------------------------------------------------------------
  48. CSampleFrame::~CSampleFrame()
  49. {
  50.     FW_START_DESTRUCTOR
  51. }
  52.  
  53. //----------------------------------------------------------------------------------------
  54. void 
  55. CSampleFrame::Draw(Environment *ev, ODFacet* odFacet, ODShape* invalidShape)    // Override
  56. {
  57.     FW_CViewContext context(ev, this, odFacet, invalidShape);
  58.     FW_CRect frameRect = this->GetBounds(ev);
  59.  
  60.     // fill frame with green  
  61.     FW_CRectShape rectShape(frameRect, FW_kFill);
  62.     rectShape.GetInk().SetForeColor(FW_kRGBGreen);
  63.     rectShape.Render(context);
  64. }
  65.