Hi All,
I've created a custom shape script for a Test Case and wish to have it decorated with enumeration types and tagged values. This I've been able to achieve, when viewing using "Next Shape" in the Shape Editor their displaying at the right size and position but my decorations are appearing roughly 1/50th of the size they should be and are in the top right corner of the main shape when rendered finally. I've been trying to create them as shapes and then using sub shape also but this wouldn't render the sub shapes on the screen at all.
Can anyone advise on how to solve this? Code below.
George.
/*
Shape script for drawing a Test Case spanner
George St. Clair
24/09/2010
*/
shape main
{
//Initialisation attributes - must be before drawing commands
preferredHeight = 100;
preferredWidth = 100;
h_align = "center";
v_align = "center";
layouttype="topdown";
endpointy = 50;
endpointx = 50;
setlinestyle( "solid");
//main shape drawing commands
moveto(0,40);
startpath();
lineto(5,25);
lineto(15,15);
lineto(30,15);
lineto(40,25);
lineto(45,35);
lineto(95,35);
lineto(100,40);
lineto(100,60);
lineto(95,65);
lineto(45,65);
lineto(40,75);
lineto(30,85);
lineto(15,85);
lineto(5,75);
lineto(0,60);
lineto(10,70);
lineto(20,70);
lineto(30,60);
lineto(30,40);
lineto(20,30);
lineto(10,30);
endpath();
//main shape colouration
setfillcolor ( 188, 186, 150); //titanium
setpencolor ( 122,122,122); //r, g, b
setpenwidth(1);
fillandstrokepath();
//name embelishments
printwrapped("#NAME#");
}
decoration RunStatus
{
preferredHeight = 100;
preferredWidth = 100;
noshadow = "true";
h_align = "center";
v_align = "center";
orientation="NE";
SetOrigin("NW",0,0);
fillandstrokepath();
setpencolor ( 122,122,122); //r, g, b
setpenwidth(1);
// if (HasTag("Run Status", "Passed"))
// {
moveto(55,35);
setfillcolor ( 114,255,9);
startpath();
lineto(65,35);
lineto(55,65);
lineto(45,65);
endpath();
fillandstrokepath();
// return;
// }
if (HasTag("Run Status", "Failed"))
{
setfillcolor ( 255, 9, 9);
moveto(55,35);
startpath();
lineto(65,35);
lineto(55,65);
lineto(45,65);
endpath();
fillandstrokepath();
return;
}
}
// 2 - Development Status
decoration DevelopmentStatus
{
preferredHeight = 100;
preferredWidth = 100;
noshadow = "true";
h_align = "center";
v_align = "center";
orientation="NE";
SetOrigin("NW",0,0);
//orientation = "NE";
setpencolor ( 122,122,122); //r, g, b
setpenwidth(1);
// if (HasTag("Development Status", "Not Started"))
// {
moveto(70,35);
setfillcolor ( 0,0,0);
startpath();
lineto(80,35);
lineto(70,65);
lineto(60,65);
endpath();
fillandstrokepath();
// return;
// }
if (HasTag("Development Status", "In Development"))
{
setfillcolor ( 255,255,0);
moveto(70,35);
startpath();
lineto(80,35);
lineto(70,65);
lineto(60,65);
endpath();
fillandstrokepath();
return;
}
if (HasTag("Development Status", "For Review"))
{
setfillcolor ( 255,138,9);
moveto(70,35);
startpath();
lineto(80,35);
lineto(70,65);
lineto(60,65);
endpath();
fillandstrokepath();
return;
}
if (HasTag("Development Status", "Ready To Run"))
{
setfillcolor ( 114,255,9);
moveto(70,35);
startpath();
lineto(80,35);
lineto(70,65);
lineto(60,65);
endpath();
fillandstrokepath();
return;
}
if (HasTag("Development Status", "Blocked"))
{
setfillcolor ( 255,9,9);
moveto(70,35);
startpath();
lineto(80,35);
lineto(70,65);
lineto(60,65);
endpath();
fillandstrokepath();
return;
}
}
// 3 - Regression tag
decoration RegressionTag
{
preferredHeight = 100;
preferredWidth = 100;
noshadow = "true";
h_align = "center";
v_align = "center";
orientation="NE";
SetOrigin("NW",0,0);
setpencolor ( 122,122,122); //r, g, b
setpenwidth(1);
//orientation = "NE";
// if (HasTag("IsRegression", "true"))
// {
moveto(80,35);
setfillcolor(128,0,64);
startpath();
lineto(90,35);
lineto(95,40);
lineto(95,45);
lineto(90,50);
lineto(95,65);
lineto(90,65);
lineto(85,55);
lineto(85,65);
lineto(80,65);
lineto(80,35);
endpath();
fillandstrokepath();
//part 2
moveto(85,40);
setfillcolor( 188, 186, 150);
startpath();
lineto(89,40);
lineto(89,45);
lineto(85,45);
endpath();
fillandstrokepath();
// return;
// }
}