Much ado about bevel buttons

One of the things that transitioning from the old Classic framework, which was based on Carbon and HIToolbox, to Cocoa brought about was changes to lots of controls. Bevel buttons fall into that boat and now with the support of Dark Mode they look awful – because bevel buttons are based on an old style control that has no modern equivalent in 64 bit Cocoa.

And even worse you have no way to force them to be dark mode compliant – again because the control they are based on doesn’t have a modern equivalent. I’m working on a project that used them in various ways and updating everything to be dark mode compliant was darned hard when you have such controls in use.

Now its easy to say “Oh well Xojo should just update that to whatever is the modern equivalent”. And there’s the problem. There isn’t one that matches all the things that bevel button can do. So Xojo could update to some modern style on macOS but that would silently break code. Or, as they have done so far, do nothing and encourage people to use some other control. That’s not always practical advice either. For this project I’m working on we’ve taken a different path and actually made our own replacement. It supports dark mode. And menus and icons and most everything the existing bevel button does. We’ve left out things that arent used but they would not be hard to add.

And now the entire project is moving along, is looking great in macOS dark mode, and we have a nice cross platform bevel button that we can continue to use.

With that said here’s the replacement we made. It also happens to include some code for Semantic Colors. The project uses the MBS plugins based code so the non-MBS based code may, or may not be, suitable for your uses.