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

  1.  
  2.  
  3.  
  4.  
  5. #ifndef _btngroup_h_ /* Wed Mar 30 08:49:46 1994 */
  6. #define _btngroup_h_
  7.  
  8.  
  9.  
  10.  
  11.  
  12. /*
  13.  *
  14.  *          Copyright (C) 1994, M. A. Sridhar
  15.  *  
  16.  *
  17.  *     This software is Copyright M. A. Sridhar, 1994. You are free
  18.  *     to copy, modify or distribute this software  as you see fit,
  19.  *     and to use  it  for  any  purpose, provided   this copyright
  20.  *     notice and the following   disclaimer are included  with all
  21.  *     copies.
  22.  *
  23.  *                        DISCLAIMER
  24.  *
  25.  *     The author makes no warranties, either expressed or implied,
  26.  *     with respect  to  this  software, its  quality, performance,
  27.  *     merchantability, or fitness for any particular purpose. This
  28.  *     software is distributed  AS IS.  The  user of this  software
  29.  *     assumes all risks  as to its quality  and performance. In no
  30.  *     event shall the author be liable for any direct, indirect or
  31.  *     consequential damages, even if the  author has been  advised
  32.  *     as to the possibility of such damages.
  33.  *
  34.  */
  35.  
  36.  
  37. // Author: M. A. Sridhar
  38.  
  39.  
  40.  
  41.  
  42.  
  43. // A ButtonGroup is a CompositeVObject representing a group of toggle
  44. // buttons.  This is an abstract class.
  45.  
  46. #if defined(__GNUC__)
  47. #pragma interface
  48. #endif
  49.  
  50.  
  51. #include "base/intset.h"
  52. #include "ui/vobjcoll.h"
  53.  
  54.  
  55. class CL_EXPORT UI_ButtonGroup: public UI_VObjCollection {
  56.  
  57. public:
  58.  
  59.     virtual UI_WindowClass WindowClass () const;
  60.     // Override method inherited from {\small\tt UI_VisualObject}.
  61.  
  62.     const char* ClassName () const {return "UI_ButtonGroup";};
  63.     // Override method inherited from {\small\tt CL_Object}.
  64.     
  65. protected:
  66.  
  67.     UI_ButtonGroup (UI_VObjCollection* parent, const UI_Rectangle& shape,
  68.                     UI_ViewID id = -1);
  69.     // Constructor: creates an empty ButtonGroup as a child of {\tt
  70.     // parent}, with the given shape and view ID.
  71.  
  72. #if defined(__MS_WINDOWS__)
  73.     UI_ButtonGroup (UI_VObjCollection* parent,  UI_ViewID id,
  74.                     UI_ViewHandle h);
  75.     // Resource-based construction (only under MS-Windows). This assumes
  76.     // that (1) all (and only) the buttons in the group are geometrically
  77.     // contained within the button group box's rectangle,  (2) the
  78.     // contained buttons occur immediately after the group box in the
  79.     // resource file ordering, and (3) the group box has a valid id.
  80.     // Therefore, this does not allow (in particular) for groups within groups.
  81.  
  82. #endif
  83.     
  84.     ~UI_ButtonGroup ();
  85.     // Protected, to discourage direct destruction. (All YACL
  86.     // VisualObjects are destroyed by the Controller, and must not be
  87.     // deleted by a user program.)
  88.  
  89.     bool MakeVisualElement ();
  90.  
  91.     void MakeInvisible ();
  92.     // Override the inherited virtual method.
  93.     
  94.     void MakeVisible ();
  95.     // Override the inherited virtual method.
  96.  
  97.     void _PrivateInitialize ();
  98.  
  99.     bool _TitleChanged (CL_Object&, long);
  100.     
  101.     bool _FontChanged  (CL_Object&, long);
  102.     
  103.  
  104. #if defined(__X_MOTIF__)
  105. private:
  106.     UI_ViewHandle  _frameWidget; // The frame (parent of the button group)
  107.     UI_ViewHandle  _frameLabel;  // Label of the frame
  108.  
  109. #endif
  110. #if defined(__MS_WINDOWS__) || defined(__OS2__)
  111.  
  112. private:
  113.     bool _GetFocus (CL_Object&, long);
  114.     // [MS-Windows=specific]
  115.     
  116. #endif
  117.  
  118. #if defined(__OS2__)
  119.  
  120. private:
  121.     void _Subclass ();
  122.     // [OS/2-specific]
  123.  
  124.     PFNWP _oldProc;
  125.  
  126.     static MRESULT EXPENTRY ButtonGroupProc (HWND hWnd, ULONG msg,
  127.                                              MPARAM p1, MPARAM p2);
  128.     // [OS/2-specific]
  129.     
  130. #endif
  131.  
  132.  
  133. #if defined(__MS_WINDOWS__) || defined(__OS2__)
  134. public:
  135.     void TakeFocus ();
  136.     // [Specific to OS/2 and Windows. YACL internal use only.]
  137.  
  138. #endif
  139.     
  140. };
  141.  
  142.                      
  143.  
  144. #endif /* _btngroup_h_ */
  145.