home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / ioc / lancelot / lgeneric.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  2.6 KB  |  52 lines

  1. /******************************************************************************
  2. * .FILE:         lgeneric.cpp                                                 *
  3. *                                                                             *
  4. * .DESCRIPTION:  Lancelot Sample Program:              Class Implementation   *
  5. *                                                                             *
  6. * .CLASSES:      ACheckBoxHandler                                             *
  7. *                                                                             *
  8. * .COPYRIGHT:                                                                 *
  9. *                                                                             *
  10. * .DISCLAIMER:                                                                *
  11. *                                                                             *
  12. * .NOTE: WE RECOMMEND USING A FIXED SPACE FONT TO LOOK AT THE SOURCE          *
  13. *                                                                             *
  14. ******************************************************************************/
  15.  
  16. #ifndef _IBASE_                         //Make sure ibase.hpp is included
  17.   #include <ibase.hpp>                  //  since that is where IC_<environ>
  18. #endif                                  //  is defined.
  19. #include "lancelot.h"
  20. #include <ictlevt.hpp>
  21. #include "lgeneric.hpp"
  22.  
  23. /******************************************************************************/
  24. /* ACheckBoxHandler::selected      - an ISelectEventHandler                     */
  25. /*   return true if event handled else return false                           */
  26. /* display the number of the button selected in a text control                */
  27. /******************************************************************************/
  28. IBase :: Boolean ACheckBoxHandler::selected(IControlEvent& evt )
  29. {
  30.  
  31.    unsigned long ulButtonId = evt.controlId();
  32.                                        // if the id is one of the buttons
  33.                                        // then display the button number in the
  34.  
  35.   switch (evt.controlId()) {       //Get command id
  36.  
  37.     case ID_CHECK_BOX:                    //Code to Process
  38.       //atusData.toggleActive();
  39.       if (toggle == true)
  40.          toggle = ACheckBoxHandler::false;
  41.       else
  42.          toggle = ACheckBoxHandler::true;
  43.  
  44.       return(true);                     //Return command processed
  45.       break;                            //
  46.  
  47.    }                            // static text control
  48.  
  49.    return (false);
  50.  
  51. } /* end ACheckBoxHandler::selected(...) */
  52.