Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Generically redirect specific properties from parent to
Message
From
17/05/2006 18:33:25
 
 
To
17/05/2006 11:41:23
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01122795
Message ID:
01123044
Views:
20
This message has been marked as a message which has helped to the initial question of the thread.
>Wondering if its possible to generically redirect property references from one object to another?
>
>What I would like to do is create a list of properties and then generically redirect these properties from one object to another object via This_Access, This_Assign methods and/or bindevents() vs. having to manually add specific property_ACCESS, property_ASSIGN methods for each property being redirected.
>
>Sample scenario: A container with a child label where I would like to redirect the parent container's fontname, fontsize, fontbold, etc properties (already added to container class) to the equivalently named properties of the child label.
>
>Any suggestions for a reusable function to do this?
>


Hi Malcolm,
I'm not sure about this idea, but I'm trying <bg>

Create a method in the parent container called SetProp (or whatever you like :) :
LParameters tc_Properties, t_Value, tc_Class

Local lc_Properties

If PEMStatus( This, tc_Properties, 5 )
   lc_Properties = 'This.' + tc_Properties
   &lc_Properties = t_Value
   This.SetAll( tc_Properties, t_Value, tc_Class )
endif
Then you can call the method with:
ThisForm.oCntParent.SetProp( 'FontName', 'Arial', 'Label' )
ThisForm.oCntParent.SetProp( 'FontSize', 12, 'Label' )
Regards
Herman
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform