home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / IMCEVT.HPP < prev    next >
C/C++ Source or Header  |  1993-10-22  |  6KB  |  98 lines

  1. #ifndef _IMCEVT_
  2.   #define _IMCEVT_
  3. /*******************************************************************************
  4. * FILE NAME: imcevt.hpp                                                        *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     IMouseClickEvent - represents a mouse button event                       *
  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. *******************************************************************************/
  18. #ifndef _IEVENT_
  19.   #include <ievent.hpp>
  20. #endif
  21.  
  22. /*----------------------------------------------------------------------------*/
  23. /* Align classes on four byte boundary.                                       */
  24. /*----------------------------------------------------------------------------*/
  25. #pragma pack(4)
  26.  
  27. // Forward declarations for other classes:
  28. class IPoint;
  29. class IWindowHandle;
  30.  
  31.  
  32. class IMouseClickEvent : public IEvent {
  33. typedef IEvent
  34.   Inherited;
  35. /*******************************************************************************
  36. * The IMouseClickEvent class represents a mouse click event.  An               *
  37. * IMouseClickEvent is created by a mouse click handler when the user presses,  *
  38. * releases, clicks, or double-clicks the mouse button.                         *
  39. *                                                                              *
  40. * Mouse click events are first dispatched to the window that the mouse         *
  41. * pointer is positioned on.  If that window does not process the mouse click   *
  42. * event, the event is dispatched to its owner window.  The event continues to  *
  43. * be dispatched to the next owner window until a handler stops the processing  *
  44. * or a window processes the mouse click event itself.                          *
  45. *******************************************************************************/
  46. public:
  47. /*------------------------ Constructor/Destructor ------------------------------
  48. | The only way to construct instances of this class is from an instance of     |
  49. | the IEvent class.                                                            |
  50. ------------------------------------------------------------------------------*/
  51.   IMouseClickEvent ( IEvent& event );
  52. virtual
  53.  ~IMouseClickEvent ( );
  54.  
  55. /*-------------------------------- Accessors -----------------------------------
  56. | These functions provide a means of querying values from instances of this    |
  57. | class:                                                                       |
  58. |   mousePosition - Returns the mouse pointer position relative to the window  |
  59. |                   returned by the IEvent::window function.                   |
  60. |   handleOnTop   - Returns the handle of the window the mouse pointer is      |
  61. |                   over.                                                      |
  62. |   MouseNumber   - Enumeration that defines the values that the mouseNumber   |
  63. |                   function can return.  The valid values are:                |
  64. |                     button1  - Mouse button 1.                               |
  65. |                     button2  - Mouse button 2.                               |
  66. |                     button3  - Mouse button 3.                               |
  67. |                     button12 - Mouse buttons 1 and 2, pressed together.      |
  68. |   mouseNumber   - Returns the mouse button that was used.                    |
  69. |   MouseAction   - Enumeration that defines the values that the mouseAction   |
  70. |                   function can return.  The valid values are:                |
  71. |                     click       - A mouse button was pressed and released.   |
  72. |                     doubleClick - A mouse button was pressed and released    |
  73. |                                   twice in succession.                       |
  74. |                     down        - A mouse button was pressed.                |
  75. |                     up          - A mouse button was released.               |
  76. |   mouseAction   - Returns the action taken on the mouse.                     |
  77. ------------------------------------------------------------------------------*/
  78. IPoint
  79.   mousePosition    ( ) const;
  80. IWindowHandle
  81.   handleOnTop      ( ) const;
  82.  
  83. enum MouseNumber { button1, button2, button3, button12 };
  84. MouseNumber
  85.   mouseNumber      ( ) const;
  86.  
  87. enum MouseAction { click, doubleClick, down, up };
  88. MouseAction
  89.   mouseAction      ( ) const;
  90. }; // IMouseClickEvent
  91.  
  92. /*----------------------------------------------------------------------------*/
  93. /* Resume compiler default packing.                                           */
  94. /*----------------------------------------------------------------------------*/
  95. #pragma pack()
  96.  
  97. #endif /* _IMCEVT_ */
  98.