home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
uicldd.zip
/
DMSAMP3.CPP
< prev
next >
Wrap
Text File
|
1993-09-04
|
3KB
|
96 lines
#include "dmsamp3.hpp"
void main()
{
MySourceWin sourceWin (WND_SOURCE);
MyTargetWin targetWin (WND_TARGET);
IApplication::current().run();
}
MyWindow :: MyWindow ( unsigned long windowId ) :
IFrameWindow ( windowId ),
cnrh (new ICnrHandler ()),
cnrCtl (new ICnrCtl (windowId + 20, this, this, IRectangle())),
car ((Customer *) 0),
space ((Customer *) 0),
bolt ((Customer *) 0),
starfleet ((Customer *) 0),
reslib()
{
cnrh->handleEventsFor(cnrCtl);
setClient(cnrCtl);
car = new Customer ("Auto Racer", CAR, "Al Uncer",
"Le Mans, France", "(919) 555-1234", this);
space = new Customer ("Astronaut", SPACE, "E. T.",
"Pirx the Pilot", "(919) 555-4321", this);
bolt = new Customer ("Repairman", BOLT, "Joe Blow",
"The Sky", "(919) 555-4321", this);
starfleet = new Customer ("Captain", STARFLEET, "J. L. Picard",
"Starfleet", "(919) 555-1212", this);
cnrCtl->addObject(car);
cnrCtl->addObject(space);
cnrCtl->addObject(bolt);
cnrCtl->addObject(starfleet, space);
cnrCtl->setDeleteObjectsOnClose();
cnrCtl->showTreeLine();
cnrCtl->showTitle();
cnrCtl->enableDrawItem();
cnrCtl->showTreeIconView();
show();
cnrCtl->show();
}
MySourceWin :: MySourceWin ( unsigned long windowId ) :
MyWindow ( windowId )
{
ITitle title (this, "C Set ++ Direct Manipulation - Source Container" );
srcHandler = new IDMCnrSourceHandler( cnrCtl );
};
MyTargetWin :: MyTargetWin ( unsigned long windowId ) :
MyWindow ( windowId )
{
ITitle title (this, "C Set ++ Direct Manipulation - Target Container" );
tgtHandler = new IDMCnrTargetHandler( cnrCtl );
}
Customer :: Customer ( const Customer &cnrobj ) :
IContainerObject ( (const IContainerObject &)cnrobj ),
strName ( cnrobj.name() ),
strAddress ( cnrobj.address() ),
strPhone ( cnrobj.phone() ),
myWin ( cnrobj.myWin )
{
}
Customer :: Customer ( const IString &Text,
unsigned long Icon,
const IString &Name,
const IString &Address,
const IString &Phone,
MyWindow* win ) :
IContainerObject ( Text, Icon ),
strName ( Name ),
strAddress ( Address ),
strPhone ( Phone ),
myWin ( win )
{
}
IContainerObject* Customer :: objectCopy()
{
/* invoke Customer :: Customer(Customer&) to do copy */
Customer *copy = new Customer(*this);
return((IContainerObject *)copy);
}