Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to forbid user creating node (Read 3609 times)
qq414521
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Sep 24th, 2009
How to forbid user creating node
Sep 28th, 2009 at 9:31am
Print Post  
im using JDiagram applet on my ASP.NET page.
I have an ShapeListBox,from there user can drag node and drop it onto the DiagramView.
Thats fine.
While without dragging node from ShapeListBox,if user drag his mouse in some empty area of  the DiagramView,a new shape could also be created.
That was not what i want.

How to disable that kind of shape creation?Plz
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to forbid user creating node
Reply #1 - Sep 28th, 2009 at 10:34am
Print Post  
Call applet.getDiagramView().setBehavior() with the Behavior.DrawLinks or Behavior.Modify values as arguments (2 and 0 respectively). You can get such enum values using the ScriptHelper.getConstant(String className, String field) method.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
qq414521
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Sep 24th, 2009
Re: How to forbid user creating node
Reply #2 - Sep 29th, 2009 at 3:03am
Print Post  
Sry.i cant still find the way to set behavior.
There's no such method as setBehavior() under DiagramView1,all i can find is a "behavior" property.
Could u plz give me some code example.
Thanks.Stoyo!

Code
Select All
    protected void Page_Load(object sender, EventArgs e)
    {
	  if(!isPostBack)
	     {DiagramView1.InplaceEditFont = new Font("Arial", 12);
	  ShapeLibrary.LoadFrom(Server.MapPath("") + "./MyShape.shl");
	  ShapeListBox1.ShapeLibraryLocation = "./MyShape.shl";
	  DiagramView1.Behavior...
	  Behavior.DrawShapes = 0;//error
     }

    } 

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to forbid user creating node
Reply #3 - Sep 29th, 2009 at 5:39am
Print Post  
If you are using our ASP.NET control, set DiagramView1.Behavior = Behavior.DrawLinks;

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
qq414521
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Sep 24th, 2009
Re: How to forbid user creating node
Reply #4 - Sep 29th, 2009 at 6:08am
Print Post  
Thanks!
It worked.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint