Skip to content

Automatic Refresh

The command bar system provides an update mechanism for refreshing the state of menu and toolbar items. Typically, this is required to enable/disable, check/uncheck, and hide/show items. When Update is sent to the cCJCommandBarSystem object, it will start an update process that sends Update to all “active” menu items. This update process can be triggered to occur on a regular basis by setting the pbTimerUpdate property to true. When true, all active menu items will be refreshed whenever an idle timer fires. Status bars are also sent this update message.

A menu item is declared to be active by setting its pbActiveUpdate property to true. You generally only declare a menu item to be active if it is always visible (i.e., in a toolbar) and it is likely to change as a result of your program activity (e.g., a save item that must be enabled whenever a Data Dictionary’s changed state is true).

For this process to work properly, you must make sure that your menu item’s IsEnabled, IsChecked, and IsVisible functions are properly coded. These are called by the update process to determine the desired state of a menu item.

Before a popup menu is displayed, the Update message is always sent to all menu items within the popup. This ensures that the menu items are always in their proper state before they are displayed.

See Also