Hello,
Is it possible to have two or more custom resizing tools (e.g. separate resizing tool for node and tool for image), and how can they be implemented.
I tried to do it this way:
Custom GoView class:
DefaultTool = new MyToolManager(this);
Tool = DefaultTool;
ReplaceMouseTool(typeof(GoToolResizing), new MyToolResizing(this));
MyToolManager class:public override void DoMouseDown()
{
GoObject pickedObject = View.PickObject(true, false, LastInput.DocPoint, true) as MyImage;
if (pickedObject != null)
View.Tool = new MyToolImageResizing(View);
base.DoMouseDown();
}
MyToolImageResizing class:
public class MyToolImageResizing : GoToolResizing
{
public MyToolImageResizing(GoView view) : base(view) { }
public override void Start()
{
GoObject pickedObject = View.PickObject(true, false, LastInput.DocPoint, true) as MyImage;
if (pickedObject != null)
base.Start();
}
}
MyToolResizing class:
public class MyToolResizing : GoToolResizing
{
public MyToolResizing(GoView view) : base(view) {}
public override bool CanStart()
{
if (!base.CanStart())
return false;
GoObject pickedObject = View.PickObject(true, false, LastInput.DocPoint, true) as MyNode;
// Check if the node is dragged.
if (pickedObject != null)
return true;
return false;
}
public override void Start()
{
base.Start();
}
But it is not working. Please point me to the right direction. What I’m doing wrong?