Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Custom Arrow type (Read 1592 times)
tivadj
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 1
Joined: Dec 23rd, 2005
Custom Arrow type
Dec 23rd, 2005 at 8:53am
Print Post  
Hello.
I want a user to create an arrow of my class during interaction process (Behaviour.CreateArrow etc.)
How can I implement it?
Thanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Custom Arrow type
Reply #1 - Dec 23rd, 2005 at 9:17am
Print Post  
Hello,

Try creating a custom Behavior class and return an instance of your arrow class from the StartDraw method. Assign the behavior object to flowhchart.CustomBehavior.

Below you can see how the CreateArrowBehavior class is implemented, change it so it creates new YourArrowClass instances instead of new Arrow instances:

[code]
public override InteractionState StartDraw(PointF pt)
{
  ChartObject ac = fc.ActiveObject;
  Node obj = fc.GetNodeAt(pt);
  int handle = 0;

  if (ac != null && !ac.notInteractive() && ac.pointInHandle(pt, ref handle))
  {
    return new InteractionState(ac, handle, Action.Modify);
  }
  else
  if (obj != null && obj.canHaveArrows(true))
  {
    return new InteractionState(
new Arrow(fc, obj), -1, Action.Create);
  }
  else
  if (obj == null && fc.AllowUnconnectedArrows)
  {
    return new InteractionState(
new Arrow(fc, fc.Dummy), -1, Action.Create);
  }
  else
  {
  return new InteractionState(
fc.Selection, -1, Action.Create);
  }
}
[/code]
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint