Enabling and disabling items from an archived menu

Because the Tiles menu items are no longer based on TCommandControlStateOn<TTilesSelection>, you can't rely on the mechanism for enabling menu items described in "Enabling and disabling menu items" on page 84. TTilesPresenter overrides HandleCurrentSelectionChange so that it controls when the Tiles menu items are enabled and disabled.

The Presentation framework calls HandleCurrentSelectionChange whenever the user makes a new selection. TTilesPresenter::HandleCurrentSelectionChange sets the enabled state on the Red, Blue, and Green menu items based on whether the new selection is empty. The items are only enabled if at least one tile is selected. The items for adding new tiles are always enabled because the command underlying these items, TCreateTileCommand, acts directly on the model and doesn't rely on selected data, as described in "Implementing TCreateTileCommand" on page 90.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker