Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Can not find method StartDrawCommon (Read 3429 times)
CanadaProgrammer
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 113
Joined: Jun 30th, 2011
Can not find method StartDrawCommon
Dec 13th, 2013 at 11:39pm
Print Post  
I download a trial version and install it, But in document I can not find any information about method StartDrawCommon. Where is it? I want to know something about how these classes in namespace WinForms.Behaviors work.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Can not find method StartDrawCommon
Reply #1 - Dec 16th, 2013 at 7:00am
Print Post  
StartDrawCommon is a protected virtual method defined in the BehaviorBase class. It implements the following interactions common for all Behavior types, and then calls the StartDraw method to run code specific to each behavior class:

  • drawing selection rectangle when ModifierKeyAction.Select modified key is held down;
  • moving selected items;
  • moving the Diagramview.AutoHandlesItem if ModificationStart is set to AutoHandles;
  • adding new link segments if AllowSplitLinks is enabled;

Unless you want to stop any of the common actions above, you should override the StartDraw method instead. E.g. of the built-in behavior types, only SelectOnlyBehavior overrides StartDrawCommon to prevent all but the draw-selection operation.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
CanadaProgrammer
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 113
Joined: Jun 30th, 2011
Re: Can not find method StartDrawCommon
Reply #2 - Dec 19th, 2013 at 12:37am
Print Post  
Thanks for your reply.
Is there any complete sample to show how to use or control custom behave when dragging a single or multiple shapes?

And if I buy source code then how I can use these source code and what kind support I can get freely?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Can not find method StartDrawCommon
Reply #3 - Dec 19th, 2013 at 5:20pm
Print Post  
You can find a custom behavior class and custom node modifications shown in the Fishbone diagram sample project. The StartDraw method only selects what object will be modified and returns an InteractionState wrapping it. Next mouse movements will lead to calling UpdateModify on that object. You could also override the behavior's OnMouseMove method if you prefer implementing all interaction logic without creating custom node classes.

If you have the source code, I suppose you could build your custom interaction logic directly into the library's standard classes, to spare yourself from having to derive new classes and override methods.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
CanadaProgrammer
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 113
Joined: Jun 30th, 2011
Re: Can not find method StartDrawCommon
Reply #4 - Dec 19th, 2013 at 10:46pm
Print Post  
Thanks a lot, i will check the sample.
  
Back to top
 
IP Logged
 
CanadaProgrammer
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 113
Joined: Jun 30th, 2011
Re: Can not find method StartDrawCommon
Reply #5 - Jan 6th, 2014 at 6:40pm
Print Post  
Thanks for reply.
I reviewed the sample, it is a pretty good sample to show something. But there still is a question. These track shapes are node shape, are not a link shape. Dependence on my experience there are 2 cases.

Case 1
when users drag the first point or the end point of a link then StartDraw method will be called.
Case 2
If users drag any other point else of a link then MouseMove method will called.

How to do something let StartDraw method can be called in Case 2 ?
Thanks a lot.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Can not find method StartDrawCommon
Reply #6 - Jan 7th, 2014 at 11:13am
Print Post  
Quote:
If users drag any other point else of a link then MouseMove method will called. How to do something let StartDraw method can be called  in Case 2 ?


Dragging an existing intermediate control point will call StartDraw too. However if you enable AllowSplitLinks, insertion of new control points is handled by StartDrawCommon and will now call StartDraw.

So you could either override StartDrawCommon, or if you want to handle that in StartDraw too, set Diagram.AllowSplitLinks = false, and from StartDraw return new InteractionState(link, new LinkAdjustmentHandle(segmentToSplit), Action.Split) whenever you want to add new link control points.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint