home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tv20cpp.zip / src / TRadioButtons.cpp < prev    next >
C/C++ Source or Header  |  1998-05-03  |  884b  |  55 lines

  1. /*
  2.  * TRadioButtons.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_TRadioButtons
  13. #include <tvision/tv.h>
  14.  
  15. void TRadioButtons::draw()
  16. {
  17.     drawMultiBox( button, " \x7" );
  18. }
  19.  
  20. Boolean TRadioButtons::mark( int item )
  21. {
  22. //    return Boolean( item == value );    /* XXX */
  23.     return Boolean( item == (int)value );    /* XXX */
  24. }
  25.  
  26. void TRadioButtons::press( int item )
  27. {
  28.     value = item;
  29. }
  30.  
  31. void TRadioButtons::movedTo( int item )
  32. {
  33.     value = item;
  34. }
  35.  
  36. void TRadioButtons::setData( void * rec )
  37. {
  38.     TCluster::setData(rec);
  39.     sel = (int)value;
  40. }
  41.  
  42. #if !defined(NO_STREAMABLE)
  43.  
  44. TStreamable *TRadioButtons::build()
  45. {
  46.     return new TRadioButtons( streamableInit );
  47. }
  48.  
  49. TRadioButtons::TRadioButtons( StreamableInit ) : TCluster( streamableInit )
  50. {
  51. }
  52.  
  53.  
  54. #endif
  55.