home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iradiobt.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  4.0 KB  |  123 lines

  1. #ifndef _IRADIOBT_
  2.   #define _IRADIOBT_
  3. /*******************************************************************************
  4. * FILE NAME: iradiobt.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IRadioButton                                                             *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  13. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *******************************************************************************/
  18. #include <isetbut.hpp>
  19. #include <irect.hpp>
  20.  
  21. class ISize;
  22. class IWindowHandle;
  23. class IRadioButtonData;
  24.  
  25. #pragma pack(4)
  26.  
  27. class IRadioButton : public ISettingButton  {
  28. typedef ISettingButton
  29.   Inherited;
  30. public:
  31.  
  32. class Style;
  33.  
  34. /*------------------------------- Constructors -------------------------------*/
  35.   IRadioButton ( unsigned long id,
  36.                  IWindow* parent,
  37.                  IWindow* owner,
  38.                  const IRectangle& initial= IRectangle(),
  39.                  const Style& style = defaultStyle() );
  40.  
  41.   IRadioButton ( unsigned long id,
  42.                  IWindow*      parent );
  43.  
  44.   IRadioButton ( const IWindowHandle& handle );
  45.  
  46. virtual
  47.  ~IRadioButton ( );
  48.  
  49. /*---------------------------------- Styles ----------------------------------*/
  50. INESTEDBITFLAGCLASSDEF3( Style,
  51.                          IRadioButton,
  52.                          IWindow,
  53.                          IControl,
  54.                          IButton );
  55.  
  56. static const Style
  57.   IC_IMPORTU classDefaultStyle,
  58. #ifndef IC_WIN_FLAGNOP
  59.   IC_IMPORTU noCursorSelect,
  60. #endif
  61.   IC_IMPORTU autoSelect;
  62.  
  63. static Style
  64.   defaultStyle      ( );
  65. static void
  66.   setDefaultStyle   ( const Style&    style);
  67.  
  68. virtual unsigned long
  69.   convertToGUIStyle ( const IBitFlag& style,
  70.                       Boolean         extendedOnly = false ) const;
  71.  
  72.  
  73. /*------------------------------- Auto Select --------------------------------*/
  74. virtual IRadioButton
  75.   &enableAutoSelect    ( Boolean enable=true ),
  76.   &disableAutoSelect   ( );
  77. virtual Boolean
  78.   isAutoSelect         ( ) const;
  79.  
  80. /*----------------------------- Style Functions ------------------------------*/
  81. #ifndef IC_MOTIFWIN_FLAGNOP
  82. virtual IRadioButton
  83.   &enableCursorSelect  ( Boolean enable=true ),
  84.   &disableCursorSelect ( );
  85. Boolean
  86.   isCursorSelect       ( ) const;
  87. #endif
  88.  
  89. /*-------------------------------- Selection ---------------------------------*/
  90. static const unsigned long
  91.   IC_IMPORTU noSelections;
  92. unsigned long
  93.   selectedIndex        ( ) const;
  94.  
  95. protected:
  96. /*---------------------------------- Layout ----------------------------------*/
  97. virtual ISize
  98.   calcMinimumSize      ( ) const;
  99.  
  100. /*---------------------- Event Handling Implementation -----------------------*/
  101.  
  102. private:
  103. /*--------------------------------- Private ----------------------------------*/
  104. friend class IRadioHandler;
  105.  
  106. static Style
  107.   currentDefaultStyle;
  108.  
  109. IRadioButtonData
  110.  *fRadioButtonData;
  111.  
  112. /*----------------------------- Hidden Functions -----------------------------*/
  113.   IRadioButton         ( const IRadioButton& );
  114. IRadioButton
  115.  &operator=            ( const IRadioButton& );
  116. };  // class IRadioButton
  117.  
  118. INESTEDBITFLAGCLASSFUNCS( Style, IRadioButton );
  119.  
  120. #pragma pack()
  121.  
  122. #endif  // _IRADIOBT_
  123.