home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / yacl-012.zip / ui / toglbtn.h < prev    next >
C/C++ Source or Header  |  1995-04-08  |  2KB  |  98 lines

  1.  
  2.  
  3. #ifndef _toglbtn_h_ /* Fri Mar 11 08:37:05 1994 */
  4. #define _toglbtn_h_
  5.  
  6.  
  7.  
  8.  
  9.  
  10. /*
  11.  *
  12.  *          Copyright (C) 1994, M. A. Sridhar
  13.  *  
  14.  *
  15.  *     This software is Copyright M. A. Sridhar, 1994. You are free
  16.  *     to copy, modify or distribute this software  as you see fit,
  17.  *     and to use  it  for  any  purpose, provided   this copyright
  18.  *     notice and the following   disclaimer are included  with all
  19.  *     copies.
  20.  *
  21.  *                        DISCLAIMER
  22.  *
  23.  *     The author makes no warranties, either expressed or implied,
  24.  *     with respect  to  this  software, its  quality, performance,
  25.  *     merchantability, or fitness for any particular purpose. This
  26.  *     software is distributed  AS IS.  The  user of this  software
  27.  *     assumes all risks  as to its quality  and performance. In no
  28.  *     event shall the author be liable for any direct, indirect or
  29.  *     consequential damages, even if the  author has been  advised
  30.  *     as to the possibility of such damages.
  31.  *
  32.  */
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39. //  A class representing a Toggle Button. The model for this object is a
  40. //  {\small\tt CL_Integer} whose value is either 0 or 1 depending on
  41. //  current button state. The model can be inspected by the {\small\tt
  42. //  Model()} method.
  43.  
  44.  
  45. #if defined(__GNUC__)
  46. #pragma interface
  47. #endif
  48.  
  49.  
  50.  
  51. #include "base/integer.h"
  52. #include "ui/simple.h"
  53.  
  54. class CL_EXPORT UI_CompositeVObject;
  55. class CL_EXPORT UI_ToggleButton: public UI_SimpleVObject {
  56.  
  57. public:
  58.  
  59.     UI_ToggleButton (UI_VObjCollection* parent, const UI_Rectangle& shape,
  60.                      UI_ViewID id = -1);
  61.  
  62. #if defined(__MS_WINDOWS__)
  63.     UI_ToggleButton (UI_VObjCollection* parent, UI_ViewID id,
  64.                      UI_ViewHandle h);
  65.     // [MS-Windows-specific] For resource-based construction.
  66.  
  67. #endif
  68.  
  69.     CL_Object& Model ();
  70.     // Return a reference to a {\small\tt CL_Integer} (our model).
  71.  
  72.     virtual UI_WindowClass WindowClass () const;
  73.     
  74.     const char* ClassName () const {return "UI_ToggleButton";};
  75.  
  76.  
  77. protected:
  78.  
  79.     bool MakeVisualElement ();
  80.  
  81.     void _PrivateInitialize ();
  82.     
  83.     bool _ModelChanged (CL_Object&, long);
  84.  
  85.     ~UI_ToggleButton(){;};
  86.  
  87.     
  88. #if defined (__X_MOTIF__)
  89.     static void SelectionCallback (struct _WidgetRec*, void *, void *);
  90.  
  91. #endif
  92.     
  93. };
  94.  
  95.  
  96.  
  97. #endif /* _toglbtn_h_ */
  98.