Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.

Answered how to get the 'current selected' msagl.Drawing.node

  • Wednesday, August 26, 2009 2:12 PM
     
     
    Hi,

    I'm trying to get the 'currently marked' node (that one with the bounding box on) to work with its UserData after the user clicked any.
    I've already tried the SelectionChanged - Event, similar to the 'WindowsApp-Demo'. But it fires, while the mouse is only hovering over a node (or edge), and I don't no to distinguish all wrong nodes from the one *marked*. Any help?

    Many thanks in advance

All Replies

  • Thursday, August 27, 2009 3:08 AM
    Owner
     
     
    Hi Olaf,
    Are you trying to get the clicked on node?
    Thanks,
    Lev
    Lev Nachmanson
  • Thursday, August 27, 2009 8:27 AM
     
     
    Hi Lev,
    thank you for your attention.
    Yes, you are right, and I managed it in the meantime using the MouseClick - Event and checking if the type of viewer.SelectedObject is edge. But there can be more than one node selected by holding shift or ctrl. There isn't a set of those nodes that I can enumerate, somewhat like "viewer.SelectedObjects" isn't it?
    Thanks
  • Sunday, August 30, 2009 5:26 AM
    Owner
     
     Answered
    Hi Olaf,
    You can get these entites the following way
     foreach (var en in gviewer.Entities)
                    if (en.MarkedForDragging && en is IViewerNode)
                    { //got a selected node}

    Thanks,
    Lev  
    Lev Nachmanson
    • Marked As Answer by Olaf Grollmann Wednesday, September 02, 2009 3:40 PM
    •