Many applications for Windows use check marks on menu items to indicate that an option is set. Help provides two macros, CheckItem and UncheckItem, that add and remove check marks from menu items. These macros have the following syntax:
CheckItem("item_id")
UncheckItem("item_id")
For example, to add a check mark next to an item with the ID “item_showindex,” you can use the following macro:
CheckItem("item_showindex")
In the example shown in “Adding Menu Items,” earlier in this chapter, a Help file uses a menu macro that sets or removes a mark. The menu item would be more effective if it displayed a check mark to indicate that the mark (and therefore the option) was set. By adding CheckItem and UncheckItem macros to the menu macro, the Help file will display a check mark at the appropriate times. The following example shows the resulting InsertItem macro:
InsertItem("mnu_options", "item_showindex", "Show &Index Window", "IfThenElse(IsMark(`show_index'),
`DeleteMark(`show_index');UncheckItem(`item_showindex')',
`SaveMark(`show_index');CheckItem(`item_showindex')')",0)
When the user chooses the resulting menu item, the macro saves or deletes a marker, depending on whether the marker is already set in the Help file. It also displays a check mark to indicate the state of the option.