Can't set BackColor for a BevelButton?

In moving a tool to a dark theme, I’m replacing the immutable PushButtons with BevelButtons so that I can make use of the BackColor/TextColor options - only to find that the BackColor value is not obeyed. I always get the default light gray.

Bug in Xojo 17r3 or something that I’m missing?

you missed something

best to make your own button class, this way you can re-use it, and make it work on all platforms

[quote=368970:@Tim Jones]In moving a tool to a dark theme, I’m replacing the immutable PushButtons with BevelButtons so that I can make use of the BackColor/TextColor options - only to find that the BackColor value is not obeyed. I always get the default light gray.

Bug in Xojo 17r3 or something that I’m missing?[/quote]

BevelButton’s backcolor can be changed in Windows, but not in Mac.

I posted a method long ago but of course it is buried and I could not find it back.

In the button open, create a picture the size of the button, graphics.fillcolor it with whatever backcolor you want, and affect that picture to the button’s Icon.

You can also create a picture file, drag it into the project, and affect it to the BevelButton’s Icon.

Suspected as much …

[quote]In the button open, create a picture the size of the button, graphics.fillcolor it with whatever backcolor you want, and affect that picture to the button’s Icon.

You can also create a picture file, drag it into the project, and affect it to the BevelButton’s Icon.[/quote]
That’s what I was trying to avoid. I would need over 78*4 new images for all of the buttons’ states (Enabled, mouse over, clicked, disabled). C’est la guerre.

not really… (depending on how you design things)
you might be able to create ONE image (or two if @1x and @2x)
and in the PAINT event of your custom button, have it alter the visual aspect (gray scale or whatever)
This is something I have done in the past.

[quote=368991:@Tim Jones]Suspected as much …

That’s what I was trying to avoid. I would need over 78*4 new images for all of the buttons’ states (Enabled, mouse over, clicked, disabled). C’est la guerre.[/quote]

Subclass the BevelButton and in there, create your pictures based on the value of backcolor. Voilà :slight_smile:

Note that under Windows there is absolutely no animation in bevelbutton with a backcolor. So even if it worked on Mac, you would not have any animation either. Better create your own subclass with all the bells and whistles. Ce n’est pas la guerre, c’est une bataille :wink:

Bevel button has ugly look on linux. it’s better to avoid using it.

Unix UI is often not quite as polished as one may like. Canvas is your friend.

This is the direction that I’m heading in. And, as @Dave S says, a custom class here is your friend. As I’ve mentioned a while back, it would be great to be able to apply styles to our desktop controls similar to the way we can in a Web project.

Not really. You can create a native button with icon similar to bevel button.

My situation is that I am trying to get a consistent look and feel across all three platforms. Since we can’t manipulate a BevelButton for this, a Class based on a Canvas is the right path in this case.

Talking about BevelButton, I wonder why Xojo reinvent the wheel? On Linux, we can create a native button + icon and I believe on windows too. So? is there a limitation on Mac? Can we create a native button + icon on Mac?

If you mean similar background color, then canvas is your friend. But, if you mean native look, then it’s hardly to achieve that using canvas especially on Linux.

My system theme is dark (Arc-Dark theme), but I forced Xojo IDE to be loaded with BlueBird theme (a light theme).

Technology is far too different to be able to easily implement CSS on Desktop.

Take JavaFX as an example. We use that for some other tools and it looks the same across the board.

Java does not use native controls. It uses it’s own controls within it’s own UI. So no wonder it is just the same on each platform.

Personally, I find it ugly on Mac, and strange on Windows.

I would certainly not like to use it for end user programs in the MAS or the Windows Store.

I think I posted about this some random time ago in a random thread.

Cross platform is getting so ubiquitous now that the reliance on native controls is getting less and less.

Be bold, be unique, be a canvas! :smiley:

More like I forgot something. 2009 was eons ago in programmer years :slight_smile:

No… you “missed it”… as it is still currently stated in the Lang Ref which is where I copied that from :slight_smile: