home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
VSCPPv8.zip
/
VACPP
/
IBMCPP
/
samples
/
VISBUILD
/
RAPSHEET
/
SUSCNRMF.CPV
< prev
next >
Wrap
Text File
|
1995-05-12
|
5KB
|
134 lines
//****************************************************************************
// Additional Member Functions for ISuspectCnrView - (suscnrmf.cpp) *
// *
// COPYRIGHT: Copyright (C) International Business Machines Corp., 1994,1995 *
// *
// DISCLAIMER OF WARRANTIES: *
// The following [enclosed] code is sample code created by IBM *
// Corporation. This sample code is not part of any standard IBM product *
// and is provided to you solely for the purpose of assisting you in the *
// development of your applications. The code is provided "AS IS", *
// without warranty of any kind. IBM shall not be liable for any damages *
// arising out of your use of the sample code, even if they have been *
// advised of the possibility of such damages. *
//****************************************************************************
//NOTE: WE RECOMMEND USING A FIXED-SPACE FONT TO LOOK AT THE SOURCE.
//
#ifndef _ITRACE_
#include <itrace.hpp>
#endif
#ifndef _IVSEQ_
#include <ivseq.h>
#endif
#ifndef _ICNROLST_
#include <icnrolst.hpp>
#endif
//***************************************************************************
// Additional events for ISuspectCnrView
//***************************************************************************
INotificationId ISuspectCnrView::suspectToOpenId = "ISuspectCnrView::suspectToOpen";
//***************************************************************************
// Additional member functions for ISuspectCnrView
//***************************************************************************
/*------------------------------------------------------------------------------
| ISuspectCnrView deselectAllSuspects(IVBContainerControl &)
-----------------------------------------------------------------------------*/
ISuspectCnrView & ISuspectCnrView :: deselectAllSuspects(
IVBContainerControl< ISuspect *,
IVSequence<ISuspect *>,
ISuspectCnrViewSuspectCnrCnrObj > & aSuspectCnr)
{
IFUNCTRACE_DEVELOP();
try
{
ICnrObjectSet CnrObjs = aSuspectCnr.objectList();
ICnrObjectSet::Cursor aCursor(CnrObjs);
int i=1;
forCursor(aCursor)
{
if (aSuspectCnr.isSelected(CnrObjs.elementAt(aCursor)))
aSuspectCnr.deselect(i);
i++;
}
}
catch (IException& exc) {};
return *this;
}
/*------------------------------------------------------------------------------
| ISuspectCnrView openTargetSuspects(IVBContainerControl &, IVSequence &)
-----------------------------------------------------------------------------*/
ISuspectCnrView & ISuspectCnrView :: openTargetSuspects(
IVSequence<ISuspect *> & aSuspectCollection)
{
IFUNCTRACE_DEVELOP();
try
{
ITRACE_DEVELOP("The number of elements to open: " +
IString(aSuspectCollection.numberOfElements()));
IVSequence<ISuspect *>::Cursor aCursor(aSuspectCollection);
forCursor(aCursor)
{
setSuspectToOpen(aSuspectCollection.elementAt(aCursor));
}
}
catch (IException& exc) {};
return *this;
}
/*------------------------------------------------------------------------------
| ISuspectCnrView selectAllSuspects(IVBContainerControl &)
-----------------------------------------------------------------------------*/
ISuspectCnrView & ISuspectCnrView :: selectAllSuspects(
IVBContainerControl< ISuspect *,
IVSequence<ISuspect *>,
ISuspectCnrViewSuspectCnrCnrObj > & aSuspectCnr)
{
IFUNCTRACE_DEVELOP();
try
{
ICnrObjectSet CnrObjs = aSuspectCnr.objectList();
ICnrObjectSet::Cursor aCursor(CnrObjs);
int i=1;
forCursor(aCursor)
{
if (!aSuspectCnr.isSelected(CnrObjs.elementAt(aCursor)))
aSuspectCnr.select(i);
i++;
}
}
catch (IException& exc) {};
return *this;
}
//***************************************************************************
// Access member functions for additional data members for ISuspectCnrView
//***************************************************************************
/*------------------------------------------------------------------------------
| ISuspect * suspectToOpen() const
-----------------------------------------------------------------------------*/
ISuspect * ISuspectCnrView::suspectToOpen() const
{
return iSuspectToOpen;
}
/*------------------------------------------------------------------------------
| ISuspectCnrView & setSuspectToOpen(ISuspect *) const
-----------------------------------------------------------------------------*/
ISuspectCnrView & ISuspectCnrView::setSuspectToOpen(ISuspect * aSuspect)
{
if (iSuspectToOpen != aSuspect)
{
iSuspectToOpen = aSuspect;
}
/* always fire the event */
notifyObservers(INotificationEvent(ISuspectCnrView::suspectToOpenId, *this));
return *this;
}