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

  1. // ObjectWindows - (C) Copyright 1992 by Borland International
  2.  
  3. #ifndef __CHECKBOX_H
  4. #define __CHECKBOX_H
  5.  
  6. #ifndef __BUTTON_H
  7. #include <button.h>
  8. #endif
  9.  
  10. #ifndef __GROUPBOX_H
  11. #include <groupbox.h>
  12. #endif
  13.  
  14. #pragma option -Vo-
  15. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  16. #pragma option -po-
  17. #endif
  18.  
  19. /* --------------------------------------------------------
  20.   TCheckBox object
  21.   -------------------------------------------------------- */
  22.  
  23. _CLASSDEF(TCheckBox)
  24.  
  25. class _EXPORT TCheckBox : public TButton
  26. {
  27. public:
  28.     PTGroupBox Group;
  29.  
  30.     TCheckBox(PTWindowsObject AParent,int AnId, LPSTR ATitle, int X,
  31.               int Y ,int W, int H, PTGroupBox AGroup,
  32.           PTModule AModule = NULL);
  33.     TCheckBox(PTWindowsObject AParent, int ResourceId,
  34.               PTGroupBox AGroup, PTModule AModule = NULL);
  35.     void Check();
  36.     void Uncheck();
  37.     void Toggle();
  38.     WORD GetCheck();
  39.     void SetCheck(WORD CheckFlag);
  40.     virtual WORD Transfer(Pvoid DataPtr, WORD TransferFlag);
  41.  
  42.     static PTStreamable build();
  43.  
  44. protected:
  45.     virtual void BNClicked(RTMessage Msg) = [NF_FIRST + BN_CLICKED];
  46.  
  47.     /* Override TButton's processing so drawable check boxes and radio
  48.        buttons work properly. */
  49.     virtual void WMGetDlgCode(RTMessage Msg) =
  50.                          [WM_FIRST + WM_GETDLGCODE]
  51.         { DefWndProc(Msg); }
  52.  
  53.     TCheckBox(StreamableInit) : TButton(streamableInit) {};
  54.     virtual void write (Ropstream os);
  55.     virtual Pvoid read (Ripstream is);
  56.  
  57. private:
  58.     virtual const Pchar streamableName() const
  59.         { return "TCheckBox"; }
  60. };
  61.  
  62. inline Ripstream operator >> ( Ripstream is, RTCheckBox cl )
  63.     { return is >> (RTStreamable )cl; }
  64. inline Ripstream operator >> ( Ripstream is, RPTCheckBox cl )
  65.     { return is >> (RPvoid)cl; }
  66.  
  67. inline Ropstream operator << ( Ropstream os, RTCheckBox cl )
  68.     { return os << (RTStreamable )cl; }
  69. inline Ropstream operator << ( Ropstream os, PTCheckBox cl )
  70.     { return os << (PTStreamable )cl; }
  71.  
  72. #pragma option -Vo.
  73. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  74. #pragma option -po.
  75. #endif
  76.  
  77. #endif
  78.  
  79.  
  80.