Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic how to limit the default shapes in the ShapeListBox. (Read 1563 times)
umesh
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Dec 29th, 2011
how to limit the default shapes in the ShapeListBox.
Dec 30th, 2011 at 10:47am
Print Post  
I want to show only four shapes of particular type in the ShapeListBox and allow user to drag on the canvas. How to achieve this.

Regards,
Umesh V
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to limit the default shapes in the ShapeListBox.
Reply #1 - Dec 30th, 2011 at 11:28am
Print Post  
You could set the ShapeListBox' ShapeLibraryLocation property to a shape library file that defines your shapes. You could as well remove unnecessary shapes from an AppletStartedScript handler:

Code
Select All
function slbLoaded()
{
      var applet = <%= shapeListBox.AppletElement %>;
      applet.getShapeListBox().clearShapes();
      addShapesToList(applet, [ "Rectangle","Ellipse"]);
}

function addShapesToList(shapelistApplet, shapeIdArray)
{
      var scriptHelper = shapelistApplet.getScriptHelper();
      var slb = shapelistApplet.getShapeListBox();
      for (i = 0; i < shapeIdArray.length; ++i)
      {
            var shape = scriptHelper.shapeFromId(shapeIdArray[i]);
            slb.addShape(shape);
      }
} 



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


I Love MindFusion!

Posts: 6
Joined: Dec 29th, 2011
Re: how to limit the default shapes in the ShapeListBox.
Reply #2 - Dec 30th, 2011 at 1:55pm
Print Post  
Thanks Stoyan.
It works.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint