CMacButton, CMacCheckBox '& CMacRadioButton | CodeGuru

CMacButton, CMacCheckBox ‘& CMacRadioButton

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 […]

Written By
CodeGuru Staff
CodeGuru Staff
Feb 16, 2000
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

ColorLBTest

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 Kb
Download source – 14 Kb

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.