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 / ODFDev / ODF / Framewrk / FWViews / Include / FWClustr.h < prev    next >
Encoding:
Text File  |  1996-08-16  |  2.6 KB  |  94 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWClustr.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWCLUSTR_H
  11. #define FWCLUSTR_H
  12.  
  13. #ifndef FWSVIEW_H
  14. #include "FWSView.h"
  15. #endif
  16.  
  17. #ifndef FWBUTTON_H
  18. #include "FWButton.h"
  19. #endif
  20.  
  21. // ----- Foundation Layer -----
  22.  
  23. #ifndef FWRUNTYP_H
  24. #include "FWRunTyp.h"
  25. #endif
  26.  
  27. #ifndef FWSTRING_H
  28. #include "FWString.h"
  29. #endif
  30.  
  31. #ifndef FWRECEVR_H
  32. #include "FWRecevr.h"
  33. #endif
  34.  
  35. //========================================================================================
  36. //    Foward class declarations
  37. //========================================================================================
  38.  
  39. class FW_CMouseEvent;
  40.  
  41. //========================================================================================
  42. //    CLASS FW_CRadioCluster
  43. //========================================================================================
  44.  
  45. class FW_CRadioCluster : public FW_MReceiver
  46. {
  47. // ----- Initialization/destruction
  48. public:
  49.     FW_DECLARE_CLASS
  50.     FW_DECLARE_AUTO(FW_CRadioCluster)
  51.  
  52.     FW_CRadioCluster(Environment* ev);
  53.     virtual ~FW_CRadioCluster();
  54.  
  55. public:
  56.     // ----- New API
  57.     virtual void            AddRadio(Environment* ev, FW_CButton* radio);
  58.     virtual void            RemoveRadio(Environment* ev, FW_CButton* radio);
  59.  
  60.     FW_CButton*                GetButtonOn(Environment* ev) const;
  61.     ODID                    GetButtonIdOn(Environment* ev) const;
  62.  
  63.     // ----- inherited from FW_MReceiver
  64.     virtual void             HandleNotification(Environment* ev, const FW_CNotification& notification);
  65.  
  66.     // ----- Archiving -----
  67.     static void*             Create(FW_CReadableStream& stream, FW_ClassTypeConstant type);
  68.     static void                Read(FW_CReadableStream& stream, FW_ClassTypeConstant type, void* object);
  69.     static void             Write(FW_CWritableStream& stream, FW_ClassTypeConstant type, const void *object);
  70.     static void                Destroy(void* object, FW_ClassTypeConstant type);
  71.  
  72.     virtual void            Flatten(Environment*ev, FW_CWritableStream& stream) const;
  73.     virtual void            InitializeFromStream(Environment*ev, FW_CReadableStream& stream);
  74.     
  75. private:
  76.     FW_CButton*                fButtonOn;
  77. };
  78.  
  79. //----------------------------------------------------------------------------------------
  80. // inlines
  81. //----------------------------------------------------------------------------------------
  82.  
  83. inline ODID FW_CRadioCluster::GetButtonIdOn(Environment* ev) const
  84. {
  85.     return fButtonOn->GetViewId(ev);
  86. }
  87.  
  88. inline FW_CButton* FW_CRadioCluster::GetButtonOn(Environment*) const
  89. {
  90.     return fButtonOn;
  91. }
  92.  
  93. #endif
  94.