none
Inconsistent Behavior With Commands on Menu vs. Toolbar RRS feed

  • Question

  • I have added a new command by implementing a package. I want this command to appear on the "Build" menu, and in the "Build" toolbar, but only when the project factory for my new project type has context. I am able to do this succesfully on the "Build" menu, but my new command is only greyed out, not absent from the "Build" toolbar, when it should be. My .ctc file looks as follows:

    CMDS_SECTION guidBuildToolbarsPkg

      MENUS_BEGIN
        // NewMenu                              Relative to Group                       Priority    Type        Name                    Text
      MENUS_END

      NEWGROUPS_BEGIN
        // NewGroup                              Parent Group                            Priority
        guidBuildToolbarsCmdSet:MyBuildGroup,    guidSHLMainMenu:IDM_VS_MENU_BUILD,    0x0600;
    NEWGROUPS_END

      BUTTONS_BEGIN
        // Command                    Parent Group                Priority    Image            Type    Visibility       
        guidBuildToolbarsCmdSet:cmdidDriver, guidBuildToolbarsCmdSet:MyBuildGroup, 0x0100, guidBuildToolbarsCmdSet:bmpPic1, BUTTON, DEFAULTINVISIBLE | DYNAMICVISIBILITY, "Driver";
      BUTTONS_END

      BITMAPS_BEGIN
        guidBuildToolbarsCmdSet:IDB_MENU_IMAGES,    bmpPic1, bmpPic2, bmpPicSmile, bmpPicX, bmpPicArrows;
      BITMAPS_END

    CMDS_END

    CMDUSED_SECTION
    CMDUSED_END

    CMDPLACEMENT_SECTION
      // Command                             Group                                Priority
      guidBuildToolbarsCmdSet:cmdidDriver,    guidSHLMainMenu:IDG_VS_BUILDBAR,        0x0000;
    CMDPLACEMENT_END

    VISIBILITY_SECTION
        // Command                          GUID when visible
      guidBuildToolbarsCmdSet:cmdidDriver, guidDesignProjecType;
    VISIBILITY_END
     
    It seems that since I defined the button for cmdidDriver to be DEFAULTINVISIBLE | DYNAMICVISIBILITY, and I have set up my VISIBILITY_SECTION as I need, that the two instances of the "Driver" button should behave the same, but they don't. Any pointers?

    Thanks,

    -Ian
    Monday, May 22, 2006 11:26 PM

Answers

  • We specifically disable this for toolbars on the main window. Tool window toolbars however can have buttons that are not visible

    Nishan Jebanasam

    Tuesday, August 15, 2006 9:45 PM