Thanks to Simon's suggestion I now have a shapescript that does exactly what I want it to do.
The left block stays the same width no matter how the element is resized
shape main
{
layouttype = "border";
h_align = "left";
v_align = "center";
DefSize(150,35);
Addsubshape("borderBlock","W");
SetFillColor(GetDefaultFillColor());
SetPenColor(GetDefaultFillColor());
AddSubShape("nameCompartment","CENTER");
shape borderBlock
{
layouttype = "leftright";
preferredWidth=35;
SetFillColor(GetStatusColor());
SetPenColor(GetUserBorderColor());
rectangle(0,0,100,100);
AddSubShape("S",40,80,10,10);
AddSubShape("R",40,80,12,10);
shape S
{
setpencolor(0,0,0);
SetPenWidth(2);
//left vertical line
moveto(2,68);
lineto(2,100);
//bottom arc
moveto(2,77);
arcto(5,58,96,97,5,80,83,64);
//diagonal
lineto(8,25);
//top arc
moveto(82,17);
arcto(5,3,82,34,82,17,10,33);
//right vertical
moveto(82,0);
lineto(82,31);
}
shape R
{
SetPenWidth(2);
setpencolor(0,0,0);
//left vertical
lineto(23,0);
lineto(23,100);
moveto(0,100);
lineto(44,100);
//right leg
moveto(100,100);
lineto(79,100);
lineto(44,50);
lineto(23,50);
moveto(44,50);
//belly
arcto(13,1,70,50,44,51,44,0);
lineto(23,0);
}
}
shape nameCompartment
{
h_align = "center";
v_align = "center";
editablefield = "name";
SetPenColor(GetUserBorderColor());
Rectangle(0,0,100,100);
SetFontColor(0,0,0);
println("#name#");
}
}
Geert