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 / ODFDev / ODF / Framewrk / FWPart / FWSclNot.cpp < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.5 KB  |  108 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWSclNot.cpp
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #include "FWFrameW.hpp"
  11.  
  12. #ifndef FWSCLNOT_H
  13. #include "FWSclNot.h"
  14. #endif
  15.  
  16. #ifndef FWSCLBAR_H
  17. #include "FWSclBar.h"
  18. #endif
  19.  
  20. //========================================================================================
  21. //    Runtime Info
  22. //========================================================================================
  23.  
  24. #ifdef FW_BUILD_MAC
  25. #pragma segment FW_FrameSegment
  26. #endif
  27.  
  28. //========================================================================================
  29. //    CLASS FW_CScrollNotification
  30. //========================================================================================
  31.  
  32. FW_DEFINE_CLASS_M1(FW_CScrollNotification, FW_CControlNotification)
  33.  
  34. //----------------------------------------------------------------------------------------
  35. // FW_CScrollNotification::FW_CScrollNotification
  36. //----------------------------------------------------------------------------------------
  37.  
  38. FW_CScrollNotification::FW_CScrollNotification(FW_CScrollBar* sb,
  39.                                                FW_XYSelector direction,
  40.                                                FW_Fixed delta,
  41.                                                FW_Boolean shouldScroll) :
  42.     FW_CControlNotification(sb, FW_kScrollMsg),
  43.     fDirection(direction),
  44.     fDelta(delta),
  45.     fShouldScroll(shouldScroll)
  46. {
  47. }
  48.  
  49. //----------------------------------------------------------------------------------------
  50. // FW_CScrollNotification::FW_CScrollNotification
  51. //----------------------------------------------------------------------------------------
  52.  
  53. FW_CScrollNotification::FW_CScrollNotification(const FW_CScrollNotification& other) :
  54.     FW_CControlNotification(other),
  55.     fDirection(other.fDirection),
  56.     fDelta(other.fDelta),
  57.     fShouldScroll(other.fShouldScroll)
  58. {
  59. }
  60.  
  61. //----------------------------------------------------------------------------------------
  62. // FW_CScrollNotification::~FW_CScrollNotification
  63. //----------------------------------------------------------------------------------------
  64.  
  65. FW_CScrollNotification::~FW_CScrollNotification()
  66. {
  67. }
  68.  
  69. //----------------------------------------------------------------------------------------
  70. // FW_CScrollNotification::operator==
  71. //----------------------------------------------------------------------------------------
  72.  
  73. FW_Boolean FW_CScrollNotification::operator==(const FW_CScrollNotification& other) const
  74. {
  75.     return FW_CControlNotification::operator==(other) &&
  76.                 fDirection == other.fDirection &&
  77.                 fDelta == other.fDelta &&
  78.                 fShouldScroll == other.fShouldScroll;
  79. }
  80.  
  81. //----------------------------------------------------------------------------------------
  82. // FW_CScrollNotification::operator=
  83. //----------------------------------------------------------------------------------------
  84.  
  85. FW_CScrollNotification& FW_CScrollNotification::operator=(const FW_CScrollNotification& other)
  86. {
  87.     if (this != &other)
  88.     {
  89.         FW_CControlNotification::operator=(other);
  90.         fDirection = other.fDirection;
  91.         fDelta = other.fDelta;
  92.         fShouldScroll = other.fShouldScroll;
  93.     }
  94.     return *this;
  95. }
  96.  
  97. //----------------------------------------------------------------------------------------
  98. // FW_CScrollNotification::GetScrollPos
  99. //----------------------------------------------------------------------------------------
  100.  
  101. FW_Fixed FW_CScrollNotification::GetScrollPos(Environment* ev) const
  102. {
  103.     FW_CScrollBar* sb = (FW_CScrollBar*)GetControl(ev);
  104.     return sb->GetScrollPos(ev);
  105. }
  106.  
  107.  
  108.