Command Flag Element
The CommandFlag element uses a child element to modify its Parent element.
Attributes and Elements
The following sections describe attributes, child elements, and parent elements.
Attributes
None.
Child Elements
Element |
Description |
---|---|
AllowParams |
Indicates that users can enter command parameters in the Command window when they type the canonical name of the command. Valid for: Button |
AlwaysCreate |
Menu is created even if it has no groups or buttons. Valid for: Menu |
CaseSensitive |
User entries are case-sensitive. Valid for: Combo |
CommandWellOnly |
Apply this flag if the command does not appear on the top-level menu and you want to make it available for additional shell customization, for example, binding it to a key. After the VSPackage is installed, you may customize these commands by opening the Options dialog box from the Tools menu and then editing the command placement under the Keyboard Environment category. This flag does not affect placement on shortcut menus, toolbars, menu controllers, or submenus. Valid for: Button, Combo |
DefaultDisabled |
By default, the command is disabled if the VSPackage that implements the command is not loaded or the QueryStatus method has not been called. Valid for: Button, Combo |
DefaultDocked |
By default, docked to the integrated development environment (IDE). This is valid only for Toolbar menu types. Valid for: Menu |
DefaultInvisible |
By default, the command is invisible if the VSPackage that implements the command is not loaded or the QueryStatus method has not been called. This should be combined with the DynamicVisibility flag. Valid for: Button, Combo, Menu |
DontCache |
The IDE does not cache the QueryStatus method results for this command. For a menu, this tells a menu controller not to cache the text of its menu items. Use this flag when the menu contains dynamic items or items with dynamic text. Valid for: Button, Menu |
DynamicItemStart |
Indicates the beginning of a dynamic list. This enables the environment to build a list by successively calling the QueryStatus method on list items until the OLECMDERR_E_UNSUPPORTED flag is returned. This works well for items such as most recently used (MRU) lists and window lists. Valid for: Button |
DynamicVisibility |
The visibility of the command can be changed through the QueryStatus method or through a context GUID that is included in the VisibilityConstraints section. This applies to commands that appear on menus, not on toolbars. Top-level toolbar items can be disabled but not hidden, when the OLECMDF_INVISIBLE flag is returned from the QueryStatus method. On a menu, this flag also indicates that it should be automatically hidden when all its members are hidden. This flag is typically assigned to submenus because top-level menus already have this behavior. This flag should be combined with the DefaultInvisible flag. Valid for: Button, Combo, Menu |
FilterKeys |
See the Filtering Keys topic under Combo Element. Valid for: Combo |
FixMenuController |
If this command is positioned on a menu controller, the command is always the default, that is, the command is selected whenever the menu controller button itself is selected. If the menu controller has the TextIsAnchorCommand flag set, then the menu controller also takes its text from the command that has the FixMenuController flag. There should be only one command on a menu controller that is marked with the FixMenuController flag. If there is more than one command so marked, the last command in the menu becomes the default command. Valid for: Button |
IconAndText |
Show an icon and text on menu and toolbar. Valid for: Button, Combo, Menu |
NoAutoComplete |
Auto-complete feature is disabled. Valid for: Combo |
NoButtonCustomize |
Do not let the user customize this button. Valid for: Button, Combo |
NoKeyCustomize |
Do not enable keyboard customization. Valid for: Button, Combo |
NoShowOnMenuController |
If this command is positioned on a menu controller, the command does not appear in the drop-down list. Valid for: Button |
NotInTBList |
Does not appear in the list of available toolbars. This is valid only for Toolbar menu types. Valid for: Menu |
NoToolbarClose |
User cannot close the toolbar. This is valid only for Toolbar menu types. Valid for: Menu |
Pict |
Show only an icon on a toolbar, but only text on a menu. If no icon is specified, shows a selectable blank space on a toolbar. Valid for: Button |
PostExec |
Makes the command non-blocking. The IDE defers execution until all pre-processing queries are completed. Valid for: Button |
RouteToDocs |
The command is routed to the active document. Valid for: Button |
StretchHorizontally |
When this flag is set, the width becomes the minimum width for the combo box, and if there is room on the toolbar, the combo box stretches to fill available space. This occurs only if the toolbar is horizontally docked, and only one combo box on the toolbar can use the flag (the flag is ignored on all except the last combo box). Valid for: Combo |
TextMenuUseButton |
Use the ButtonText field for menus. The default is the MenuText field if it is specified. Valid for: Button |
TextChanges |
The command or menu text can be changed at run time, typically through the QueryStatus method. Valid for: Button, Menu |
TextChangesButton |
Valid for: Button |
TextIsAnchorCommand |
For a menu controller, the text of the menu is taken from the default (anchor) command. An anchor command is the last command selected or latched. If this flag is not set, the menu controller uses its own MenuText field. However, clicking the menu controller still enables the last selected command from that controller. This flag should be combined with the TextChanges flag. This flag applies only to menus of type MenuController or MenuControllerLatched. Valid for: Menu |
TextMenuCtrlUseMenu |
Use the MenuText field on menu controllers. The default is the ButtonText field. Valid for: Button |
TextMenuUseButton |
Use the ButtonText field for menus. The default is the MenuText field if it is specified. Valid for: Button |
TextOnly |
Show only text on a toolbar or a menu but no icon even if the icon is specified. Valid for: Button |
Parent Elements
Element |
Description |
---|---|
Groups Button Element elements. |
|
Defines all the menus that a VSPackage implements. |