Extending Nevron Diagram


Author
Message
Elia Dal Santo
Elia Dal Santo
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)
Group: Forum Members
Posts: 3, Visits: 1
Hi

We're currently in the process of developing an application that let's our users crete diagrams, and we were evaluating Nevron Diagram to achieve this.

However, some of the features we require are not present out-of-the-box, so I was trying to find out how to extend nevron diagram but in this reguard I must admint I find the documentation a bit lacking

In particular, is there any documentation/examples that explains how to create our own custom drawing tools, place them on the bar manager's Tools toolbar and use them?

Reply
Elia Dal Santo
Elia Dal Santo
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)
Group: Forum Members
Posts: 3, Visits: 1
Thanks for the sample. I managed to add the button to the toolbars.

I then tried to inherit existing tools to generate my custom shapes, but I'm having some troubles.

In particular, I tried to create a new tool that creates a shape with a control inside, this is what I managed:

Public Class CreateRichTextTool
Inherits NCreateRectangleTool

Protected Overrides Function CreateElement(ByVal preview As Boolean) As Nevron.Diagram.INDiagramElement
If preview Then
Return MyBase.CreateElement(preview)
Else
Dim rtn As New NWinFormControlHostShape(New RichTextBox)
Return rtn
End If
End Function
End Class


However, this doesn't seem to work, the control is not created when I release the mouse button. What is the correct way to implement a new tool?


EDIT: Another important question: Is it possible to use the diagram library without the included NDiagramCommandBarsManager?? To be consistent with the rest of our apps I need to use a Ribbon menu, rather than the provided "classic" toolbars. I tried doing this, but it seems the commandbarsmanager is doing some magic of it's own behind the scenes, because tools don't behave the same way as in the samples. For example, to enable the selector tool I do this:

NDrawingView1.Controller.Tools.SingleEnableTools({"SelectorTool", "MoveTool", "CreateGuidelineTool", "HandleTool", "ContextMenuTool", "KeyboardTool", "InplaceEditTool", "DragDropTool"})

(note: I previously added all of those tools of course)

With that, the pointer *almost* works as expected, but not quite. Moving the shape doesnt work for example, and the mouse cursors do not change (ie: when I move the pointer over the rotate grip the cursor doesn't turn into the "ciruclar arrow" icon, even tho the rotation works just fine, same thing with resizing).
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