We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

V5 - grouping/ungrouping protection, visio stencil importing

Thread ID:

Created:

Updated:

Platform:

Replies:

60043 Apr 26,2007 12:36 PM May 7,2007 05:21 PM Windows Forms 7
loading
Tags: Diagram
Jeff Marver
Asked On April 26, 2007 12:36 PM

I'm evaluating the V5 beta. I've created a custom shape that contains an ellipse and a text node. Essentially, it's a group. Is there a way to protect this grouping when it's placed on the diagram so a user cannot ungroup the custom shape parts?

Also, I've tried importing Visio stencil files and have noticed that on certian stencils not all icons get imported. For example, Visio has a Windows Forms Dialogs stencil (UIDLGS_U.VSS) and when imported into the Diagram Builder not all Windows Buttons or Dialog Icons get imported. Have you seen this behavior?

J.Nagarajan [Syncfusion]
Replied On April 26, 2007 06:55 PM

Hi Jeff,

1. If you want to protect the grouping functionality of the shapes then you can set EditStyle.AllowSelect property of the textbox to false. Please refer to the following code snippet

private TextNode m_textNode = null;
this.m_textNode = new TextNode("Hello World");
this.m_textNode.PinPoint = new PointF(50, 30);
this.m_textNode.EditStyle.AllowSelect = false;
this.AppendChild(m_textNode);

I have attached the sample for your reference. You can download the sample from the following page

http://websamples.syncfusion.com/samples/Diagram.Windows/F60043/main.htm

2. Sorry for the inconvenience caused. I was able to reproduce this issue in v.5.1. We will fix this issue and this fix will available in our main release.

Thanks for bringing this issue to our attention.

Regards,
Nagaraj

Jeff Marver
Replied On April 27, 2007 11:37 AM

Thanks Nagarajan,

I tried setting the EditStyle.AllowSelect property to false on the text node but I'm still able to ungroup the nodes by using the Ungroup tool and command. In my application, I'll have the Ungroup tool on a toolbar and would like to prevent users from ungrouping the parts of custom shapes.

Perhaps this isn't a feature of Syncfusion.

Regards,

Jeff

>Hi Jeff,

1. If you want to protect the grouping functionality of the shapes then you can set EditStyle.AllowSelect property of the textbox to false. Please refer to the following code snippet

private TextNode m_textNode = null;
this.m_textNode = new TextNode("Hello World");
this.m_textNode.PinPoint = new PointF(50, 30);
this.m_textNode.EditStyle.AllowSelect = false;
this.AppendChild(m_textNode);

I have attached the sample for your reference. You can download the sample from the following page

http://websamples.syncfusion.com/samples/Diagram.Windows/F60043/main.htm

2. Sorry for the inconvenience caused. I was able to reproduce this issue in v.5.1. We will fix this issue and this fix will available in our main release.

Thanks for bringing this issue to our attention.

Regards,
Nagaraj

J.Nagarajan [Syncfusion]
Replied On April 30, 2007 03:26 PM

Hi Jeff,

Sorry for the in convenience caused. When I set AllowEditStyle property to false for the text node, and ungroup the Ellipse and text node, I couldn't ungroup the nodes. I have attached my test sample here. In this sample when you click on Tool->Ungroup menuitem to umgroup the nodes.

http://websamples.syncfusion.com/samples/Diagram.Windows/UnGroupedShapes/main.htm

Could you please check the sample and let me know whether you are able to reproduce the issue in this sample?. It would be helpful if you provide a sample or modify the attached sample to reproduce this issue. It will help us to resolve it as early as possible.

Thanks,
Nagaraj

Jeff Marver
Replied On May 1, 2007 10:06 AM

Hi Nagaraj,

In your example, you progammatically set the EditStyle.AllowSelect property to false for both the Ellipse and the TextNode. If you drop that shape to the diagram surface, select it and then ungroup it using the Ungroup command from the menu, you can't select the shape anymore. That is not good.

I just noticed another bug in your sample. Drop two shapes on the drawing surface and then select both of them. Now select ungroup from the menu. One of the shapes disappears. That is not good.

I don't think the AllowSelect property is going to work as a grouping protection property. I could be wrong, however.

Jeff

>Hi Jeff,

Sorry for the in convenience caused. When I set AllowEditStyle property to false for the text node, and ungroup the Ellipse and text node, I couldn't ungroup the nodes. I have attached my test sample here. In this sample when you click on Tool->Ungroup menuitem to umgroup the nodes.

