home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / visbuild / rapsheet / suscnrmf.cpv < prev    next >
Encoding:
Text File  |  1996-02-19  |  4.8 KB  |  99 lines

  1. /******************************************************************************
  2. * .FILE:        suscnrmf.cpp                                                  *
  3. *                                                                             *
  4. * .DESCRIPTION: Implementation of additional member functions for the class   *
  5. *               ISuspectCnrView                                               *
  6. *                                                                             *
  7. * .CLASSES:                                                                   *
  8. *                                                                             *
  9. * .COPYRIGHT:                                                                 *
  10. *    Licensed Material - Program-Property of IBM                              *
  11. *    (C) Copyright IBM Corp. 1992, 1996 - All Rights Reserved                 *
  12. *                                                                             *
  13. * .DISCLAIMER:                                                                *
  14. *   The following [enclosed] code is sample code created by IBM               *
  15. *   Corporation.  This sample code is not part of any standard IBM product    *
  16. *   and is provided to you solely for the purpose of assisting you in the     *
  17. *   development of your applications.  The code is provided 'AS IS',          *
  18. *   without warranty of any kind.  IBM shall not be liable for any damages    *
  19. *   arising out of your use of the sample code, even if they have been        *
  20. *   advised of the possibility of such damages.                               *
  21. *                                                                             *
  22. * .NOTE: WE RECOMMEND USING A FIXED SPACE FONT TO LOOK AT THE SOURCE          *
  23. *                                                                             *
  24. ******************************************************************************/
  25. #include <itrace.hpp>
  26. #include <ivseq.h>
  27. #include <icnrolst.hpp>
  28.  
  29. //***************************************************************************
  30. // Additional events for ISuspectCnrView
  31. //***************************************************************************
  32. INotificationId ISuspectCnrView::suspectToOpenId = "ISuspectCnrView::suspectToOpen";
  33.  
  34.  
  35. //***************************************************************************
  36. // Additional member functions for ISuspectCnrView
  37. //***************************************************************************
  38. /*------------------------------------------------------------------------------
  39.  | ISuspectCnrView selectAllSuspects(IContainerControl*, Boolean)
  40.  -----------------------------------------------------------------------------*/
  41. ISuspectCnrView & ISuspectCnrView :: selectAllSuspects(IContainerControl* aCnr,
  42.                                                        Boolean select)
  43. {
  44.    IFUNCTRACE_DEVELOP();
  45.    try
  46.    {
  47.       ICnrObjectSet CnrObjs = aCnr->objectList();
  48.       ICnrObjectSet::Cursor aCursor(CnrObjs);
  49.       forCursor(aCursor)
  50.          aCnr->setSelected(CnrObjs.elementAt(aCursor), select);
  51.    }
  52.    catch (IException& exc) {};
  53.    return *this;
  54. }
  55.  
  56. /*------------------------------------------------------------------------------
  57.  | ISuspectCnrView openTargetSuspects(IVSequence &)
  58.  -----------------------------------------------------------------------------*/
  59. ISuspectCnrView & ISuspectCnrView :: openSuspects(
  60.    IVSequence<ISuspect*> *aSuspectList)
  61. {
  62.    IFUNCTRACE_DEVELOP();
  63.    try
  64.    {
  65.       ITRACE_DEVELOP("The number of elements to open: " +
  66.                      IString(aSuspectList->numberOfElements()));
  67.       IVSequence<ISuspect*>::Cursor aCursor(*aSuspectList);
  68.       forCursor(aCursor)
  69.          setSuspectToOpen(aSuspectList->elementAt(aCursor));
  70.    }
  71.    catch (IException& exc) {};
  72.    return *this;
  73. }
  74.  
  75. //***************************************************************************
  76. // Access member functions for additional data members for ISuspectCnrView
  77. //***************************************************************************
  78. /*------------------------------------------------------------------------------
  79.  | ISuspect * suspectToOpen() const
  80.  -----------------------------------------------------------------------------*/
  81. ISuspect * ISuspectCnrView::suspectToOpen() const
  82. {
  83.   return iSuspectToOpen;
  84. }
  85.  
  86. /*------------------------------------------------------------------------------
  87.  | ISuspectCnrView & setSuspectToOpen(ISuspect *) const
  88.  -----------------------------------------------------------------------------*/
  89. ISuspectCnrView & ISuspectCnrView::setSuspectToOpen(ISuspect * aSuspect)
  90. {
  91.   if (iSuspectToOpen != aSuspect)
  92.   {
  93.     iSuspectToOpen = aSuspect;
  94.   }
  95.   /* always fire the event */
  96.   notifyObservers(INotificationEvent(ISuspectCnrView::suspectToOpenId, *this));
  97.   return *this;
  98. }
  99.