Profile Picture

Creating a new Tool for a custom Shape.

Posted By Steve Warner 14 Years Ago
Author
Message
Steve Warner
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)

Group: Forum Members
Last Active: 10 Years Ago
Posts: 15, Visits: 1
I currently am creating custom shapes on the fly that are being placed onto my NDrawingDocument. My shapes are similar to the following:

public class MyShape : NGroup
{
public MyShape()
{
//Put some shapes into the group
}
}

I can programmatically add these to the document and then manipulate them using the Pointer tool, etc. without any issues. My problem is I need to place them on a toolbar so that a user can draw a brand new one on the Document. How do I go about doing that? Any code examples would be great.

Volvick Derose
Posted 14 Years Ago
View Quick Profile
Forum Guru

Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)Forum Guru (71 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 71, Visits: 1
To add a shape to the toolbar, you can handle the onclick event and do something like that inside the onlclick event

I assume you want to add the shape to the document when a user clicks on that button

MyClass myClass = new MyClass();

NGroup myGroup //do something here from your class

nDrawingDocument1.ActiveLayer.AddChild(myGroup);//that will add the shape to the drawing document
//when user clicks on the button on the toolbar



Similar Topics


Reading This Topic