Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ShapeListBox.ShapeLibraryLocation ImageMap Mode (Read 2623 times)
ghawkes
YaBB Newbies
*
Offline



Posts: 9
Joined: Apr 10th, 2009
ShapeListBox.ShapeLibraryLocation ImageMap Mode
Apr 21st, 2009 at 5:23pm
Print Post  
Hello,

  I am trying to use a custom shape library that I created using the Test Shape Designer.  I have the following code in my Page_Load event:

shapeListBox.ShapeLibraryLocation = @"http://localhost/SomeWebsite/ShapeLibrary/ShapeLibrary.shl";

When I view the .shl in the shape designer the custom shapes are there.  However when I view it in the ShapeListBox only the default shapes are available.  What other additional steps do I need to take? 

Thanks,
- G
  
Back to top
 
IP Logged
 
ghawkes
YaBB Newbies
*
Offline



Posts: 9
Joined: Apr 10th, 2009
Re: ShapeListBox.ShapeLibraryLocation ImageMap Mod
Reply #1 - Apr 21st, 2009 at 5:56pm
Print Post  
A few more details:

My end goal is to have custom shapes that I define show up in a ShapeListBox. The user will then be able to drag the custom shapes onto a DiagramView and use them. Also, I would like to define new members on the custom shape classes that I can code on the C# server-side code like so:

public class MyShape : Shape
{

public MyShape()


: base(new ElementTemplate[]


{ new RoundRectangleTemplate(0, 0, 76, 77, 6) },



new ElementTemplate[] { }, null, FillMode.Winding, "MyShape")

{


// Do some constructor stuff

}


public void DoStuff()

{


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ShapeListBox.ShapeLibraryLocation ImageMap Mod
Reply #2 - Apr 22nd, 2009 at 8:36am
Print Post  
This property hasn't been implemented in ImageMap mode yet. Call ShapeLibrary.LoadFrom from the Page_Load handler, and the shapes will appear in the listbox. You might also assign their IDs to the ShapeFilter property if you want only the shape from the library to be shown in the list.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ShapeListBox.ShapeLibraryLocation ImageMap Mod
Reply #3 - Apr 22nd, 2009 at 2:55pm
Print Post  
This version implements ShapeLibraryLocation in ImageMap mode:

https://mindfusion.eu/_beta/netdiag_301pre.zip

However it should be set to a local file path on the server.

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



Posts: 9
Joined: Apr 10th, 2009
Re: ShapeListBox.ShapeLibraryLocation ImageMap Mod
Reply #4 - Apr 22nd, 2009 at 5:22pm
Print Post  
Thank you Stoyan, the new dlls gave me the intended ShapeListBox behavior. 

I would like to link a custom class that inherits from Shape to the new shapes I am defining in the shape library file.  What would be the best way to go about doing this?  I want to do this so that I can implement custom business attributes that the user can modify on my shape.

Thank you,
- G
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ShapeListBox.ShapeLibraryLocation ImageMap Mod
Reply #5 - Apr 23rd, 2009 at 8:37am
Print Post  
At this time you can do that only by handling NodeCreated, deleting e.Node and creating an instance of your class at the same location. We'll add some support for custom types in the ShapeListbox for the 3.0.2 release.

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