If you have added new code to XWorkplace, you might wonder how to integrate your code into the "XWorkplace Setup" object, most notably, how to add stuff to the "Features" container.

This is pretty easy. The "Features" page uses a subclassed container (the code for those checkboxes is in helpers\comctl.c, but this you need not worry about). All you have to do is take a look at src\shared\xsetup.c. The setFeaturesInitPage function is responsible for initializing the container with the features, while the setFeaturesItemChanged function reacts to selection changes in the container.

To add something, perform the following steps:

  1. Add a dialog item ID to include\dlgids.h, where all the other items of this kind are (search for ID_XCSI_GENERALFEATURES to find them).

  2. Add a string for your setting to the NLS strings (e.g. for English, to 001\xfldr001.rc), using that ID.

  3. Add your ID to the FeatureItemsList array in src\shared\xsetup.c. Your item will then automatically get inserted into the container by setFeaturesInitPage.

  4. Still, in setFeaturesInitPage, you need to add a line which checks the container checkbox according to the setting (those ctlSetRecordChecked(hwndFeaturesCnr ... lines).

  5. In setFeaturesItemChanged, add a case/switch which reacts to user changes.