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 / DataCopy / Sources / Selection.cpp < prev    next >
Encoding:
Text File  |  1996-08-22  |  1.8 KB  |  74 lines  |  [TEXT/CWIE]

  1. //    Release Version:    $ ODF 2 $
  2. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  3.  
  4. //========================================================================
  5. #ifndef SELECTION_H
  6. #include "Selection.h"    // CDataCopySelection
  7. #endif
  8.  
  9. #ifndef CONTENT_H
  10. #include "Content.h"    // CDataCopyContent
  11. #endif
  12.  
  13. // ----- Framework Layer -----
  14. #ifndef FWPRESEN_H
  15. #include "FWPresen.h"
  16. #endif
  17.  
  18. //========================================================================
  19. #ifdef FW_BUILD_MAC
  20. #pragma segment DataCopy
  21. #endif
  22.  
  23. FW_DEFINE_AUTO(CDataCopySelection)
  24. //========================================================================
  25. CDataCopySelection::CDataCopySelection(Environment* ev, CDataCopyContent* content)
  26.   :    FW_CSelection(ev, false, false),
  27.     fDataCopyContent(content)
  28. {
  29.     FW_END_CONSTRUCTOR
  30. }
  31.  
  32. //-------------------------------------------------------------------------
  33. CDataCopySelection::~CDataCopySelection()
  34. {    
  35.     FW_START_DESTRUCTOR
  36. }
  37.  
  38. //-------------------------------------------------------------------------
  39. void 
  40. CDataCopySelection::CloseSelection(Environment*)
  41. {
  42. }
  43.  
  44. //-------------------------------------------------------------------------
  45. void 
  46. CDataCopySelection::ClearSelection(Environment* ev)
  47. {
  48.     fDataCopyContent->MyRemoveAllPizzas();
  49.     this->GetPresentation(ev)->Invalidate(ev);
  50. }
  51.  
  52. //-------------------------------------------------------------------------
  53. void 
  54. CDataCopySelection::SelectAll(Environment*)
  55. {
  56. }
  57.  
  58. //-------------------------------------------------------------------------
  59. FW_Boolean 
  60. CDataCopySelection::IsEmpty(Environment* ev) const
  61. {
  62.     FW_UNUSED(ev);
  63.     unsigned long count = fDataCopyContent->MyGetPizzaList()->Count();
  64.     return (count == 0);            
  65. }
  66.  
  67. //-------------------------------------------------------------------------
  68. FW_CContent* 
  69. CDataCopySelection::GetSelectedContent(Environment* ev)
  70. {
  71.     FW_UNUSED(ev);
  72.     return fDataCopyContent;
  73. }
  74.