I'm in the middle of a reasonably significant size project and our team has heavily utilized the new OOP design patterns with classes for each object with minimum code int the panels, properties instead of $params, etc. This works really well, except when I want to do bulk operations or use addSymbol on one of my objects.
Let's say my object has a caption property.
--------------------------------------
//Button Caption
#property string caption
public void setCaption(string newCaption)
{
ButtonObject.text = newCaption;
}
public string getCaption()
{
return ButtonObject.text;
}
--------------------------------------
Now, if I drop an instance of my button on the parent panel and name it BO1, I can change the caption programmatically by using:
BO1.setCaption(myNewCaption);
This works fine if I only have a couple of objects on my screen.
If I have a bunch of buttons or want to use addSymbol, I can no longer just directly reference the subroutines because I cannot access user created properties or functions at run time.
Neither of these works:
setValue("BO1","caption",newCaption);
callFunction("BO1.setCaption", newCaption);
I saw reference to function pointers only working on static functions (which may be related to what's going on here?) but I can't create a static function in a panel.
Is this just something I have to work around by returning to $ parameters in my object instantiation or am I missing something?