CMacButton, CMacCheckBox '& CMacRadioButton
Posted
by Paul Meidinger
on February 16th, 2000

Environment: VC6, NT4 SP4,
These three classes are my attempt at recreating the standard buttons on the Macintosh. The normal appearance of the buttons duplicates the 3D look of the more recent MacOS versions, but an old-style "flat" look can also be used by setting the button's Flat style in the resource editor.
The following public function is available for CMacButton:
- void SetBold(BOOL bBold = TRUE)
- BOOL GetBold()
The following public functions are available for CMacCheckBox and CMacRadioButton:
- void SetCheck(int nCheck)
- int GetCheck()
Follow these steps to add a CMacXXX button to a dialog:
- Add the desired files to your project.
- Add the appropriate include to the header file of your dialog class.
- Add checkboxes/radio buttons/standard buttons to your dialog in the resource editor.
- Use ClassWizard to add a member variable of type CMacButton, CMacCheckBox, or CMacRadioButton for the corresponding controls you just added. If the CMacXXX classes are not in the Variable Type list, choose CButton, and manually change the types in the header file of your dialog class.
To do list:
- Add support for bitmaps on buttons
- Add support for horizontal and vertical alignment
- Add support for push-like check boxes and radio buttons
- Add support for tri-state check boxes and radio buttons
Downloads
Download demo project - 34 KbDownload source - 14 Kb

Comments
There are no comments yet. Be the first to comment!