home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tv20os2.zip / src / TCheckBoxes.cpp < prev    next >
C/C++ Source or Header  |  1998-01-19  |  663b  |  43 lines

  1. /*
  2.  * TCheckBoxes.cc
  3.  *
  4.  * Turbo Vision - Version 2.0
  5.  *
  6.  * Copyright (c) 1994 by Borland International
  7.  * All Rights Reserved.
  8.  *
  9.  * Modified by Sergio Sigala <ssigala@globalnet.it>
  10.  */
  11.  
  12. #define Uses_TCheckBoxes
  13. #include <tvision/tv.h>
  14.  
  15. void TCheckBoxes::draw()
  16. {
  17.     drawMultiBox( button, " X" );
  18. }
  19.  
  20. Boolean TCheckBoxes::mark(int item)
  21. {
  22.     return Boolean( (value & (1 <<  item)) != 0 );
  23. }
  24.  
  25. void TCheckBoxes::press(int item)
  26. {
  27.     value = value^(1 << item);
  28. }
  29.  
  30. #if !defined(NO_STREAMABLE)
  31.  
  32. TStreamable *TCheckBoxes::build()
  33. {
  34.     return new TCheckBoxes( streamableInit );
  35. }
  36.  
  37. TCheckBoxes::TCheckBoxes( StreamableInit ) : TCluster( streamableInit )
  38. {
  39. }
  40.  
  41.  
  42. #endif
  43.