Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_screen Object - reseting to its original state.
Message
From
07/10/2003 10:16:42
 
 
To
07/10/2003 08:54:07
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00835718
Message ID:
00835762
Views:
13
It depends on what you mean by "restore."
Is it to restore the objects and properties you've added to their original state or to remove them entirely?

Either way, it would be easiest to have a set of methods, programs or functions you can call that simply loops through the list of possibly added properties and objects.

As far as properties go, I believe you can only remove them in VFP8.

e.g.
Function RestoreScreen()

Local laPossibles(1), lcName, lcType
*-- this array may be defined somewhere else, or even in a lookup table
laPossibles[1]="newProperty1"
laPossibles[2]="newObject1"
** etc.

For Each lcName In laPossibles

  lcType = Type("_screen."+lcName)
  Do Case
    Case lcType="U"
       ** do nothing - would normally put this at the end
       ** but the catchall of Otherwise is better for other types
    Case lcType="O"
       ** keep in mind that objects may have other things cleaned up
       ** for them - this is just the basic outline
       _screen.RemoveObject(lcName)
    Otherwise
       _screen.ResetToDefault(lcName)
       ** RemoveProperty(_screen, lcName) && only available in VFP8
    
  EndCase

EndFunc
>Hello group,
>I´ve added objects and properties to the _screen object.
>I want to be able to restore it´s original state quickly.
>Is there any moethod or command I can use to restore it to the "Default" properties and state?
>
>Thanks,
>Pablo
Insanity: Doing the same thing over and over and expecting different results.
Previous
Reply
Map
View

Click here to load this message in the networking platform