Alrighty, so these sub compartments are driving me ever so "slightly" crazy!
I have pretty much copied an example out of the book and it just doesn't do what it is supposed to!
The Shape Script is as follows:
=====================
//Shape main affects the parent
shape main
{
//Set the color of the parent element to red
setfillcolor(255,0,0);
//draw the parents native shape
drawnativeshape();
}
//Shape ChildElement adds Child Compartments to the parent.
shape ChildElement
{
if(HasProperty("stereotype", "part"))
{
SetCompartmentName("Parts");
}
else if(HasProperty("stereotype", "Attr"))
{
SetCompartmentName("Attr");
}
AppendCompartmentText("#NAME#");
}
===============================
I have created a stereotype "Attr" based on class and whenever I drag this onto the stereotype that has THIS shape script, nothing happens!
The "Attr" element sits smack in the middle of the parent element, but doesn't trigger the rendering of the custom compartment.
I'm assuming that the sample script is not wrong, so can only assume I need to do something different when specifying my stereotype or dragging onto the parent.
But, what?



??
Thanks in advance
Jays
