INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

REFRESH() and VFP

REFRESH() and VFP

(OP)
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

RE: REFRESH() and VFP

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.

RE: REFRESH() and VFP

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.

RE: REFRESH() and VFP

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close