Skip to content

Panel visiblity status is not reflected in the "Window" menu #61

@avenger3pt0

Description

@avenger3pt0

Our tool has multiple panes that can have their visibility status toggled by clicking on their menu item in the "Window" menu. The issue is that those menu items always have a check mark next to them, no matter the visibility status. Repro steps:

  1. Add a OutputService to your program
  2. Launch program and notice the "Output" menu item in the "Window" menu is checked and the panel is visible.
  3. Click the "Output" menu item.
  4. Notice that the panel has been hidden.
  5. Click on the "Window" menu again and notice that the "Output" menu item is still checked.

Expected that the "Output" menu item is no longer checked because the panel is not visible.

I believe I have identified that the issue is that the CommandInfo is never updated after the program is initialized. I came up with a solution by modifying CommandService.item_Click :

ICommandClient client = GetClientOrActiveClient(tag);
if (client != null && client.CanDoCommand(tag))
{
client.DoCommand(tag);
UpdateCommand(tag); //Force the command status to be updated
}

My question is if this is the correct fix or if there is a better way to accomplish the desired behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions