-- Roots style file
-- Saved by the Roots style editor

--*MA70B70H35T0C0W30I100S24O0FHomerton.Bold.Oblique
--*PW280H100
--*SRX0Y0W280H100T0O0EcM0
--*TIMX140Y70S12C16711680EsV1FTrinity.Medium:Tfullname
--*SLX140Y100W140H170T0O0eCM1
--*TALX64Y40S12C0exV1FTrinity.Medium:Tb.
--*TALX64Y15S12C0exV1FTrinity.Medium:Td.
--*TILX90Y40S12C0ExV1FTrinity.Medium:Tdate of birth
--*TILX90Y15S12C0ExV1FTrinity.Medium:Tdate of death
--*TILX230Y10S12C0exV2FTrinity.Medium:Tid
--*RW140H100
--*SLX0Y70W140H70T0O0EcM0
--*SLX0Y30W140H30T0O0EcM0
--*SLX70Y30W70H-70T0O0eCM1
--*TIMX70Y40S12C0exV1FTrinity.Medium:Tdate


gapheightabove=70;
gapheightbelow=70;
personwidth=280;
personheight=100;
gapwidth=35;
marriagewidth=140;
windowborder=30;
titleheight=100;

fontt0=ClaimFont("Homerton.Bold.Oblique",24);
fontp1=ClaimFont("Trinity.Medium",12);
fontp3=ClaimFont("Trinity.Medium",12);
fontp4=ClaimFont("Trinity.Medium",12);
fontp5=ClaimFont("Trinity.Medium",12);
fontp6=ClaimFont("Trinity.Medium",12);
fontp7=ClaimFont("Trinity.Medium",12);
fontm3=ClaimFont("Trinity.Medium",12);

function PersonChanged(person)
w=personwidth;
tx=GetTextDimensions(fontp1,GetField(person,"fullname"));
if tx+12>w then w=tx+12 end
tx=GetTextDimensions(fontp5,GetField(person,"date of birth"));
if tx+90+12>w then w=tx+90+12 end
tx=GetTextDimensions(fontp6,GetField(person,"date of death"));
if tx+90+12>w then w=tx+90+12 end
SetWidth(person,w);
end

function RedrawLine(x,y,width,height)
PlotLine(x,y,x+width,y+height,0,0);
end

function RedrawPerson(person,x,y,width,height)
m=width-personwidth;
mh=m/2;
PlotRectangle(x+0,y+0,280+m,100,0,0);
colour=16711680;
sex=GetField(person,"sex");if sex=="M" then colour=4278190080 end
if sex=="F" then colour=65280 end
text=GetField(person,"fullname");
tx=GetTextDimensions(fontp1,text);
PlotText(x+140+mh-tx/2,y+70,fontp1,4294967040,colour,text)
if GetParentsMarriage(person) then PlotLine(x+140+mh,y+100,x+140+mh,y+170,0,0); end
colour=0;
text="b.";
PlotText(x+64+mh,y+40,fontp3,4294967040,colour,text)
colour=0;
text="d.";
PlotText(x+64+mh,y+15,fontp4,4294967040,colour,text)
colour=0;
text=GetField(person,"date of birth");
PlotText(x+90+mh,y+40,fontp5,4294967040,colour,text)
colour=0;
text=GetField(person,"date of death");
PlotText(x+90+mh,y+15,fontp6,4294967040,colour,text)
colour=0;
text=GetField(person,"id");
PlotText(x+230+m,y+10,fontp7,4294967040,colour,text)
end

function RedrawMarriage(marriage,x,y,width,height)
m=width-marriagewidth;
mh=m/2;
PlotLine(x+0,y+70,x+140+m,y+70,0,0);
PlotLine(x+0,y+30,x+140+m,y+30,0,0);
if GetChild(marriage) then PlotLine(x+70+mh,y+30,x+70+mh,y+-70,0,0); end
colour=0;
text=GetField(marriage,"date");
tx=GetTextDimensions(fontm3,text);
PlotText(x+70+mh-tx/2,y+40,fontm3,4294967040,colour,text)
end

function RedrawTitle(title,x,y,width,height)
tx=GetTextDimensions(fontt0,title);
PlotText(x+(width-tx)/2,y+height/2,fontt0,4294967040,0,title);
end

