Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ReadOnly Behavior (Read 1104 times)
chinlean
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Jan 17th, 2007
ReadOnly Behavior
Mar 26th, 2007 at 9:30pm
Print Post  
I'm looking for something that is between Behavior.Modify & Behavior.DoNothing which is I refer to Readonly behavior. In this mode, the users cannot create/modify the boxes/arrow, but the selections handle should be there. Because my application listen to the selectionChanged event and display the properties of the selected Box/Arrow object (properties of the chartobject's Tag) Also my application should be able to caption the MouseDoubleClick event for a Box.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ReadOnly Behavior
Reply #1 - Mar 27th, 2007 at 4:41am
Print Post  
This should help

Code
Select All
private void Form1_Load(object sender, System.EventArgs e)
{
	fc.ModificationStart = ModificationStyle.SelectedOnly;
	fc.Selection.AllowMultiSel = false;
	fc.CustomBehavior = new ReadOnlyBehavior(fc);
}

class ReadOnlyBehavior : ModifyBehavior
{
	public ReadOnlyBehavior(FlowChart flowChart) : base(flowChart)
	{
	}

	public override InteractionState StartDraw(PointF point)
	{
		return new InteractionState(FlowChart.Selection, -1, Action.Create);
	}

	public override bool SetMouseCursor(PointF point)
	{
		return false;
	}
}
 



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