I've tried these two ways:
First, when using CreateGroup/Attach, the MainObject and the attached one must be both selected before I start the drag and then call CreateObjsFromDragData. The creation is done but the attachment between the 2 boxes is lost.
Second, using GetContainedItems/Attach NOT setting Style to bsContainer I still have to select both boxes before drag or then I got an access violation error. This way, the creation is done perfectly and the attachment is maintained. The issue is when I manually add to selection these boxes before drag them. I don't known why it makes the attachment to be undone.
The attached box occupies the entire area of its MasterGroup/MainObject and must be locked. Setting Style to bsContainer I couldn't drag the container. Likewise, I need the resize functionality that an container don't offers.
#1st box2.SetLocked(TRUE); box3.SetLocked(TRUE); box1.GetContainedItems().AttachProportional(box2, 0, 0, 100, 50); box1.GetContainedItems().AttachProportional(box3, 0, 50, 100, 100);
#2nd GroupItem g = m_flow1.CreateGroup(box1); box2.SetLocked(TRUE); box3.SetLocked(TRUE); g.AttachProportional(box2, 0, 0, 100, 50); g.AttachProportional(box3, 0, 50, 100, 100);
|