Hello,
I tried to apply a skin (Codejock Skin Framework) to a wxWidgets application using a Simple dll, and it worked without problems until I tried to add some wxButtons with icons loaded from resource to the application, then I noticed the button is drawing expanded and without the icon on it.
When I remove the skin from loading in the application initialization it works without issues.
And if I don't assign the button an icon it works without issues also.
The attached screenshots illustrates this.
What could be the cause of the problem ?
I must have the skin framework in the application.
Thank you for your understanding.
[wxMSW], [wx3.1.1], This problem drove me mad, (wxButton, uxTheme, manifest) !!
[wxMSW], [wx3.1.1], This problem drove me mad, (wxButton, uxTheme, manifest) !!
Last edited by tomay3000 on Thu Nov 22, 2018 11:14 am, edited 1 time in total.
Re: [wxMSW], [wx3.1.1], This problem drove me mad, (wxButton, uxTheme, manifest) !!
Labeling the screenshots would have been helpful...
I assume:
1) wxButton with bitmap, without the theme DLL
2) the same with theme DLL
3) wxButton without bitmap, with theme DLL
I have no explanation for the stretched button in #2 (is it in a sizer? Maybe the best-size calculation fails)
But when you add a bitmap to a button, it will become "userdrawn" internally and i guess this interferes with the theme DLL.
As the theme DLL probably only works with 100% custom controls, I don't think there is a solution for this.
I assume:
1) wxButton with bitmap, without the theme DLL
2) the same with theme DLL
3) wxButton without bitmap, with theme DLL
I have no explanation for the stretched button in #2 (is it in a sizer? Maybe the best-size calculation fails)
But when you add a bitmap to a button, it will become "userdrawn" internally and i guess this interferes with the theme DLL.
As the theme DLL probably only works with 100% custom controls, I don't think there is a solution for this.
Use the source, Luke!
Re: [wxMSW], [wx3.1.1], This problem drove me mad, (wxButton, uxTheme, manifest) !!
Sorry for that.doublemax wrote: Labeling the screenshots would have been helpful...
Your assumption is correct.doublemax wrote: I assume:
1) wxButton with bitmap, without the theme DLL
2) the same with theme DLL
3) wxButton without bitmap, with theme DLL
Me neither I have now idea.doublemax wrote: I have no explanation for the stretched button in #2
Yes it is in a sizer. a wxBoxSizer in a wxPanel.doublemax wrote: (is it in a sizer? Maybe the best-size calculation fails)
AH! interference, I am afraid of this.doublemax wrote: But when you add a bitmap to a button, it will become "userdrawn" internally and i guess this interferes with the theme DLL.
There should be a workaround, Either I use the button without the bitmap and the theme DLL, OR the button with the bitmap and without the theme DLL.doublemax wrote: As the theme DLL probably only works with 100% custom controls, I don't think there is a solution for this.
But I want both the button with the bitmap and the theme DLL
Either I override wxButton drawing and I delay the bitmap drawing to the end (which I haven't tried), or there is something I don't catch here.
This is all because the wxWidgets Creators / Developers / Maintainers did not count the possibility of using a theme DLL when they designed wxButton to have a bitmap in it and use userdrawn incorrectly.
Do you have any hint on how I can make it possible ?
Thank you for your understanding.
Re: [wxMSW], [wx3.1.1], This problem drove me mad, (wxButton, uxTheme, manifest) !!
In their defense, that's a very rare requirement and on top of that, i'm not even sure what could be done about it.This is all because the wxWidgets Creators / Developers / Maintainers did not count the possibility of using a theme DLL when they designed wxButton to have a bitmap in it and use userdrawn incorrectly.
I can only suggest to ask in the wx-users group where you can reach the wx developers. This here is a user forum. https://groups.google.com/forum/?hl=en& ... m/wx-users
Asking the creator of the theme DLL might also be worth a try.
Use the source, Luke!
Re: [wxMSW], [wx3.1.1], This problem drove me mad, (wxButton, uxTheme, manifest) !!
Thank you, I will try to do my best to make it possible.
Re: [wxMSW], [wx3.1.1], This problem drove me mad, (wxButton, uxTheme, manifest) !!
I found the origin of the problem:
There were never a check of the return value of the GetThemeMargins() API, which in my case it was not returning S_OK, and therefore the pMargins struct members contained invalid values of the theme margins that caused that drawing behavior.
I have made a pull request in github to fix this, https://github.com/wxWidgets/wxWidgets/pull/1036.
There were never a check of the return value of the GetThemeMargins() API, which in my case it was not returning S_OK, and therefore the pMargins struct members contained invalid values of the theme margins that caused that drawing behavior.
I have made a pull request in github to fix this, https://github.com/wxWidgets/wxWidgets/pull/1036.
Re: [wxMSW], [wx3.1.1], This problem drove me mad, (wxButton, uxTheme, manifest) !!
Interesting. Thanks for the feedback.
Use the source, Luke!