home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / toolba.zip / AINFOA.HPP < prev    next >
Text File  |  1994-09-08  |  4KB  |  72 lines

  1. /************************************************************************
  2. * AInfoA.hpp - info area class header                                   *
  3. * --------------------------------------------------------------------- *
  4. * Override IInfoArea class in order to allow "fly-over" micro-help via  *
  5. * a user message sent from controls to the frame.  The user message is  *
  6. * expected to contain the id of the window in parameter one (used by    *
  7. * the standard IInfoArea processing to get the string to display), and  *
  8. * a pointer to the window which is used by AInfoArea to test for mouse  *
  9. * pointer inclusion in the control after a timeout.                     *
  10. * --------------------------------------------------------------------- *
  11. * Overridden methods:                                                   *
  12. *                                                                       *
  13. * IInfoArea &setInactiveText - set inactive text via a resource id or   *
  14. *                              an IString.  The method is overridden in *
  15. *                              order to capture the id for resetting    *
  16. *                              the text after the mouse leaves the      *
  17. *                              control being monitored.                 *
  18. *                                                                       *
  19. * New methods: -------------------------------------------------------- *
  20. *                                                                       *
  21. * void setHelpId -             set the message id of the user message   *
  22. *                              used to communicate a micro-help request *
  23. *                              from a control.  This number is added to *
  24. *                              WM_USER to prevent interference with PM. *
  25. *                                                                       *
  26. * Protected methods: -------------------------------------------------- *
  27. *                                                                       *
  28. * Boolean microHelp -          overridden from AMicroHelpHandler class  *
  29. *                              to process micro-help request message    *
  30. *                              from control.                            *
  31. *                                                                       *
  32. * Boolean tick -               overridden from ATimeHandler class to    *
  33. *                              process timeout after receipt of micro-  *
  34. *                              help request message.                    *
  35. *                                                                       *
  36. ************************************************************************/
  37.  
  38. #ifndef _AINFOA_HPP
  39. #define _AINFOA_HPP
  40.  
  41. #include <iinfoa.hpp>
  42. #include "atimehdr.hpp"
  43. #include "amhlphdr.hpp"
  44.  
  45. #define MICRO_HELP_MSG  1              // message id of micro help
  46. #define MICRO_TIMEOUT   100UL          // one tenth of a second timeout
  47.  
  48. class AInfoArea : public IInfoArea,
  49.                   public ATimeHandler,
  50.                   public AMicroHelpHandler
  51. {
  52. public:
  53.    AInfoArea( IFrameWindow *frame, unsigned long id = 0 );
  54.    virtual ~AInfoArea();
  55.  
  56.    virtual IInfoArea & setInactiveText( const IString &string );
  57.    virtual IInfoArea & setInactiveText( unsigned long id );
  58.    virtual void setHelpId( unsigned long id );
  59.  
  60. protected:
  61.    virtual Boolean tick( IEvent &evt );
  62.    virtual Boolean microHelp( IEvent &evt );
  63.  
  64. private:
  65.    unsigned long  inactiveId;       // inactive text id
  66.    unsigned long  currentId;        // current displayed help Id
  67.    IWindow       *activeWindow;     // window with micro help
  68. };
  69.  
  70. #endif /* _AINFOA_HPP_ not defined */
  71.  
  72.