home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 9.ddi / TVSRC.ZIP / TCHECKBO.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.4 KB  |  44 lines

  1. /*------------------------------------------------------------*/
  2. /* filename -       tcheckbo.cpp                              */
  3. /*                                                            */
  4. /* function(s)                                                */
  5. /*          TCheckBox member functions                        */
  6. /*------------------------------------------------------------*/
  7.  
  8. /*------------------------------------------------------------*/
  9. /*                                                            */
  10. /*    Turbo Vision -  Version 1.0                             */
  11. /*                                                            */
  12. /*                                                            */
  13. /*    Copyright (c) 1991 by Borland International             */
  14. /*    All Rights Reserved.                                    */
  15. /*                                                            */
  16. /*------------------------------------------------------------*/
  17.  
  18. #define Uses_TCheckBoxes
  19. #include <tv.h>
  20.  
  21. void TCheckBoxes::draw()
  22. {
  23.     drawBox( button, 'X' );
  24. }
  25.  
  26. Boolean TCheckBoxes::mark(int item)
  27. {
  28.     return Boolean( (value & (1 <<  item)) != 0 );
  29. }
  30.  
  31. void TCheckBoxes::press(int item)
  32. {
  33.     value = value^(1 << item);
  34. }
  35.  
  36. TStreamable *TCheckBoxes::build()
  37. {
  38.     return new TCheckBoxes( streamableInit );
  39. }
  40.  
  41. TCheckBoxes::TCheckBoxes( StreamableInit ) : TCluster( streamableInit )
  42. {
  43. }
  44.