How to get the Pressed, Focused and Disabled state bitmaps from a Normal state wxBitmap?
How to get the Pressed, Focused and Disabled state bitmaps from a Normal state wxBitmap?
Hello,
I need to get the Pressed, Focused and Disabled state bitmaps from a Normal state wxBitmap?
Is this possible?
I can't see it anywhere in the documentation.
TIA.
I need to get the Pressed, Focused and Disabled state bitmaps from a Normal state wxBitmap?
Is this possible?
I can't see it anywhere in the documentation.
TIA.
Re: How to get the Pressed, Focused and Disabled state bitmaps from a Normal state wxBitmap?
Not possible because they don't exist. Maybe there is a misunderstanding, you *can* provide different bitmaps for all these states when creating a wxButton, but a single bitmap doesn't have these states hidden somewhere
There is a method wxImage::ConvertToDisabled() to generate a disabled version from a normal bitmap, but that's it.
https://docs.wxwidgets.org/trunk/classw ... b3120f77db
There is a method wxImage::ConvertToDisabled() to generate a disabled version from a normal bitmap, but that's it.
https://docs.wxwidgets.org/trunk/classw ... b3120f77db
Use the source, Luke!
Re: How to get the Pressed, Focused and Disabled state bitmaps from a Normal state wxBitmap?
Hi,
Why do you need to get it? What problem you are trying to solve?
Thank you.
Why do you need to get it? What problem you are trying to solve?
Thank you.
Re: How to get the Pressed, Focused and Disabled state bitmaps from a Normal state wxBitmap?
Hello,
I am trying to implement an owner-draw bitmap button that changes the lightness on mouse hover, click or disabled states.
One state (Disabled) is already implemented [wxBitmap|wxImage]::ConvertToDisabled(), but the other state functions are not implemented.
Re: How to get the Pressed, Focused and Disabled state bitmaps from a Normal state wxBitmap?
Hi,
This will the call for setter, not getter.
Why do you need the getters?
Thank you.
This will the call for setter, not getter.
Why do you need the getters?
Thank you.
Re: How to get the Pressed, Focused and Disabled state bitmaps from a Normal state wxBitmap?
If you really need these states (do you?), you have to implement the functions yourself, or create/edit them in an image editor.
Use the source, Luke!
Re: How to get the Pressed, Focused and Disabled state bitmaps from a Normal state wxBitmap?
Sure I do, and I guess I have found where to start,
I have to copy the function implementation
Code: Select all
wxImage wxImage::ConvertToDisabled(unsigned char brightness) const
Code: Select all
wxColour::MakeDisabled(&r, &g, &b, brightness);
Code: Select all
wxColour::ChangeLightness(&r, &g, &b, ialpha);
Re: How to get the Pressed, Focused and Disabled state bitmaps from a Normal state wxBitmap?
Hi,
But this is incorrect.
You are asking:
"How to get the Pressed state bitmap",
when you should be asking:
"How to modify the regular bitmap in order to set it as pressed"
Do you see the difference?
Is English you second language?
Thank you.
But this is incorrect.
You are asking:
"How to get the Pressed state bitmap",
when you should be asking:
"How to modify the regular bitmap in order to set it as pressed"
Do you see the difference?
Is English you second language?
Thank you.
Re: How to get the Pressed, Focused and Disabled state bitmaps from a Normal state wxBitmap?
Usually focus is indicated by a dotted rectangle, which you could draw using wxRendererNative::DrawFocusRect
https://docs.wxwidgets.org/trunk/classw ... 9559a8c4c9
(Focus is not the same as hover).
For the pressed state, usually the content is moved 2 pixel to the bottom right and a 3d-shared rectangle is drawn around the content.
https://docs.wxwidgets.org/trunk/classw ... 9559a8c4c9
(Focus is not the same as hover).
For the pressed state, usually the content is moved 2 pixel to the bottom right and a 3d-shared rectangle is drawn around the content.
Use the source, Luke!
Re: How to get the Pressed, Focused and Disabled state bitmaps from a Normal state wxBitmap?
I am really sorry about that.
Actually, it is the third one.
Thank you for your understanding.
But doublemax, got it in the first-place.
Re: How to get the Pressed, Focused and Disabled state bitmaps from a Normal state wxBitmap?
Hello,
it is now possible.
It has been merged in wxWidgets github master:
https://github.com/wxWidgets/wxWidgets/pull/2310
https://github.com/wxWidgets/wxWidgets/ ... 793de2fc1b
Thank you.
it is now possible.
It has been merged in wxWidgets github master:
https://github.com/wxWidgets/wxWidgets/pull/2310
https://github.com/wxWidgets/wxWidgets/ ... 793de2fc1b
Thank you.
Re: How to get the Pressed, Focused and Disabled state bitmaps from a Normal state wxBitmap?
Nice. Thanks for the contribution
Use the source, Luke!