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

  1.  
  2.  
  3. #ifndef _pushbtn_h_ /* Fri Mar 11 08:35:35 1994 */
  4. #define _pushbtn_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 PushButton is a SimpleVObject displayed as a button. It exhibits the
  40. // behavior of being ``selected'' when either the left mouse button is
  41. // pressed on it, or the space bar or return key is pressed when it has
  42. // focus. When selected, the button sends itself an {\small\tt
  43. // Event_Select}. By default, this event does nothing; the parent
  44. // composite can catch this event (in its {\small\tt HandleChildEvent}
  45. // method) and take the needed action.
  46.  
  47.  
  48. #if defined(__GNUC__)
  49. #pragma interface
  50. #endif
  51.  
  52.  
  53. #include "ui/simple.h"
  54.  
  55.  
  56. class CL_EXPORT UI_PushButton: public UI_SimpleVObject {
  57.  
  58. public:
  59.  
  60.     UI_PushButton (UI_CompositeVObject* parent, const UI_Rectangle& shape,
  61.                    UI_ViewID id = -1);
  62.     // Constructor.
  63.  
  64. #if defined(__MS_WINDOWS__)
  65.     UI_PushButton(UI_CompositeVObject* parent, UI_ViewID id, UI_ViewHandle h);
  66.     // Resource-based construction (MS-Windows only).
  67.  
  68. #endif
  69.  
  70.     virtual UI_WindowClass WindowClass () const;
  71.     
  72.     
  73.     const char* ClassName() const {return "UI_PushButton";};
  74.     
  75. protected:
  76.  
  77.     bool MakeVisualElement ();
  78.     
  79.     bool _ModelChanged (CL_Object&, long);
  80.  
  81.     bool Select ();
  82.  
  83.    
  84.     ~UI_PushButton () {};
  85.    
  86. #if defined (__X_MOTIF__)
  87.     void  _SetupStyle (void* p, short& argn);
  88.     // Override UI_VisualObject's method
  89.     
  90.     static void SelectionCallback (struct _WidgetRec*, void *, void *);
  91.  
  92. #endif
  93.     
  94. };
  95.  
  96.  
  97. #endif /* _pushbtn_h_ */
  98.