home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv7.zip / VACPP / IBMCPP / smarts / ICLUI / HELPHDLR.HPP < prev    next >
Text File  |  1995-06-02  |  2KB  |  82 lines

  1.  
  2. %PROLOG%
  3.  
  4. #include <ihelphdr.hpp>
  5. #include <ihelp.hpp>
  6.  
  7. #define INCL_WINHELP        //  For WM_HELP message
  8. #include <os2.h>
  9.  
  10. class IHelpTutorialEvent;
  11.  
  12. /*************************************************/
  13. /* Class: AppHelpHandler                         */
  14. /*                                               */
  15. /* Purpose: Subclass of IHelpHandler so that the */
  16. /*          correct tutorial can be displayed    */
  17. /*          when tutorial help is requested from */
  18. /*          the Help pulldown menu of AppWindow. */
  19. /*************************************************/
  20. class AppHelpHandler : public IHelpHandler
  21.  {
  22.  
  23.   protected:
  24.  
  25.      // Override this handler function to display the tutorial
  26.      //------
  27.      virtual Boolean showTutorial( IHelpTutorialEvent &tutorialEvent);
  28.  
  29.   };
  30.  
  31.  
  32. /*************************************************/
  33. /* Class: FileDlgHelpHandler                     */
  34. /*                                               */
  35. /* Purpose: Subclass of IHelpHandler. This is    */
  36. /*          so that the correct help is displayed*/
  37. /*          from the File open and Save as       */
  38. /*          dialogs.  It is only active when     */
  39. /*          one of these dialogs is up.  It      */
  40. /*          should be constructed just before    */
  41. /*          showing an IFileDialog window with   */
  42. /*          the resource ID of the correct help  */
  43. /*          to show (depending on whether the    */
  44. /*          window is a File open or Save as     */
  45. /*          dialog.                              */
  46. /*************************************************/
  47. class FileDlgHelpHandler : public IHelpHandler
  48.  {
  49.   public:
  50.  
  51.      // Constructor
  52.      FileDlgHelpHandler ( IHelpWindow* h, unsigned long r)
  53.        : help(h), resId(r) { }
  54.  
  55.   protected:
  56.  
  57.      // Override the dispatcher function to display the correct help
  58.      // panel when help is requested to an IFileDialog window.
  59.      //------
  60.      virtual Boolean dispatchHandlerEvent( IEvent &evt)
  61.      {
  62.         if ( evt.eventId() == WM_HELP ) 
  63.         {
  64.            help->show( IResourceId( resId ) );
  65.            return true;
  66.         }
  67.         else 
  68.            return false;        // Pass on to next handler
  69.      }
  70.  
  71.   private:
  72.  
  73.      IHelpWindow* help;         // Help window instance
  74.      unsigned long resId;       // Resource Id of help panel to show.
  75.                                 // (Specified at construction time.)
  76.  
  77.   };
  78.  
  79.  
  80.  
  81.  
  82.