home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 November
/
pcwk_11_98a.iso
/
Wtestowe
/
SOFTSRC
/
vtrial15.exe
/
DATA.1
/
Vutil.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1997-02-09
|
2KB
|
89 lines
/*
Vdraft API support - Vutil.cpp
(C) Copyright 1997 by SoftSource. All rights reserved.
Scott Sherman 2-97
This code provides useful functionality for talking to Vdraft.
*/
#include "stdafx.h"
#include "Vdraft.h"
// base class for encapsulating handling Vdraft Plug-in events
cVdraftEvent::cVdraftEvent(IVdraft& vdraft, vtAddOnID id)
{
// we're keeping an extra reference to the Vdraft object
vdraft.m_lpDispatch->AddRef();
m_vdraft.AttachDispatch(vdraft.m_lpDispatch);
// remember so we can pass it to Vdraft when requesting events
m_id = id;
}
// the user has picked a point or done something related to picking a point
veReturn vfPickEvent(vtAddOnID id, vePickEvent event, double* point, long info)
{
cPickEvent *pick = (cPickEvent *)info;
switch (event)
{
case vePE_Point:
pick->Pick(point);
delete pick; // events are over - get rid of event object
break;
case vePE_Cancel:
pick->Cancel();
delete pick; // events are over - get rid of event object
break;
case vePE_Done:
pick->Done();
break;
case vePE_Properties:
pick->Properties();
break;
case vePE_Undo:
pick->Undo();
break;
}
return veR_OK;
}
// the user has picked a point, finished or cancelled drawing
veReturn vfDrawEvent(vtAddOnID id, veDrawEvent event, double* point, short picknumber, long info)
{
cDrawEvent *draw = (cDrawEvent *)info;
switch (event)
{
case veDE_Done:
draw->Done(); // let event object handle Done
delete draw; // events are over - get rid of event object
break;
case veDE_Cancel:
draw->Cancel(); // let event object handle Cancel
delete draw; // events are over - get rid of event object
break;
case veDE_Pick:
draw->Pick(point,picknumber); // let event object handle point pick
break;
}
return veR_OK;
}
// the user has finished selecting objects
veReturn vfSelectEvent(vtAddOnID id, veSelectEvent event, long info)
{
cSelectEvent *select = (cSelectEvent *)info;
switch (event)
{
case veSE_Done:
select->Done(); // let event object handle Done
delete select; // events are over - get rid of event object
break;
case veSE_Cancel:
select->Cancel(); // let event object handle Cancel
delete select; // events are over - get rid of event object
break;
}
return veR_OK;
}