home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / help / helpmenu / hcmdhdr.hpp next >
Encoding:
C/C++ Source or Header  |  1996-10-29  |  1.8 KB  |  63 lines

  1. #ifndef _HCMDHDR_
  2. #define _HCMDHDR_
  3. //*********************************************************
  4. // Using Help - Help Menu Choices
  5. //
  6. // Copyright (C) 1994, Law, Leong, Love, Olson, Tsuji.
  7. // Copyright (c) 1997 John Wiley & Sons, Inc.
  8. // All Rights Reserved.
  9. //*********************************************************
  10. #include <icmdhdr.hpp>
  11. #include <ihelp.hpp>
  12. #include <imsgbox.hpp>
  13. #include <istring.hpp>
  14. #include "helpmenu.h"
  15.  
  16. class HelpCommandHandler : public ICommandHandler {
  17. protected:
  18. virtual Boolean
  19.   command  ( ICommandEvent& event )
  20.   {
  21.     Boolean
  22.       dontPassOn = false;
  23.     switch ( event.commandId() )
  24.     {
  25.        case ID_USINGHELP:
  26.        {      // A user has selected the "Using help"
  27.               // (or "How to use help") choice.
  28.          IHelpWindow
  29.           *help = IHelpWindow::helpWindow( event.window() );
  30.          help->show( IHelpWindow::using );
  31.          dontPassOn = true;
  32.          break;
  33.        }
  34.        case ID_HELPCONTENTS:
  35.        {      // A user has selected the "Contents" choice.
  36.          IHelpWindow
  37.           *help = IHelpWindow::helpWindow( event.window() );
  38.          help->show( IHelpWindow::contents );
  39.          dontPassOn = true;
  40.          break;
  41.        }
  42.        case ID_PRODUCTINFO:
  43.        {      // A user has selected the "Product Information" choice.
  44.          IMessageBox
  45.            msg( event.dispatchingWindow() );
  46.          msg
  47.           .setTitle( "About This Example" )
  48.           .show( "This is the help menu example program from "
  49.                    "\"Power GUI Programming with VisualAge for C++.\"",
  50.                  IMessageBox::noIcon | IMessageBox::moveable,
  51.                  PANEL_PRODUCT_INFO_MSG );
  52.          dontPassOn = true;
  53.          break;
  54.        }
  55.        default:
  56.          break;
  57.     }
  58.     return dontPassOn;
  59.   }
  60. }; // HelpCommandHandler
  61.  
  62. #endif // _HCMDHDR_
  63.