Menu Editor for Flat Sets

Using the Menu Editor I can create a custom menu in ProjectWise and when I select Documents everything works fine but not Document Sets.
I am using Command Type: Document Command
Required Mask: 1 (Documents), 2 (Document Sets)

I have tried making the Mask 0 but it makes no difference, I still cannot use my custom menu on Flat Sets.
What am I missing?

ProjectWise 10.00.03.434

Parents
  • ,

    Please post some screenshots of the .MRR properties as well as the code behind the menu commands.

  • Document Command menu items were under a Pull Down Menu.
    That Pull Down Menu had Document Selected as a Required Mask.
    Removing the Document Selected from the pull down has the menu items working correctly.

    I did like how the menu was grayed out when no documents were selected.
    Is there a way to make the Pull Down Menu gray out unless either a Document or Document Set is selected?
    When I check both it's an impossible task.

  • If I understand your problem, it comes done to the "easy to use" filters on the .MRR tool are "hard coded" for AND or OR operations.  In other words, if you require a document to be selected and also require that a flat set is selected, then you have a "catch-22" situation because a document is not a flat set, and a flat set is not a document.

    Without testing, I would think that it would work if you had both a document AND a flat set selected, but I didn't test that.

    Here's what the documentation for Ignore Mask, Required Mask, and State Function says:

    So, the way around this particular problem is to use a "State Function".  A state function can do everything the Required and Ignore Masks can do, but since you define the logic behind what the state function returns, you can introduce whatever logic makes sense for your needs, like if there is at least one document OR flat set selected, then return zero (display the menu item), otherwise return grayed.  

    BTW, AAMS_HIDED doesn't work and hasn't work for years because hiding menu items caused too many calls to user support desks or to Bentley support because, well it was WAD.  For example, a user would report a problem because they could not find the Delete document command, but the reason was because it was hidden (by design) because the user had not selected any documents to delete!  So, the new rule was that ProjectWise Explorer would never hide any menu command, but would only gray them out if they were not available or did not apply.

    Now if you use the API menu functions (see the MYMENU sample), you can control your menus fully, including "hiding" (not displaying) your menu items if your logic dictates that action. 

    HTHs

  • Pull Down Menu does not support using a State Function. That would have been great.
    The State function may come in handy for Document Commands down the track.

  • If you mean the Command Type "PullDown Menu", then there isn't any reason to have a state function because that "menu item" is always displayed, and it is what you see at the top of ProjectWise Explorer's menu bar and has no other context.

    Any Command Type other than PullDown or Separator can have a state function.  

    I don't understand the context of your problem.  Please post a screenshot or two of what you have and what isn't working and I'll try to help.

  • Yes PullDown Menu. In my case it's Menu1 > Submenu > Commands.
    I wanted to grey the Submenu when either Documents or Document Sets are not selected. Not critical though.

    Trying to get the State Function to work. Do you have a C# example?

  • This would have been clearer to me if I had seen a screenshot of your menu file (Menu -> SubMenu -> Commands) as it wasn't clear to me that you were using a Pulldown menu type within a Pulldown menu type...

    There isn't a way to gray out the submenu (pulldown menu) using the .MRR file approach.  You will have to use the API menu functions approach if you want to gray it out based upon what is currently selected.

    As for using C# for the state function, I don't have a specific example of that, but if you look at my SampleCallingC-ShareCodeFromMrrFile located here https://github.com/DanWilliamsAtBentleyDotCom/Sample-Calling-CSharp-Code-From-Mrr-File 

    You would just have to add your state function using a prototype that matches what is in the ProjectWise SDK documentation which looks like this:

    Here's what a Document Command prototype looks like from the documentation:

    Here's how I set up the CustomDocumentCmd() in the C# source file from my sample:

    You would just have to declare your C# implementation of the CustumStateFunction() to match what ProjectWise Explorer is expecting.

    Here is my guess (I'm not in a position to test it at the moment) using the documentation found here https://docs.microsoft.com/en-us/dotnet/framework/interop/marshaling-data-with-platform-invoke for datatypes.

    I suspect that this would probably work:

    See the ProjectWise SDK documentation for the return types (Menu Item State Flags).

    HTHs

Reply
  • This would have been clearer to me if I had seen a screenshot of your menu file (Menu -> SubMenu -> Commands) as it wasn't clear to me that you were using a Pulldown menu type within a Pulldown menu type...

    There isn't a way to gray out the submenu (pulldown menu) using the .MRR file approach.  You will have to use the API menu functions approach if you want to gray it out based upon what is currently selected.

    As for using C# for the state function, I don't have a specific example of that, but if you look at my SampleCallingC-ShareCodeFromMrrFile located here https://github.com/DanWilliamsAtBentleyDotCom/Sample-Calling-CSharp-Code-From-Mrr-File 

    You would just have to add your state function using a prototype that matches what is in the ProjectWise SDK documentation which looks like this:

    Here's what a Document Command prototype looks like from the documentation:

    Here's how I set up the CustomDocumentCmd() in the C# source file from my sample:

    You would just have to declare your C# implementation of the CustumStateFunction() to match what ProjectWise Explorer is expecting.

    Here is my guess (I'm not in a position to test it at the moment) using the documentation found here https://docs.microsoft.com/en-us/dotnet/framework/interop/marshaling-data-with-platform-invoke for datatypes.

    I suspect that this would probably work:

    See the ProjectWise SDK documentation for the return types (Menu Item State Flags).

    HTHs

Children
No Data