Profile Picture

Group Delete

Posted By Volvick Derose 14 Years Ago
Author
Message
Volvick Derose
Posted 14 Years Ago
View Quick Profile
Forum Guru

Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 71, Visits: 1
Below I edited the second button, sorry for the typo

private void barButtonItem2_ItemClick(object sender, ItemClickEventArgs e)

{

NFlowChartingShapesFactory factory = new NFlowChartingShapesFactory(nDrawingDocument1);

NShape entityShape = factory.CreateShape(FlowChartingShapes.Process);

entityShape.Bounds = new NRectangleF(100, 100, 200, 100);

entityShape.Text = "my text";

nDrawingDocument1.ActiveLayer.AddChild(entityShape);

}

Volvick Derose
Posted 14 Years Ago
View Quick Profile
Forum Guru

Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 71, Visits: 1

Here is the code.  All you need to do, add two buttons to a form, click on the second one to create the shape then select it and click on the first one button to create the group.  The group simply group a shape inside another shape by adding the shape to the group.  As you can see, when deleting the group, the ports are still present on the screen.

private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e)

{

NShape firstShape = nDrawingView1.Selection.FirstNode as NShape;

NGroup myGroup = new NGroup();

NFlowChartingShapesFactory factory = new NFlowChartingShapesFactory(nDrawingDocument1);

NShape entityShape = factory.CreateShape(FlowChartingShapes.Process);

entityShape.Bounds = new NRectangleF(100, 100, 200, 100);

entityShape.Text = "my text";

if (firstShape.Name.Contains("Group") == true)

{

myGroup = nDrawingView1.Selection.AnchorNode as NGroup;

NShape myShape = myGroup.Shapes.GetChildAt(0) as NShape;

myShape.Width = myShape.Width + 250;

int nCount = myGroup.Shapes.ChildrenCount(NFilters.Shape2D);

entityShape.Location = new NPointF(firstShape.Location.X + 250 * nCount - 230, firstShape.Location.Y + 20);

nDrawingDocument1.ActiveLayer.AddChild(entityShape);

myGroup.Shapes.AddChild(entityShape);

int numberOfPart = nDrawingView1.Selection.NodesCount;

}

else if (firstShape.Name.Contains("Group") != true)

{

myGroup.Shapes.AddChild(firstShape);

nDrawingDocument1.ActiveLayer.AddChild(entityShape);

firstShape.Width = entityShape.Width + 40;

firstShape.Height = entityShape.Height + 40;

entityShape.Location = new NPointF(firstShape.Location.X + 20, firstShape.Location.Y + 20);

myGroup.Shapes.AddChild(entityShape);

}

myGroup.UpdateModelBounds();

nDrawingDocument1.ActiveLayer.AddChild(myGroup);

nDrawingView1.Selection.DeselectAll();

 

}

 

private void barButtonItem2_ItemClick(object sender, ItemClickEventArgs e)

{

NFlowChartingShapesFactory factory = new NFlowChartingShapesFactory(nDrawingDocumentProjectModeling);

NShape entityShape = factory.CreateShape(FlowChartingShapes.Process);

entityShape.Bounds = new NRectangleF(100, 100, 200, 100);

entityShape.Text = "my text";

nDrawingDocumentProjectModeling.ActiveLayer.AddChild(entityShape);

}



Nevron Support
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: 2 days ago @ 1:54 AM
Posts: 3,054, Visits: 4,009

Hello Volvick,

This is a strange behavior, when deleting a group the ports should also be deleted. We were unable to replicate this problem, can you please elaborate and provide us with more details regarding the group you created.



Best Regards,
Nevron Support Team



Volvick Derose
Posted 14 Years Ago
View Quick Profile
Forum Guru

Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 71, Visits: 1
I created a group manually, but when I delete the group, the ports are still shown on my screen. Is there a way to prevent that from happening? I want when I delete the group for the ports to be deleted as well. What I did, I have a shape with couple of ports, then I group multiple of that shapes. However when I delete the group, the ports are not deleted with the group.



Similar Topics


Reading This Topic