Skip to content
0
  • Recent
  • Tags
  • Popular
  • SAMSON Connect
  • Get SAMSON
  • Recent
  • Tags
  • Popular
  • SAMSON Connect
  • Get SAMSON
Collapse
SAMSON Forum
  1. Home
  2. Develop
  3. GUI
  4. Add new items in context menu when right-clicking on a selection

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

Scheduled Pinned Locked Moved GUI
3 Posts 2 Posters 4.0k Views
  • 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
    K
    Khoa
    wrote on last edited by
    #1

    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
    0
    • StephaneS
      StephaneS
      Stephane
      wrote on last edited by Stephane
      #2

      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
      0
      • StephaneS 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
        K
        Khoa
        wrote on last edited by
        #3

        @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
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Login or register to search.
        • First post
          Last post