Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can PROPERTY do something when its value change....?
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00435567
Message ID:
00435568
Views:
19
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
When I make my own class, for ex:
DEFINE CLASS cstBox AS custom
x1 = 0
y1 = 0
x2 = 0
y2 = 0
FUNCTION draw
< draw a box with x1,y1,x2,y2>
ENDFUNC
ENDDEF

if I want to change the size of that Box, first i'm changing the properties and call DRAW() method.
Can VFP do that, after I changes the property values withoout calling DRAW() method
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

If you are using VFP 6.0, check out the _assign methods. They're pretty well documented in the Help file, but basically, the Assign fires when you change a value. So, you can attach an Assign method to each of the properties, and call your Draw() function. This will redraw after each property change, though, which might not (or might) be the desired behavior.

In VFP 5.0 you could rework your logic a little -- pass the four value to the draw method as parameters, for instance [i.e., This.Draw(15,21,14,22)].
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform