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

  1. #ifndef _I3STATBX_
  2.   #define _I3STATBX_
  3. /*******************************************************************************
  4. * FILE NAME: i3statbx.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     I3statbx - This class creates and manages the three-state check box      *
  9. *                control window.                                               *
  10. *                                                                              *
  11. * COPYRIGHT:                                                                   *
  12. *   Licensed Materials - Property of IBM                                       *
  13. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  14. *   All Rights Reserved                                                        *
  15. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  16. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  17. *                                                                              *
  18. * $Log:   R:/IBMCLASS/IBASECTL/VCS/I3STATBX.HPV  $
  19. //
  20. //   Rev 1.8   25 Oct 1992 17:05:00   nunn
  21. //changed library name to ICLUI
  22. //
  23. //   Rev 1.7   25 Oct 1992 10:47:52   boezeman
  24. //Added documentation and converted file to skeleton.hpp format
  25.  
  26.       Rev 1.6   13 Oct 1992 21:17:36   tsuji
  27.    Correct comments around log directive.
  28.  
  29.       Rev 1.4   13 Oct 1992 20:55:52   tsuji
  30.    Correct log directive, remove IBM Confidential classification.
  31.  
  32.       Rev 1.3   13 Oct 1992 19:02:08   tsuji
  33.    Remove no-op virtual destructor, add Inherited typedef
  34. *******************************************************************************/
  35. #ifndef _ISETBUT_
  36.   #include <isetbut.hpp>
  37. #endif
  38.  
  39. // Forward declarations for other classes:
  40. class I3StateCheckBox;  /* s3bx */
  41. class IRectangle;
  42. class ISize;
  43. class IWindowHandle;
  44. #ifndef _IBITFLAG_
  45.   #include <ibitflag.hpp>
  46. #endif
  47.  
  48. class I3StateCheckBox : public ISettingButton {
  49. /*******************************************************************************
  50. * This class creates and manages the three-state box control window.           *
  51. *                                                                              *
  52. * To use this class, create an instance of this class as follows:              *
  53. *   I3StateCheckBox s3bxChoice(ID_CHOICE, this, IRectangle(10,10,30,12));      *
  54. *   s3bxChoice.setText("Sweet and Sour");                                      *
  55. * User action or invoking an operation on the three-state check box            *
  56. * will cause an IControlEvent.                                                 *
  57. * Use the id() and notifyCode() operations in IControlEvent to process the     *
  58. * event(e.g. a notification code of BN_CLICKED or BN_DBLCLICKED).              *
  59. *                                                                              *
  60. * EXAMPLE:                                                                     *
  61. *   <sample code>                                                              *
  62. *******************************************************************************/
  63. typedef ISettingButton
  64.   Inherited;
  65. public:
  66. INESTEDBITFLAGCLASSDEF3(Style, I3StateCheckBox,
  67.                                  IWindow, IControl, IButton);
  68.                                 // style class definition
  69. static const Style
  70.   autoSelect;
  71. static const Style& 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.   I3StateCheckBox(unsigned long Id,
  79.                   const IWindow* parent,
  80.                   const IWindow* owner,
  81.                   const IRectangle& initial,
  82.                   Style style = defStyle);
  83.  
  84.   I3StateCheckBox(unsigned long ulId,
  85.                   const IWindow* parentDialog);
  86.  
  87.   I3StateCheckBox(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 three state control default style setting    |
  93. |   setDefaultStyle - sets the three state 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 three state control to/from the        |
  103. |                       autoselect style                                       |
  104. |  disableAutoSelect - removes the autoselect style from the three state control|
  105. |  isAutoSelect      - returns true is the three state 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.  
  114. /*-------------------------------- HALFTONE OPERATIONS -------------------------
  115. |  selectHalftoned   - Selects a halftoned three state check box.              |
  116. |  isHalftoned       - Returns true if the three state control has been        |
  117. |                      halftoned selected.                                     |
  118. ------------------------------------------------------------------------------*/
  119. void
  120.   selectHalftoned();
  121. Boolean
  122.   isHalftoned() const;
  123.  
  124. protected:
  125. /*----------------------------- LAYOUT SIZE ------------------------------------
  126. | calcMinSize - Returns the minimum size that this three state control should be|
  127. ------------------------------------------------------------------------------*/
  128. virtual ISize
  129.   calcMinSize();
  130.  
  131. static Style
  132.   classDefaultStyle;
  133.  
  134. private:
  135. /*--------------------------------- PRIVATE ----------------------------------*/
  136.   I3StateCheckBox(const I3StateCheckBox&);
  137. //I3StateCheckBox& operator=(const I3StateCheckBox&);
  138.  
  139. static const Style
  140.   threeState;
  141. };  // I3StateCheckBox
  142.  
  143. INESTEDBITFLAGCLASSFUNCS(Style, I3StateCheckBox);
  144.                                   // global style functions
  145. #endif  /* _I3STATBX_ */
  146.