home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0040 - 0049 / ibm0040-0049 / ibm0040.tar / ibm0040 / BCPPOWL1.ZIP / OWLINC.ZIP / CHECKBOX.H < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-28  |  1.9 KB  |  71 lines

  1. // ObjectWindows - (C) Copyright 1991 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.  
  15. /* --------------------------------------------------------
  16.   TCheckBox object
  17.   -------------------------------------------------------- */
  18.  
  19. _CLASSDEF(TCheckBox)
  20.  
  21. class _EXPORT TCheckBox : public TButton
  22. {
  23. public:
  24.     PTGroupBox Group;
  25.  
  26.     TCheckBox(PTWindowsObject AParent,int AnId, LPSTR ATitle, int X,
  27.               int Y ,int W, int H, PTGroupBox AGroup, 
  28.           PTModule AModule = NULL);
  29.     TCheckBox(PTWindowsObject AParent, int ResourceId,
  30.               PTGroupBox AGroup, PTModule AModule = NULL);
  31.     void Check();
  32.     void Uncheck();
  33.     void Toggle();
  34.     WORD GetCheck();
  35.     void SetCheck(WORD CheckFlag);
  36.     virtual WORD Transfer(Pvoid DataPtr, WORD TransferFlag);
  37.  
  38.     static PTStreamable build();
  39.  
  40. protected:
  41.     virtual void BNClicked(RTMessage Msg) = [NF_FIRST + BN_CLICKED];
  42.  
  43.     /* Override TButton's processing so drawable check boxes and radio
  44.        buttons work properly. */
  45.     virtual void WMGetDlgCode(RTMessage Msg) = 
  46.                          [WM_FIRST + WM_GETDLGCODE]
  47.         { DefWndProc(Msg); }
  48.  
  49.     TCheckBox(StreamableInit) : TButton(streamableInit) {};
  50.     virtual void write (Ropstream os);
  51.     virtual Pvoid read (Ripstream is);
  52.  
  53. private:
  54.     virtual const Pchar streamableName() const
  55.         { return "TCheckBox"; }
  56. };
  57.  
  58. inline Ripstream operator >> ( Ripstream is, RTCheckBox cl )
  59.     { return is >> (RTStreamable )cl; }
  60. inline Ripstream operator >> ( Ripstream is, RPTCheckBox cl )
  61.     { return is >> (RPvoid)cl; }
  62.  
  63. inline Ropstream operator << ( Ropstream os, RTCheckBox cl )
  64.     { return os << (RTStreamable )cl; }
  65. inline Ropstream operator << ( Ropstream os, PTCheckBox cl )
  66.     { return os << (PTStreamable )cl; }
  67.  
  68. #endif
  69.  
  70.  
  71.