Removing roatating tool
Hello
I want to remove the rotating tool from all nodes in the Diagram, even after selection
How do I achieve this?
Thanks Roee
I want to remove the rotating tool from all nodes in the Diagram, even after selection
How do I achieve this?
Thanks Roee
SIGN IN To post a reply.
1 Reply
J.
J.Nagarajan
Syncfusion Team
January 29, 2008 01:12 AM UTC
Hi Shavit ,
Thanks for your continued interest in Syncfusion product.
If you want to prevent the rotation action and remove the Rotation point then you have to customize the View class and overide the DrawHandles() method. Please refer to the following code snippet
protected override void DrawHandles(System.Drawing.Graphics grfx, NodeCollection nodesSelected)
{
if (nodesSelected != null && nodesSelected.Count > 0)
{
foreach (Node nodeCur in nodesSelected)
{
if (nodeCur.Visible)
{
HandleEditMode resultHandleEditMode = nodeCur.EditStyle.DefaultHandleEditMode;
Matrix matrixParentsTransorm = GetParentsTransform(nodeCur);
GraphicsState stateSave = grfx.Save();
grfx.MultiplyTransform(matrixParentsTransorm);
switch (resultHandleEditMode)
{
case HandleEditMode.Resize:
if (nodeCur is IEndPointContainer)
{
HandleRenderer.DrawEndPoints(grfx, nodeCur);
HandleRenderer.OutlineBoundingRectangle(grfx, nodeCur);
}
else
{
HandleRenderer.OutlineBoundingRectangle(grfx, nodeCur);
HandleRenderer.DrawSelectionHandles(grfx, nodeCur);
}
break;
case HandleEditMode.Vertex:
PathNode pathNode = nodeCur as PathNode;
if (nodeCur is IEndPointContainer)
{
HandleRenderer.DrawEndPoints(grfx, nodeCur);
HandleRenderer.OutlineBoundingRectangle(grfx, nodeCur);
if (pathNode.CanDrawControlPoints())
{
pathNode.DrawControlPoints(grfx);
}
}
else if (pathNode != null && (pathNode.CanChangePath || pathNode.IsVertexEditable))
{
HandleRenderer.OutlineBoundingRectangle(grfx, pathNode);
// Draw control points if can.
if (pathNode.CanDrawControlPoints())
{
pathNode.DrawControlPoints(grfx);
}
else
{
HandleRenderer.DrawVertexHandles(grfx, pathNode);
}
}
break;
}
grfx.Restore(stateSave);
}
}
}
I have attached the sample for your reference. You can download the sample from the following page.
http://websamples.syncfusion.com/samples/Diagram.Windows/Prevent RotationAction/main.htm
Please let me know if you have any questions.
Thanks,
Nagaraj
Thanks for your continued interest in Syncfusion product.
If you want to prevent the rotation action and remove the Rotation point then you have to customize the View class and overide the DrawHandles() method. Please refer to the following code snippet
protected override void DrawHandles(System.Drawing.Graphics grfx, NodeCollection nodesSelected)
{
if (nodesSelected != null && nodesSelected.Count > 0)
{
foreach (Node nodeCur in nodesSelected)
{
if (nodeCur.Visible)
{
HandleEditMode resultHandleEditMode = nodeCur.EditStyle.DefaultHandleEditMode;
Matrix matrixParentsTransorm = GetParentsTransform(nodeCur);
GraphicsState stateSave = grfx.Save();
grfx.MultiplyTransform(matrixParentsTransorm);
switch (resultHandleEditMode)
{
case HandleEditMode.Resize:
if (nodeCur is IEndPointContainer)
{
HandleRenderer.DrawEndPoints(grfx, nodeCur);
HandleRenderer.OutlineBoundingRectangle(grfx, nodeCur);
}
else
{
HandleRenderer.OutlineBoundingRectangle(grfx, nodeCur);
HandleRenderer.DrawSelectionHandles(grfx, nodeCur);
}
break;
case HandleEditMode.Vertex:
PathNode pathNode = nodeCur as PathNode;
if (nodeCur is IEndPointContainer)
{
HandleRenderer.DrawEndPoints(grfx, nodeCur);
HandleRenderer.OutlineBoundingRectangle(grfx, nodeCur);
if (pathNode.CanDrawControlPoints())
{
pathNode.DrawControlPoints(grfx);
}
}
else if (pathNode != null && (pathNode.CanChangePath || pathNode.IsVertexEditable))
{
HandleRenderer.OutlineBoundingRectangle(grfx, pathNode);
// Draw control points if can.
if (pathNode.CanDrawControlPoints())
{
pathNode.DrawControlPoints(grfx);
}
else
{
HandleRenderer.DrawVertexHandles(grfx, pathNode);
}
}
break;
}
grfx.Restore(stateSave);
}
}
}
I have attached the sample for your reference. You can download the sample from the following page.
http://websamples.syncfusion.com/samples/Diagram.Windows/Prevent RotationAction/main.htm
Please let me know if you have any questions.
Thanks,
Nagaraj
SIGN IN To post a reply.
- 1 Reply
- 2 Participants
-
SR Shavit Roee
- Jan 28, 2008 05:12 PM UTC
- Jan 29, 2008 01:12 AM UTC