FXMenuCheck and FXMenuRadio

The FXMenuCheck and FXMenuRadio widgets are new subclasses of FXMenuCommand that take over the roles of "checked" and "radio" menu items that the base FXMenuCommand used to play. For FOX 1.2 applications, FXMenuCommand should only be used for regular menu commands.

The constructors for FXMenuCheck and FXMenuRadio are almost identical to FXMenuCommand's constructor. The only difference is that their constructors do not expect a pointer to an FXIcon after the menu item's text string.

For either an FXMenuCheck or FXMenuRadio widget, the state of its check mark (radio button) can be set programmatically using the setCheck() member function. The possible values for its state are TRUE, FALSE and MAYBE. As with the FXCheckButton and FXRadioButton widgets, the MAYBE state indicates a sort-of indeterminate state; this is useful when, for example, the user has selected multiple items, some of which are TRUE and some of which are FALSE.

The appearance of FXMenuCheck and FXMenuRadio widgets is different from the old "checked" and "radio" versions of FXMenuCommand and more closely resembles the standard FXCheckButton and FXRadioButton widgets' appearance (see Fig. XXX). The tables below indicate which colors are used to draw the different parts of the check box or radio button for these widgets. Here, the "box" color for an FXMenuCheck widget is accessed using the getBoxColor() and setBoxColor() member functions. Similarly, the "radio" color for an FXMenuRadio widget is accessed using the getRadioColor() and setRadioColor() member functions. For both of these properties, the default value is the FXApp's background color (usually, pure white).

Table 1. Colors Used for FXMenuCheck

Check Box Outline ColorThe widget's shadow color.
Check Box Background ColorThe widget's box color, if the FXMenuCheck is enabled; otherwise, the widget's background color.
Check Box Check ColorThe widget's text color (for the TRUE state), or its shadow color (for the MAYBE state, or if the widget is disabled). No check mark is drawn for the FALSE state.

Table 2. Colors Used for FXMenuRadio

Radio Outline ColorThe widget's shadow color.
Radio Background ColorThe widget's radio color, if the FXMenuRadio is enabled; otherwise, the widget's background color.
Radio "Bullet" ColorThe widget's text color (for the TRUE state), or its shadow color (for the MAYBE state, or if the widget is disabled). No bullet is drawn for the FALSE state.