Changes for FXRadioButton

Radio behavior with FXGroupBox

The "radio" behavior for FXRadioButton widgets placed inside an FXGroupBox layout manager is no longer supported. There are a number of reasons for this change:

  • We now have better ways to keep radio buttons in sync, using FOX's GUI update mechanism or data targets.

  • FXGroupBox is first and foremost a layout manager. The physical layout of its child widgets should have nothing to do with their logical behavior.

  • The various messages sent to enforce radio behavior of radio buttons inside a group box were too confusing.

The recommended method for enforcing radio behavior of a group of radio buttons, whether they're located inside an FXGroupBox or some other kind of layout manager, is to use an FXDataTarget as the message target for all the radio buttons in a group:

FXint sauceType = 2;
FXDataTarget sauceTypeDataTarget(sauceType);

new FXRadioButton(p, "Hot",   &sauceTypeDataTarget, FXDataTarget::ID_OPTION+1);
new FXRadioButton(p, "Mild",  &sauceTypeDataTarget, FXDataTarget::ID_OPTION+2);
new FXRadioButton(p, "Spicy", &sauceTypeDataTarget, FXDataTarget::ID_OPTION+3);

For this example, the initial state of the radio buttons will be that the "Mild" button is selected (since it is option 2) while the "Hot" and "Spicy" buttons are deselected. If the user clicks on one of the other radio buttons, the data target takes care of updating its value (sauceType) and changing the states of the radio buttons.

Changing the disk color

Added the getDiskColor() and setDiskColor() member functions, for getting and setting the disk color for radio buttons. The default value for the disk color is the application's background color (usually, pure white), as returned by FXApp's getBackColor() member function.