Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Blue square of selection (Read 3162 times)
tzippy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Jan 11th, 2009
Blue square of selection
May 4th, 2009 at 10:20am
Print Post  
Hi,

I want to remove the square which is drawn when I drag the mouse on the diagram.

Although the multi-selection is disabled, the square is still shown.

How can I do it?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Blue square of selection
Reply #1 - May 4th, 2009 at 12:24pm
Print Post  
Hi,

Create a class derived from BehaviorBase, override StartDraw and always return null. Assign its instance to Diagram.CustomBehavior, and the only thing the user should be able to do is select items by clicking on them.

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


I love YaBB 1G - SP1!

Posts: 77
Joined: Jan 11th, 2009
Re: Blue square of selection
Reply #2 - May 4th, 2009 at 1:31pm
Print Post  
Can you send me an example please?
I don't know what about the constructor and the mathod SetMouseCursor etc.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Blue square of selection
Reply #3 - May 4th, 2009 at 2:35pm
Print Post  
Code
Select All
class MyBehavior : BehaviorBase
{
	public MyBehavior(Diagram diagram) : base(diagram) {}
	public override InteractionState StartDraw(Point point) { return null; }
	public override CursorHint SetMouseCursor(Point point, out bool startInteraction)
	{
		startInteraction = false; return CursorHint.Pointer;
	}
}
 



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


I love YaBB 1G - SP1!

Posts: 77
Joined: Jan 11th, 2009
Re: Blue square of selection
Reply #4 - May 5th, 2009 at 6:42am
Print Post  
Thank's,
But now there is no selection to the diagram.
(I want selection by clicking on item).
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Blue square of selection
Reply #5 - May 5th, 2009 at 8:16am
Print Post  
You could change the selection in response to the NodeClicked event, or do this in the Behavior.StartDraw override:

Code
Select All
DiagramItem item = Diagram.GetItemAt(point, true);
if (item == null || Diagram.RaiseSelecting(item, point))
	Diagram.Selection.Change(item);
 



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


I love YaBB 1G - SP1!

Posts: 77
Joined: Jan 11th, 2009
Re: Blue square of selection
Reply #6 - May 5th, 2009 at 8:46am
Print Post  
It works  Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint