I continue to have re-paint problems with controls where I change the background color at runtime. This is in a form that is on a tab.
Symptoms:
Change the background color
Pop up a modal window over top of the control that had the color change
Close the Pop up window
The spot where the control with the changed color is now blank. For an instant after the Pop window closes the control is visible then it dissapears as if it is overdrawn with the blank spot.
I added a REDRAW in various spots. It seems the only place that helps is to redraw the control in the PAINT event for the FORM. If I do that then the background and text of the control repaints but the border does not. If it has a vertical scroll bar the scroll bar does not repaint.
If you mouse over the control it repaints. If you just mouse the border only the border repaints. If you mouse the vertical scroll bar it repaints and the border (since the mouse passes over the border to get to the scroll bar).
This is a form that is on a tab. This is only one level deep but I do have forms on other tabs that also have tabs.
All of the controls that do not have the background changed at run time behave normally.
I know this will take some "work around" code but I am not sure where to go next. I know there are the CLIP SIBLINGS, etc properties but they seem to have no effect either (and I don't understand them anyway).
Any suggestions?
Thanks.
Hi Mark,
I am pretty sure that I dealt with this similar problem just a week or so ago. I think that it stems from the fact that the Window Styles for Child TabControl Pages was not being set correctly. Basically, FireFly would only apply the %WS_CHILD and %DS_CONTROL styles while omitting to include other styles.
I changed the code output to set the styles as:
Style = %WS_CHILD Or %DS_CONTROL Or %WS_CLIPCHILDREN or %WS_CLIPSIBLINGS
This should fixed any repaint issues on tab children because now the areas occupied by controls whille be "clipped" (excluded) from the repainting of the form.
I will upload a new FireFly engine file this evening when I get home and I will post the link here.
Try downloading and installing the latest FFengine from:
http://www.planetsquires.com/files/FFengine.zip
Paul,
The new engine did the trick. Everything works on the repaint.
I have said it before but I will say it again ....
FireFly, PowerBASIC, and your support has to be the best development combination in the world!!
Thanks for the help.
Thank-you very much! Myself and FireFly appreciate the kind words.
:)
So, is this a preview of V3 or is the version box just reporting wrong...
It started out as version 3, but then I decided to scrap building on the Version 2 code base and write the whole thing in FireFly itself. Therefore, the version in the uploaded file is really only 2.50 with a few code fixes.
I have a similar problem with Tab Control. I have several textboxes with ES_NUMBER. So If I type a character in it a tooltip comes up and tells me unacceptable character. I press the X on that tooltip and all my controls disappear. As`I move the mouse over the form it starts repainting itself. To see the screen properly, I just change to another tab and back.
So where would I insert a redraw command for the form to eliminate the problem.
I am using 2.75
bert
That's a good question. I just started using WinXP as my main development O/S and I noticed that it pops up a tooltip if a non-numeric is entered in an ES_NUMBER style textbox.
I am looking into the problem and I will try to get an answer as soon as I can.
I was able to make the repaint problem "go away" in my example by simply ensuring that the WS_CLIPCHILDREN and WS_CLIPSIBLING styles were checked for the main Form that the TabControl is on.