ebmDevMag.com home
ebm Developer's Magazine
links

developer's mag
main page

article
part 1
part 2
part 3
part 4
part 5
part 6
part 7
part 8
part 9


9 - cpaRadioButton And Your Code

Key to this last section of code is that we were able to set it up in the Form Editor. To do so in your programs, follow these steps:
  • Add the header for the cpaRadioButton class to the form via the Form Editor menu option 'Source'/'Header Text':
    #include "pa_radio.h"
  • Add and position your radio buttons on the form.
  • For each radio button, modify the Class Name field to indicate 'cpaRadioButton' instead of CRadioButton. Because the call parameters and display are the same, the new radio buttons will transparently replace the old ones in our editor and source code.
  • Add an initialize function for the form, which will set the group id of each radio button, along with the tag field if necessary. This is necessary because the Form Editor has no way to set it.
  • Add the pa_radio source files to your project, and add the makefile entry:
    SRCS_CPP = eg_24.cpp eg_24_form.cpp pa_radio.cpp
This illustrates not only how easy it is to add exclusive radio buttons with the Forms Editor, but also how to extend the Editor to handle new objects. Using this class, rolling your own, or simply working with the button classes already existing, you should have no problem molding your program to suit the needs of the user.

Previous Section


Copyright © 2001-2006 ebmDevMag.com - Legal Notice