home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 3.ddi / OWLINC.ZIP / SCROLLBA.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  2.6 KB  |  87 lines

  1. // ObjectWindows - (C) Copyright 1992 by Borland International
  2.  
  3. #ifndef __SCROLLBAR_H
  4. #define __SCROLLBAR_H
  5.  
  6. #ifndef __CONTROL_H
  7. #include <control.h>
  8. #endif
  9.  
  10. #pragma option -Vo-
  11. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  12. #pragma option -po-
  13. #endif
  14.  
  15. // TScrollBar transfer structure
  16. struct TScrollBarData {
  17.   int LowValue;
  18.   int HighValue;
  19.   int Position;
  20. };
  21.  
  22. _CLASSDEF(TScrollBar)
  23.  
  24. /* --------------------------------------------------------
  25.   TScrollBar object
  26.   -------------------------------------------------------- */
  27.  
  28. class _EXPORT TScrollBar : public TControl
  29. {
  30. public:
  31.     int LineMagnitude, PageMagnitude;
  32.  
  33.     TScrollBar(PTWindowsObject AParent, int AnId, int X, int Y, int W,
  34.                int H, BOOL IsHScrollBar, PTModule AModule = NULL);
  35.     TScrollBar(PTWindowsObject AParent, int ResourceId,
  36.                PTModule AModule = NULL);
  37.  
  38.     void GetRange(Rint LoVal, Rint HiVal);
  39.     int GetPosition();
  40.     void SetRange(int LoVal, int HiVal);
  41.     void SetPosition(int ThumbPos);
  42.     int DeltaPos(int Delta);
  43.     virtual WORD Transfer(Pvoid DataPtr, WORD TransferFlag);
  44.  
  45.     static PTStreamable build();
  46.  
  47. protected:
  48.     virtual LPSTR GetClassName()
  49.         { return "SCROLLBAR"; }
  50.     virtual void SetupWindow();
  51.  
  52.     virtual void SBLineUp(RTMessage Msg) = [NF_FIRST + SB_LINEUP];
  53.     virtual void SBLineDown(RTMessage Msg) = [NF_FIRST + SB_LINEDOWN];
  54.     virtual void SBPageUp(RTMessage Msg) = [NF_FIRST + SB_PAGEUP];
  55.     virtual void SBPageDown(RTMessage Msg) = [NF_FIRST + SB_PAGEDOWN];
  56.     virtual void SBThumbPosition(RTMessage Msg) =
  57.                                       [NF_FIRST + SB_THUMBPOSITION];
  58.     virtual void SBThumbTrack(RTMessage Msg) = [NF_FIRST + SB_THUMBTRACK];
  59.     virtual void SBTop(RTMessage Msg) = [NF_FIRST + SB_TOP];
  60.     virtual void SBBottom(RTMessage Msg) = [NF_FIRST + SB_BOTTOM];
  61.  
  62.     TScrollBar(StreamableInit) : TControl(streamableInit) {};
  63.     virtual void write (Ropstream os);
  64.     virtual Pvoid read (Ripstream is);
  65.  
  66. private:
  67.     virtual const Pchar streamableName() const
  68.         { return "TScrollBar"; }
  69. };
  70.  
  71. inline Ripstream operator >> ( Ripstream is, RTScrollBar cl )
  72.     { return is >> (RTStreamable )cl; }
  73. inline Ripstream operator >> ( Ripstream is, RPTScrollBar cl )
  74.     { return is >> (RPvoid)cl; }
  75.  
  76. inline Ropstream operator << ( Ropstream os, RTScrollBar cl )
  77.     { return os << (RTStreamable )cl; }
  78. inline Ropstream operator << ( Ropstream os, PTScrollBar cl )
  79.     { return os << (PTStreamable )cl; }
  80.  
  81. #pragma option -Vo.
  82. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  83. #pragma option -po.
  84. #endif
  85.  
  86. #endif
  87.