Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

REFRESH() and VFP 2

Status
Not open for further replies.

Scott24x7

Programmer
Jul 12, 2001
2,826
JP
I'm trying to work out some better practice in my overall management of screen items, and I have come across a problem, that may be because of a wrong assumption.
My question is this: Does a Refresh() call to any object, also create a cascading refresh in the objects contained within that object?
So if I have a pageframe and that pageframe 4 pages in it, if I make a call to:

ThisForm.Pageframe1.Page3.Refresh()

I understand that will fire the Page3 refresh code, does it also fire the Refresh() code in all of the child objects?

Similarly, if I have a container that has 5 objects in it, and I Set ThisContainer.Visible = .F. does it "hide" all the objects in that container too, or do I need to hide each of them as well?


Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
I understand that will fire the Page3 refresh code, does it also fire the Refresh() code in all of the child objects? Yes

Similarly, if I have a container that has 5 objects in it, and I Set ThisContainer.Visible = .F. does it "hide" all the objects in that container too? Yes.
 
Tbleken is right, but there are slight special cases and differences.

1. Refresh truly cascades, but only does so on visible things, eg the Pageframe Refresh() does not cause Refresh of inactive pages, only the active page.
2. Setting Visible = .F. only acts on the one visibility, any inner controls Visible property stays as it is, but since the container visibility does not only mean drawing its background color or border, of cause everything inside it becomes invisible, too. It's just sufficient to set Container.Visible = .T. again later, to get back the container in its previous state with inner controls being partially visible or invisible depending on their own unchanged visible state.

Unless you or some inherited classes have a visible_assign method and within that look for child objects also having a visible property, nothing cascading happens, just the effect of a container being visible is cascading by definition.

You can make experiments and verify all that yourself. A simple form with two or three objects is sufficient to look into what happens. Also notive you can track hat events happen via SET EVENTTRACKING and/or via the Debugger menu Tools->Event Tracking.

Bye, Olaf.
 
Hi Olaf,
I appreciate the detailed explanation. I had done some experiments, but I was uncertain of the outcome in some cases, and I had though that perhaps it was because of prior stupid things I had done, and it was a bit messy to try to do something conclusive, so the explanation has been very useful and saved me a ton of time. This is all in regard to the same application I've been working on here for the past couple of years. But do to work on my Doctorate and a lot of other client issues, I had to set the development aside for a few months, and now it all feels cold again, but starting to get back up to speed, maybe feel now even a littler further ahead than I did before.
It did make sense in my head that it should work this way, and "knowing" it now, I'm trying to remove some of the messiness that I had put in before not knowing this was the case, and finding some odd behavior (it doesn't take long for things to behave odd when you have bad flow and code in it... :)

Thanks to Tore as well. Good to see you are still around.
Cheers.

Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top