Hello,
I need to know where to intercept the background and forground color changes of a control.
Is there an event I don't know about?
What is the best way to do it?
TIA.
[wxMSW] What is the best way to get notified when the background or forground colors of a control changes? Topic is solved
- doublemax@work
- Super wx Problem Solver
- Posts: 474
- Joined: Wed Jul 29, 2020 6:06 pm
- Location: NRW, Germany
Re: [wxMSW] What is the best way to get notified when the background or forground colors of a control changes?
No event is triggered in these cases. But the only time this could happen, is when you change the color yourself, isn't it? So why would you need to get notified?
Re: [wxMSW] What is the best way to get notified when the background or forground colors of a control changes?
I use a sub-classed wxControl, and I need to update the drawing inside that sub-classed control according to the background and foreground colors.
So if later I use mySubClassedControl.SetBackgroundColour() or mySubClassedControl.SetForgroundColour(), then how do I know inside the sub-classed control if the color was changed!
So if later I use mySubClassedControl.SetBackgroundColour() or mySubClassedControl.SetForgroundColour(), then how do I know inside the sub-classed control if the color was changed!
Last edited by tomay3000 on Mon Aug 03, 2020 5:55 pm, edited 1 time in total.
- doublemax@work
- Super wx Problem Solver
- Posts: 474
- Joined: Wed Jul 29, 2020 6:06 pm
- Location: NRW, Germany
Re: [wxMSW] What is the best way to get notified when the background or forground colors of a control changes?
Override these two methods and either perform the necessary changes immediately, or set a flag and perform them when the next paint event is received.
Re: [wxMSW] What is the best way to get notified when the background or forground colors of a control changes?
I completely missed that these methods are virtual and probably was made like that for this reason.
Thank you.
Thank you.