http://websamples.syncfusion.com/samples/Diagram.Windows/UnGroupedShapes/main.htm

Could you please check the sample and let me know whether you are able to reproduce the issue in this sample?. It would be helpful if you provide a sample or modify the attached sample to reproduce this issue. It will help us to resolve it as early as possible.

Thanks,
Nagaraj

J.Nagarajan [Syncfusion]
Replied On May 2, 2007 07:56 PM

Hi Jeff,

Sorry for the delay in getting back to you.

If you want to prevent the Grouping action afer you ungroup the node, then you have to derive the Controller class. . In Controller class UnGroup() method is declaed as public. So you can't override this. So better you can hide the base class UnGroup() method. If you want to call base class method then you can use nase.UnGroup() in CustomDiagramController classPlease refer to the following code snippet

class MyDiagram : Syncfusion.Windows.Forms.Diagram.Controls.Diagram
{
public MyDiagram()
{
}
public override Model CreateModel()
{
return new MyModel();
}
public override Syncfusion.Windows.Forms.Diagram.View CreateView()
{
return new MyView();
}

public override DiagramController CreateController()
{
return new CustomDiagramController();
}

public class CustomDiagramController : Syncfusion.Windows.Forms.Diagram.DiagramController
{
public CustomDiagramController()
{
}
//Use new method to hide base class method. Use "base.UnGroup()" method to call base class UnGroup() method
public new void UnGroup()
{

}

}

//To call the hidden UnGroup method
private void ungroupToolStripMenuItem_Click(object sender, EventArgs e)
{
((CustomDiagramController )this.newdiagram.Controller).UnGroup();
}

I have attached the sample for your reference. You can download the sample from the following page

http://websamples.syncfusion.com/samples/Diagram.Windows/PreventUnGroping/main.htm

Please let me know if you have any questions.

Regards,
Nagaraj


Jeff Marver
Replied On May 3, 2007 10:55 AM

Hi Nagaraj,

I'm confused by your response. I would like to have a node, we'll say it's a composite node, composed of an ellipse node and a text node. I would like to be able to group this composite node with other diagram shapes (or nodes). I would also like to ungroup this composite shape when it's grouped with other diagram shapes.

I do not want to prevent grouping and I don't want to prevent ungrouping. I want to protect the grouping of the composite shape, not any grouping of this composite shape with other diagram shapes.

Does this makes sense? Will your example satisfy this?

Jeff

>Hi Jeff,

Sorry for the delay in getting back to you.

If you want to prevent the Grouping action afer you ungroup the node, then you have to derive the Controller class. . In Controller class UnGroup() method is declaed as public. So you can't override this. So better you can hide the base class UnGroup() method. If you want to call base class method then you can use nase.UnGroup() in CustomDiagramController classPlease refer to the following code snippet

class MyDiagram : Syncfusion.Windows.Forms.Diagram.Controls.Diagram
{
public MyDiagram()
{
}
public override Model CreateModel()
{
return new MyModel();
}
public override Syncfusion.Windows.Forms.Diagram.View CreateView()
{
return new MyView();
}

public override DiagramController CreateController()
{
return new CustomDiagramController();
}

public class CustomDiagramController : Syncfusion.Windows.Forms.Diagram.DiagramController
{
public CustomDiagramController()
{
}
//Use new method to hide base class method. Use "base.UnGroup()" method to call base class UnGroup() method
public new void UnGroup()
{

}

}

//To call the hidden UnGroup method
private void ungroupToolStripMenuItem_Click(object sender, EventArgs e)
{
((CustomDiagramController )this.newdiagram.Controller).UnGroup();
}

I have attached the sample for your reference. You can download the sample from the following page

http://websamples.syncfusion.com/samples/Diagram.Windows/PreventUnGroping/main.htm

Please let me know if you have any questions.

Regards,
Nagaraj


J.Nagarajan [Syncfusion]
Replied On May 7, 2007 05:21 PM

Hi Jeff,

Thank you for reporting us the issue. In our code, when the user ungroups the grouped node it removes all the elements from the document and reloads the Nodes separately and this causes the reported issue. Currently, it would be difficult to workaround the issue at application level. We have planned to report this issue to our development team. Sorry for any inconvenience caused.

Thanks,
Nagaraj

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;