Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
3 posts • Page 1 of 1
Try SetForegroundColour inherited from wxWindow. I haven't tried it. According to docs:
The meaning of foreground colour varies according to the window class; it may be the text colour or other colour, or it may not be used at all. Additionally, not all native controls support changing their foreground colour so this method may change their colour only partially or even not at all.
madushikasewwandi wrote:I want to write a custom wxSlider to use as a Color Slider, where we can set color to the bar of the slider.
But I dont have an idea where to start.
So, to make sure I understand the problem, you want a slider that will pick a color from a range of colors.
I messed around with the Windows Paint Edit Colors dialog for perspective, what they're doing is a three-dimensional pick of hue, saturation, and luminance values (HSL) with a HS grid and a L slider. Note they're using a 0-255 range for the H, S, and L values, so you could make three wxSliders, one for H, S, and L, with lower limit of 0, upper limit of 255.
If you want a single slider to pick from a 0-255 range, you could hard-code S and L values to, say, the mid-point of 128, and just slide from 0-255 on H. That'd transition from reds through greens and blues to a sort of purple...
Who is online
Users browsing this forum: No registered users and 2 guests