home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
VSCPPv8.zip
/
VACPP
/
IBMCPP
/
samples
/
IOC
/
CNR
/
ACNR.HPP
< prev
next >
Wrap
Text File
|
1995-05-01
|
6KB
|
153 lines
#ifndef ACNREXWINDOW_HPP
#define ACNREXWINDOW_HPP
/******************************************************************************/
/* Container Sample Program - C++ Class Header (ACNR.HPP) */
/* */
/* COPYRIGHT: Copyright (C) International Business Machines Corp., 1992,1993. */
/* */
/* 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 */
/******************************************************************************/
#include <iframe.hpp> //Include IFrameWindow Class Header
#include <icmdhdr.hpp> //Include ICommandEvent & ICommandHandler
#include <icnrctl.hpp>
#include <icnrhdr.hpp>
#include <icnrehdr.hpp>
#include <icnrmhdr.hpp>
#include <imenuevt.hpp>
class ACnrexWindow;
//**************************************************************************
// Class: ACnrMenuHandler *
// *
// Purpose: Subclass of ICnrMenuHandler so that the a PopUp Menu can be *
// created. *
// *
//**************************************************************************
class ACnrMenuHandler: public ICnrMenuHandler //
{
public:
ACnrMenuHandler
&setCnr(IContainerControl * pcnr) { pcnrCtl = pcnr; return *this; };
protected: //Define Protected Member
Boolean makePopUpMenu(IMenuEvent& cnEvt);
private:
IContainerControl * pcnrCtl;
};
//**************************************************************************
// Class: Department *
// *
// Purpose: describes department *
// *
//**************************************************************************
class Department : public IContainerObject
{
friend class IContainerColumn;
friend class ACnrexWindow;
public:
Department(const IString& Name, const IPointerHandle& Icon, const IString& Code,
const IString& Address);
IString Code() const { return strCode; }
IString Address() const { return strAddress; }
void setCode (IString code) {strCode = code;}
void setAddress (IString address) {strAddress = address;}
virtual
void handleOpen (IContainerControl* container);
private:
IString strAddress;
IString strCode;
};
//**************************************************************************
// Class: ADepartmentView *
// *
// Purpose: Window for department *
// *
//**************************************************************************
class ADepartmentView : public IFrameWindow
{
public:
ADepartmentView(Department * aDept, IContainerControl* anOwner);
~ADepartmentView();
private:
Department * saveDept;
};
//**************************************************************************
// Class: ACnrexWindow *
// *
// Purpose: Main Window for cnrex sample application *
// *
//**************************************************************************
class ACnrexWindow : public IFrameWindow,
public ICommandHandler,
public ICnrHandler
{
friend class ACnrMenuHandler;
public: //Define the Public Information
ACnrexWindow(unsigned long windowId); //Constructor for this class
~ACnrexWindow () {};
protected: //Define Protected Member
Boolean command(ICommandEvent& cmdEvent);
private: //Define Private Information
IContainerControl * cnrCtl;
Department *dept1, *dept2, *dept3, *dept4, *dept5, *dept6;
IContainerColumn * colIcon, *colName, *colCode, *colAddress;
IMenuBar * menuBar;
ACnrMenuHandler Chdr;
ICnrEditHandler * _pcnrEdit;
};
class SelectedObjectsFilter : public IContainerControl::FilterFn
{
virtual Boolean
isMemberOf( IContainerObject* object,
IContainerControl* container ) const
{
return container->isSelected( object );
}
};
class AllObjectsFilter : public IContainerControl::FilterFn
{
virtual Boolean
isMemberOf( IContainerObject* object,
IContainerControl* container) const
{
return true;
}
};
#endif
class CnrEditHandler : public ICnrEditHandler
{
typedef ICnrEditHandler
Inherited;
};