bluecomet
asked on
UserObject in an Userobject
Hi folks,
i want to write my own control etc.. So i need to put an userobject a in an userobject b and then put the userobject b on a window.
A userobject a could be, line, rectangle, ellipse, buttons etc.. I know the function openuserobject() but that only works with window! How could i put for example a line on userobject b and to vies it on userobject b and then view the hole object in a window?
$regards
i want to write my own control etc.. So i need to put an userobject a in an userobject b and then put the userobject b on a window.
A userobject a could be, line, rectangle, ellipse, buttons etc.. I know the function openuserobject() but that only works with window! How could i put for example a line on userobject b and to vies it on userobject b and then view the hole object in a window?
$regards
ASKER
I meant create it dynamically on run time, not in design time.
well, you could create a userobject b with a placeholder for userobject a (the common ancestor of whatever you want to instantiate dynamically).
next, in the userobject, code the OpenUserObject(luo) and set the reference in the same script equal to the placeholder (ancestor).
eg:
ue_postconstruct()
MyUO luo
window lw
...
// Get the parent window
lw = of_getparentwindow()
// Instantiate the custom uo
OpenUserObject(luo)
// Assign it to the placeholder
uo_theplaceholder = luo
next, in the userobject, code the OpenUserObject(luo) and set the reference in the same script equal to the placeholder (ancestor).
eg:
ue_postconstruct()
MyUO luo
window lw
...
// Get the parent window
lw = of_getparentwindow()
// Instantiate the custom uo
OpenUserObject(luo)
// Assign it to the placeholder
uo_theplaceholder = luo
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
1. In the userobject painter you can create userobject b containing userobject a (use menu Insert/Control/UserObject)
2. In the window painter you can set userobject b on the canvas (use same menu item)
done.