|
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).
|