Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Select and Move boxes - custom behavior (Read 2077 times)
pelion
Junior Member
**
Offline



Posts: 61
Joined: Nov 12th, 2006
Select and Move boxes - custom behavior
Jun 1st, 2007 at 1:45am
Print Post  
Hi,

I am having trouble finding any worthwhile documentation on customising the flowchart behavior. Is there any available?

Anyway, I am generating diagrams with box images, and would like the user to be able to move individual boxes (click to select and move) or multiple boxes (select multiple objects by 'lasooing' them) and moving by selecting a selected box and drag). Could you please help me on this

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Select and Move boxes - custom behavior
Reply #1 - Jun 1st, 2007 at 6:10am
Print Post  
Hi,

This can be implemented by setting a few properties:

- set Behavior to Modify
- set the HandlesStyle of boxes to MoveOnly
- set ModificationStart to AutoHandles

You could also implement that as a custom behavior class, where you return from the StartDraw method either

- return new InteractionState(someBox, Action.Modify, 8);
- return new InteractionState(fc.Selection, Action.Create, -1);
- return new InteractionState(fc.Selection, Action.Modify, 8);

8 is the index for the move adjustment handle, used when the Action is set to Modify. The index is ignored when the action is Create. You can assign an instance of your Behavior-derived class to the FlowChart.CustomBehavior property.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
pelion
Junior Member
**
Offline



Posts: 61
Joined: Nov 12th, 2006
Re: Select and Move boxes - custom behavior
Reply #2 - Jun 3rd, 2007 at 9:40pm
Print Post  
Thanks again Stoyan
  
Back to top
 
IP Logged
 
pelion
Junior Member
**
Offline



Posts: 61
Joined: Nov 12th, 2006
Re: Select and Move boxes - custom behavior
Reply #3 - Jun 5th, 2007 at 3:44am
Print Post  
Thanks Stoyo, but one other requirement I did not mention above would be to allow multi-select by Shift (or Ctrl) Click on multiple boxes

Cheers
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Select and Move boxes - custom behavior
Reply #4 - Jun 5th, 2007 at 5:49am
Print Post  
This should be enabled by default for the Ctrl key. You can use Shift for selection by setting the ModifierKeyActions.Shift property to Select.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
pelion
Junior Member
**
Offline



Posts: 61
Joined: Nov 12th, 2006
Re: Select and Move boxes - custom behavior
Reply #5 - Jun 5th, 2007 at 7:41pm
Print Post  
Thanks Stoyo,

In trying to code around the selection issue in Mouse Down, I was causing myself a few issues.  I just commented out all this code, and in conjunction with the properties you gave me above, it all works perfectly now.

Cheers
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint