home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / visbuild / calculat / cppwv13 / iclrdsp.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-16  |  2.9 KB  |  63 lines

  1. /******************************************************************************
  2. * .FILE:        iclrdsp.cpp                                                   *
  3. *                                                                             *
  4. * .DESCRIPTION: Implementation for the class, IClearDisplay                   *
  5. *                                                                             *
  6. * .CLASSES:     IClearDisplay                                                 *
  7. *                                                                             *
  8. * .COPYRIGHT:                                                                 *
  9. *    Licensed Material - Program-Property of IBM                              *
  10. *    (C) Copyright IBM Corp. 1992, 1996 - All Rights Reserved                 *
  11. *                                                                             *
  12. * .DISCLAIMER:                                                                *
  13. *   The following [enclosed] code is sample code created by IBM               *
  14. *   Corporation.  This sample code is not part of any standard IBM product    *
  15. *   and is provided to you solely for the purpose of assisting you in the     *
  16. *   development of your applications.  The code is provided 'AS IS',          *
  17. *   without warranty of any kind.  IBM shall not be liable for any damages    *
  18. *   arising out of your use of the sample code, even if they have been        *
  19. *   advised of the possibility of such damages.                               *
  20. *                                                                             *
  21. * .NOTE: WE RECOMMEND USING A FIXED SPACE FONT TO LOOK AT THE SOURCE          *
  22. *                                                                             *
  23. ******************************************************************************/
  24.  
  25. #include <istring.hpp>
  26. #include <iwindow.hpp>  // IWindow class
  27. #include <icmdhdr.hpp>   // ICommandHandler
  28.  
  29. #ifndef _ITRACE_        
  30. #include <itrace.hpp>   
  31. #endif               
  32.    
  33. #include "iclrdsp.hpp"    // IClearDisplay class header
  34.  
  35. //***************************************************************************
  36. // Class:   IClearDisplay
  37. //
  38. // Purpose: Clears the display values via the ICommandHandler sub class
  39. //
  40. //***************************************************************************
  41.  
  42. IClearDisplay :: IClearDisplay(IEntryField & theDisplay, IPushButton & theClearPushButton) :
  43.         display(theDisplay), clearPushButton(theClearPushButton)
  44. {
  45. }
  46.  
  47. IClearDisplay :: ~IClearDisplay()
  48. {
  49. }
  50.  
  51. Boolean IClearDisplay::command(ICommandEvent& cmdEvent)
  52. {
  53.  if ( cmdEvent.commandId() == clearPushButton.id() )
  54.     {
  55.     IFUNCTRACE_DEVELOP();
  56.     ITRACE_DEVELOP(" firing connection : Push Button8(clicked), to Entry Field(removeAll)");
  57.     try {display.removeAll();}
  58.     catch (IException& exc) {};
  59.     return (true);
  60.     }
  61.  else return(false);
  62. }
  63.