home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / ibmcli / icheckbx.hp_ / ICHECKBX.HPP
Encoding:
C/C++ Source or Header  |  1992-10-26  |  6.3 KB  |  135 lines

  1. #ifndef _ICHECKBX_
  2.   #define _ICHECKBX_
  3. /*******************************************************************************
  4. * FILE NAME: Icheckbx.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *    Icheckbx - This class creates and manages the check box control window.   *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   Licensed Materials - Property of IBM                                       *
  12. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  13. *   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. * $Log:   R:/IBMCLASS/IBASECTL/VCS/ICHECKBX.HPV  $
  18. //
  19. //   Rev 1.6   25 Oct 1992 17:05:10   nunn
  20. //changed library name to ICLUI
  21. //
  22. //   Rev 1.5   25 Oct 1992 10:49:32   boezeman
  23. //Added documentation and converted file to skeleton.hpp format.
  24.  
  25.       Rev 1.4   13 Oct 1992 21:21:56   tsuji
  26.    Correct comments around log directive.
  27.  
  28.       Rev 1.3   13 Oct 1992 20:56:36   tsuji
  29.    Correct log directive, remove IBM Confidential classification.
  30.  
  31.       Rev 1.2   13 Oct 1992 19:05:36   tsuji
  32.    Remove no-op virtual destructor, add Inherited typedef.
  33. *******************************************************************************/
  34. #ifndef _ISETBUT_
  35.   #include <isetbut.hpp>
  36. #endif
  37.  
  38. // Forward declarations for other classes:
  39. class ICheckBox;  /* chkbx */
  40. class IRectangle;
  41. class ISize;
  42. class IWindowHandle;
  43. #ifndef _IBITFLAG_
  44.   #include <ibitflag.hpp>
  45. #endif
  46. class ICheckBox : public ISettingButton  {
  47. /*******************************************************************************
  48. * This class creates and operates on a checkbox.                               *
  49. *                                                                              *
  50. * To use this class, create an instance of this class as follows:              *
  51. *   ICheckBox chkbxChoice(ID_CHOICE, this, IRectangle(10,10,30,12));           *
  52. *   chkbxChoice.setText("Hot and Spicy");                                      *
  53. * User action or invoking an operation on the check box                        *
  54. * will cause an IControlEvent.                                                 *
  55. * Use the id() and notifyCode() operations in IControlEvent to process the     *
  56. * event(e.g. a notification code of BN_CLICKED or BN_DBLCLICKED).              *
  57. *                                                                              *
  58. *                                                                              *
  59. * EXAMPLE:                                                                     *
  60. *   <sample code>                                                              *
  61. *******************************************************************************/
  62. typedef ISettingButton
  63.   Inherited;
  64. public:
  65. INESTEDBITFLAGCLASSDEF3(Style, ICheckBox, IWindow,
  66.                         IControl, IButton);
  67.                                   // style class definition
  68. static const Style
  69.   autoSelect;
  70. static const Style&
  71.   defStyle;
  72. /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
  73. | There are 3 ways to construct instances of this class:                       |
  74. |   1. default                                                                 |
  75. |   2. From a Dialog Template                                                  |
  76. |   3. From a Window                                                           |
  77. ------------------------------------------------------------------------------*/
  78.   ICheckBox(unsigned long Id,
  79.             const IWindow* parent,
  80.             const IWindow* owner,
  81.             const IRectangle& initial,
  82.             Style style = defStyle);
  83.  
  84.   ICheckBox(unsigned long Id,
  85.             const IWindow* parentDialog);
  86.  
  87.   ICheckBox(IWindowHandle handle);
  88.  
  89. /*-------------------------------- STYLES --------------------------------------
  90. | These function provide means of getting and setting the default style        |
  91. | attributes of instances of this class:                                       |
  92. |   defaultStyle    - returns the check box control default style setting      |
  93. |   setDefaultStyle - sets the check box control default style                 |
  94. ------------------------------------------------------------------------------*/
  95. static Style
  96.   defaultStyle();
  97. static void
  98.   setDefaultStyle(Style style);
  99.  
  100. /*-------------------------------- OVERLOADED AUTOSELECT------------------------
  101. | These operations are overloaded since the actual style setting is different. |
  102. |  enableAutoSelect  - sets/removes the check box control to/from the          |
  103. |                       autoselect style                                       |
  104. |  disableAutoSelect - removes the autoselect style from the check box control |
  105. |  isAutoSelect      - returns true is the check box control has the           |
  106. |                      autoselect style set else it returns false              |
  107. ------------------------------------------------------------------------------*/
  108. virtual void
  109.   enableAutoSelect(),
  110.   disableAutoSelect();
  111. virtual Boolean
  112.   isAutoSelect() const;
  113. protected:
  114. /*----------------------------- LAYOUT SIZE ------------------------------------
  115. | calcMinSize - returns the minimum size that this check box control should be.|
  116. ------------------------------------------------------------------------------*/
  117. virtual ISize
  118.   calcMinSize();
  119.  
  120. static Style
  121.   classDefaultStyle;
  122.  
  123. private:
  124. /*--------------------------------- PRIVATE ----------------------------------*/
  125.   ICheckBox(const ICheckBox&);
  126. //ICheckBox& operator=(const ICheckBox&);
  127.  
  128. static const Style
  129.   checkBox;
  130. };  // class ICheckBox
  131.  
  132. INESTEDBITFLAGCLASSFUNCS(Style, ICheckBox);
  133.                                   // global style functions
  134. #endif  /* _ICHECKBX_ */
  135.