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

  1. #ifndef _IBUTTON_
  2.   #define _IBUTTON_
  3. /*******************************************************************************
  4. * FILE NAME: Ibutton.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *    Ibutton - The button class is the abstract base class for button controls.*
  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/IBUTTON.HPV  $
  18. //
  19. //   Rev 1.7   25 Oct 1992 17:05:08   nunn
  20. //changed library name to ICLUI
  21. //
  22. //   Rev 1.6   25 Oct 1992 10:51:26   boezeman
  23. //Add documentation and converted file to skeleton.hpp format.
  24.  
  25.       Rev 1.5   13 Oct 1992 21:21:34   tsuji
  26.    Correct comments around log directive.
  27.  
  28.       Rev 1.4   13 Oct 1992 20:56:30   tsuji
  29.    Correct log directive, remove IBM Confidential classification.
  30.  
  31.       Rev 1.3   13 Oct 1992 19:05:30   tsuji
  32.    Remove no-op virtual destructor, add Inherited typedef.
  33. *******************************************************************************/
  34. #ifndef _ITEXTCTL_
  35.   #include <itextctl.hpp>
  36. #endif
  37.  
  38. // Forward declarations for other classes:
  39. class IButton;  /* but */
  40. #ifndef _IBITFLAG_
  41.   #include <ibitflag.hpp>
  42. #endif
  43.  
  44. class IButton : public ITextControl  {
  45. /*******************************************************************************
  46. * This button class is the abstract base class for button controls.            *
  47. *                                                                              *
  48. * An instance of this class cannot be created.  Actual button controls are     *
  49. * created by subclassing from this base class.                                 *
  50. *                                                                              *
  51. * EXAMPLE:                                                                     *
  52. *   <sample code>                                                              *
  53. *******************************************************************************/
  54. typedef ITextControl
  55.   Inherited;
  56. public:
  57. INESTEDBITFLAGCLASSDEF2(Style, IButton, IWindow, IControl);
  58.                                 // style class definition
  59. static const Style
  60.   noPointerFocus,
  61.   autosize;
  62. /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
  63. | There is 1 way to construct instances of this class:                         |
  64. |   1. default                                                                 |
  65. ------------------------------------------------------------------------------*/
  66.   IButton() {;}
  67.  
  68.  
  69. /*-------------------------------- MOUSE FOCUS STYLE ---------------------------
  70. |   enableMouseClickFocus  - Enable the button to receive the focus when the   |
  71. |                            user clicks on the button using the mouse.        |
  72. |   disableMouseClickFocus - Disable the button to receive the focus when the  |
  73. |                            user clicks on the button using the mouse.        |
  74. ------------------------------------------------------------------------------*/
  75. void
  76.   enableMouseClickFocus(),
  77.   disableMouseClickFocus();
  78.  
  79. /*-------------------------------- HILITE STATE --------------------------------
  80. | These operations test and set a button's hilite state.  A highlighted button |
  81. | will have the same apperances as if the mouse selection button (mouse        |
  82. | button 1) was pressed while the mouse pointer was over the button control.   |
  83. |   isHilited  -  return true is the button's hilite state is set              |
  84. |   hilite     -  set the button's hilite state                                |
  85. |   unhilite   -  turn off the button's hilite state                           |
  86. ------------------------------------------------------------------------------*/
  87. Boolean
  88.   isHilited() const;
  89. void
  90.   hilite(),
  91.   unhilite();
  92.  
  93. /*-------------------------------- CLICK THE BUTTON ----------------------------
  94. |   click  - Simulates the user clicking on the button control using the       |
  95. |            mouse selection button.                                           |
  96. ------------------------------------------------------------------------------*/
  97. void
  98.   click();
  99.  
  100. protected:
  101. static const Style
  102.   buttonTypes;                // for derived classes
  103.  
  104. private:
  105. /*--------------------------------- PRIVATE ----------------------------------*/
  106.   IButton(const IButton&);
  107. //IButton& operator=(const IButton&);
  108. };  // class IButton
  109.  
  110. INESTEDBITFLAGCLASSFUNCS(Style, IButton);
  111.                                   // global style functions
  112. #endif  /* _IBUTTON_ */
  113.