Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refreshing Object
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01037726
Message ID:
01037741
Views:
18
This message has been marked as a message which has helped to the initial question of the thread.
The problem with putting the code in each object's refresh method is that they will get called whenever the refresh event happens for the parent object... form, container, whatever. This may or may not be what you need with your objects... so if all your shapes are based on the same superclass (subclass of vfp shape baseclass), it would be easy to create a method called updateshape for that superclass... then each of the shapes (subclass instances of the superclass you just created) would have that method in them. Or, better yet... you could create a manager class (custom) that would handle updating all the shapes on the form based on whatever logic you are using to change their backcolors or whatever... this manager class would understand the rules and update each shape accordingly.

This more object oriented design would give you much more control and flexibility. The shapes would only get updated when you wanted them to be updated. And, should you still want them to all refresh when the parent container refreshes, you can still do that by putting a single line of code in the refresh event of the form/contaier or whater... such as this.shpmanager.updateshapes()

I hope I've made sense... I tried to be clear and not make it seem too complicated, on the contrary the design is rather simple and will give you scalability and maintainability no matter what it is you are doing with these shapes.

>Yes, it works quite fine.
>I put the code in the refresh method elsewhere and call it programmaticaly.
>
>Thanks for your kindness
>Alessio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform