Creating a new Tool for a custom Shape.


Author
Message
Steve Warner
Steve Warner
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
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
Volvick Derose
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
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
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search