Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Sub-Menu in context menu

edited April 2 in General
Hi,

I have a questions relating to context menus:

How can I create a context menu that has a sub-menu? E.g.:


Also, is it possible for this context menu to be used in tandem with the SRP edit table?

Comments

  • Good question. There are two ways to create context-menus that can be used with the SRP EditTable. The first is to build a menu structure yourself and create it using the Utility("CREATE") service. This approach allows you to build a context-menu for just about anything. It is also the method used by the built-in OI context-menu builder. The second is to use the SRP EditTable's built-in ShowContextMenu method.

    I don't think the ShowContextMenu method supports sub-menus. I assume the menu structure approach can do it but I've never worked that out on my own. I know the OI context-menu builder doesn't support it but that could just be because it didn't want to.
  • Thanks, you are using it for your SRP editor, so it must be possible.
  • The screenshot you posted is not a context-menu but a normal form menu. That is very different.

    That said, the SRP Editor does support a context-menu with sub-menus:


    So, yes, it is possible. However, the SRP Editor is building this using low-level APIs within the OCX control itself (at least I am pretty certain this is the case...Kevin can correct me). It is not using the the exposed methods that I described above.

    As I said, I wouldn't be completely surprised if the menu structure method can do this. I just haven't explored this enough to see what is required.
  • I see,

    It doesn't look hopeful
    https://wiki.srpcs.com/display/Commands/ContextMenu+Function

    Not a big deal, there is another way to do what I am trying to do.
  • Yes, the published solution don't support it. I was suggesting that you might be able to if you built your own solution using the menu structure approach. That's what we did with our own FrameWorks based Context Menu Manager, although we stopped short of of supporting sub-menus.
  • Just putting it out there - Could the action of a menu item create a contextmenu and thus being a submenu
  • Just putting it out there - Could the action of a menu item create a contextmenu and thus being a submenu


    Yes, I have thought of that. Only problem with it is that it's a bit disorientating for the user -- but who cares about that.
  • I concur. This is non-standard UI and there are good reasons to avoid subverting user expectations.
Sign In or Register to comment.