Show Flyout-Panel with Buttons OnHover node

Hi,

I would like to implement the following node behaviour.

If the user hovers with the mouse over the node, a flyout panel should appear.
The panel should contains buttons to create another node which will be automatically linked with this node.
I think MS Visio has this behaviour, if I am not wrong.

Is it possible to implement this behaviour with GoDiagram. Is there a build in feature?

Thank you very much

Igor

I’ve got an unpublished sample around here somewhere. It uses selection and not hover. Let me go find it…

I’ve emailed the project to you.

ok, thank you. It looks very cool :-)

Ok, I’ve reviewed your example in detail.
But I have the following problem.

I use the GoGeneralNode in my application, because I need the “Left” and “Right”-Ports.
But the GoGeneralNode doesn’t trigger the “public override void AddSelectionHandles(GoSelection sel, GoObject selectedObj)”-Method.

If I see right the GoBoxNode (as used in your example) does not support the additional ports.

I wouldn’t like to draw the additional ports by my self, because they can be moved (change order) in my application and that could be very complicated I think.

OK… GoGeneralNode overrides SelectionObject and makes this.Icon the target for selection. But that’'s the least of your issues here.

In my example… all links “from” the node… thus one port. GoGeneralNode represents an object that has multiple inputs and outputs… so the strategy I was using just isn’t going to work. How is the user going to indicate which is the desired port?

I’m thinking the other interaction you were thinking about makes more sense now… Drag away from the port, mouse up where you want the target and create the right type of node there.

In my example… all links “from” the node… thus one port. GoGeneralNode represents an object that has multiple inputs and outputs… so the strategy I was using just isn’t going to work. How is the user going to indicate which is the desired port?

In my case it’s very easy. It’s always the middle port of the node independent of the left and right-ports.

OK… GoGeneralNode overrides SelectionObject and makes this.Icon the target for selection. But that’'s the least of your issues here.

Okey. Is it possible to force the “override void AddSelectionHandles”-method for GoGeneralNode, so I could run my own code? Or is there another way to do this?

You have to override GoGeneralNode CreateIcon and create your own class for the “Icon” to override AddSelectionHandles.

here’s the code for GoGeneralNode CreateIcon (in the case where you call Initialize(ResourceManager res, String iconname, String top, String bottom, int numinports, int numoutports) )

protected virtual GoObject CreateIcon(ResourceManager res, String iconname) {
      if (iconname != null) {
        GoNodeIcon ni = new GoNodeIcon();
        if (res != null)
          ni.ResourceManager = res;
        ni.Name = iconname;
        ni.MinimumIconSize = new SizeF(20, 20);
        ni.MaximumIconSize = new SizeF(1000, 2000);
        ni.Size = ni.MinimumIconSize;
        return ni;
      } else {
        GoDrawing rect = new GoDrawing(GoFigure.Rectangle);
        rect.Selectable = false;
        rect.Resizable = false;
        rect.Size = new SizeF(20, 20);
        return rect;
      }
    }

So if you aren’t using images, a simple GoDrawing or GoRectangle derived class.