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
Jordan shoes mentioned Gene to go for the manufacturer, a disunion of Nike
Posted by TaddyGaffic on 04/22/2013 07:12pmThe sole of shoes are made from high quality rubber material and come with the lining. One can easily search for Vans footwear in the various online stores where they are easily available at great discount prices. These come in almost an infinite amount of [url=http://markwarren.org.uk/goodbuy.cfm]nike free run[/url] color and are usually on the cheap side. Experts as well as the rights of employees in regards to the apple can annihilate the Nike Air Max For travel arrangements in developing abjection can be a acceptable accord added in comparison to they're prevention, nonetheless they do accommodate sports sports athletes while using high duke inside their profession. Bargain Nike Air Max 2009 aswell provides countless jobs inside the nations absolutely area it's hardly accessible to acquire a job. In Indonesia, for archetype nike air max 90, even acknowledging baby assets [url=http://markwarren.org.uk/property-waet.cfm]air max 90[/url] in barter for plan Air Max, however, Nike bargain shoes inside a aught bulk adaptation and utilisation of the circadian needs.. Nike Zoom Vapor VI Tour Men`s tennis shoe is a great shoe popular in the tennis courts. It has Fly wire upper for ultra support and light weight ability, it sits on a frame that gives extra heel support and contains a full-length durable rubber support and herring bone pattern. It also has extra traction for all surfaces of play.. Write a Shakespeare Sonnet without any effort! Express loving [url=http://markwarren.org.uk/goodbuy.cfm]nike free run uk[/url] feelings in a sonnet in Shakespeare's own words in 15 minutes. The rhyme scheme of a Sonnet is a,b,a,b,c,d,c,d,e,f,e,f,g,g. Think of a theme like "love" "death" or "deceit", then choose your lines in the rhyme pattern and put a Sonnet together using the programme
ReplyCheckbox is checked when using context sensitive help
Posted by Legacy on 04/08/2002 12:00amOriginally posted by: Manfred Peter
Hello Paul,
first congratulations to your fine work. We use your controls in our project AlligatorSQL - but we had some problems when using this in combination with context sensitive help.
When we pressed on a checkbox control the value of the box was changed.
We changed the following line to avoid this problem
In the function :
void CMacButtonsCheckBox::OnLButtonUp(UINT nFlags, CPoint point)
.
.
.
if (rect.PtInRect(point))
{
==> if(m_bMouseDown) m_nCheck = (m_nCheck == 0 ? 1 : 0);
// Send notify message to parent window.
// Added by Eric Hwang.
.
.
.
Thanks again for your controls
Manfred Peter
(Alligator Company)
http://www.alligatorsql.com
Replyvalue variable and UpdateData...
Posted by Legacy on 02/18/2002 12:00amOriginally posted by: DV
When you create a bolean value variable for the control, you set the variable to 1 and call UpdateData(FALSE) the checkbox state are not updated ?!!!
Replyfix resource leak...
Posted by Legacy on 11/25/2001 12:00amOriginally posted by: Hyoungsik Woo
ReplyMake buttons "Tranparent"
Posted by Legacy on 05/17/2001 12:00amOriginally posted by: Bernd
Hi, i found out how to make the buttons transparent, meaning having the same bgtColor like its parentWnd
To manage it do the following:
open the CMacButton (Baseclass) cpp File
goto CMacButton::DrawButton
seek for
COLORREF bgColor = ::GetSysColor( COLOR_BTNFACE ); // COLOR_WINDOW
modify the line to:
COLORREF bgColor = GetOwner()->GetDC()->GetBkColor();
That's it!!
Tu try our set the backgroundcolor of your dialog to white or what ever. so are the Buttons have the same bgColor like your dialog.
(Lokk especially for MacCheckbox and Macradiobutton)
Greetings
Bernd
Replywhy happens the insuffient resource of a message ??
Posted by Legacy on 10/27/2000 12:00amOriginally posted by: kwang young
ReplyMake this transparent?
Posted by Legacy on 07/24/2000 12:00amOriginally posted by: Trey
Replyflakey CMacMoreButton response to spacebar
Posted by Legacy on 04/12/2000 12:00amOriginally posted by: Rick Shide
Try the spacebar action on the CMacMoreButton controls. The initial space will open the window up, but the arrow doesn't change to point down, subsequent spacebar on an open CMacMoreButton does nothing. If you then click on the CMacMoreButton after it was opened via a spacebar, the arrow then points down. Then hitting a spacebar on the CMacMoreButton when it is pointing down to an open area closes the area but the arrow remains pointing down.
Nice controls, but you need to do more testing on response to keyboard.
ReplyLegal ramifications
Posted by Legacy on 02/16/2000 12:00amOriginally posted by: JRB
Be careful, I read somewhere that Apple does not allow the Mac look and feel to be used in apps running on other OS's
Reply
tab order & focus on radio
Posted by Legacy on 12/28/1999 12:00amOriginally posted by: Rick Shide
Unlike regular radio controls that are in the tab order, your control allows a tab to unset radio controls in a group. Also, selecting a radio control via the spacebar does not change the selection.
ReplyLoading, Please Wait ...