ConnectTo
Connect one object to another object
BOOL ConnectTo( OriginObject & objTarget, int nTargetReferencePoint = -1, int nReferencePoint = -1, BOOL bVisibleConnector = TRUE, DWORD dwRigid = OCR_SITE1 | OCR_SITE2, RECT * lpConfineRect = NULL )
TRUE if successful, FALSE otherwise
EX1
// this example will show how to connect graph object to another graph object. // If move Line object Text and Rect will be moved together void OriginObject_ConnectTo_Ex1() { GraphPage gp; gp.Create(); GraphLayer gl = gp.Layers(); GraphObject goLine = gl.CreateGraphObject(GROT_LINE); GraphObject goText = gl.CreateGraphObject(GROT_TEXT); GraphObject goRect = gl.CreateGraphObject(GROT_RECT); goText.Text = "Hello"; goText.ConnectTo(goLine); goRect.ConnectTo(goLine); }
EX2
//Run this code after OriginObject_ConnectTo_Ex1 to see the result. void OriginObject_ConnectTo_Ex2() { GraphLayer gl = Project.ActiveLayer(); if ( gl ) { GraphObject goRect = gl.GraphObjects("Rect"); if ( goRect ) goRect.ConnectTo(NULL);//disconnect from other graph object. } return; }
OriginObject::GetConnectedObjects
origin.h