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.
[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.
[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.
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à
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
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.
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).