SAMSON Forum
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • SAMSON Connect
    • Get SAMSON

    Add new items in context menu when right-clicking on a selection

    GUI
    2
    3
    2946
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      Khoa last edited by

      How can I add new items in the context menu when right-clicking on selected nodes in the Document View?

      For example, after selecting a few nodes in the Document View, I do a right-click to open a context menu. There, I would like to add a function call "Do This For Me". How can I implement "Do This For Me" ?

      1 Reply Last reply Reply Quote 0
      • Stephane
        Stephane last edited by Stephane

        At the moment (0.7.0), the context menu is composed of three parts:

        • actions provided by the active editor, if any
        • actions provided by selected nodes, if any
        • actions provided by SAMSON (e.g. visibility, etc.)

        So the only way right now would be to develop a new editor and overload the function getActions(SBVector<SBGAction*>& actionVector) to fill actionVector with the editor actions. The user would have to select your editor before being able to see the context actions. Do you think we should have a mechanism to register more actions in the context menu?

        K 1 Reply Last reply Reply Quote 0
        • K
          Khoa @Stephane last edited by

          @stephane-redon I think it can be nice for the developers to be able to register more actions in the context menu. But it can also make the context menu too crowded. Perhaps, you can make something in the Preferences so that the users can select to add which actions to show in the context menu.

          Actually, I am developing an app to convert a list of conformations to a path and vice versa for my work.
          So I was thinking it can be useful to add an action in the context menu so that after selecting a list of conformations in the Document View, I would right-click and choose "Convert to Path". Do you have any suggestion to do it for this case?

          1 Reply Last reply Reply Quote 0
          • First post
            Last post