Skip to content

Commit

Permalink
Added options in tree diagrams: text paddings, date designations and …
Browse files Browse the repository at this point in the history
…mourning edges (fix #604)
  • Loading branch information
Serg-Norseman committed Nov 21, 2024
1 parent 4c4b2a8 commit 75145ee
Show file tree
Hide file tree
Showing 30 changed files with 240 additions and 93 deletions.
3 changes: 3 additions & 0 deletions locales/Afrikaans.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Sunken
1006=Raised
1007=Glow
1008=Padding of text
1009=Date designations
1010=Mourning edges
3 changes: 3 additions & 0 deletions locales/Belarusian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Sunken
1006=Raised
1007=Glow
1008=Padding of text
1009=Date designations
1010=Mourning edges
3 changes: 3 additions & 0 deletions locales/Chinese Simplified.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Sunken
1006=Raised
1007=Glow
1008=Padding of text
1009=Date designations
1010=Mourning edges
3 changes: 3 additions & 0 deletions locales/Czech.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Sunken
1006=Raised
1007=Glow
1008=Padding of text
1009=Date designations
1010=Mourning edges
3 changes: 3 additions & 0 deletions locales/Dutch.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Sunken
1006=Raised
1007=Glow
1008=Padding of text
1009=Date designations
1010=Mourning edges
3 changes: 3 additions & 0 deletions locales/English.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Sunken
1006=Raised
1007=Glow
1008=Padding of text
1009=Date designations
1010=Mourning edges
3 changes: 3 additions & 0 deletions locales/French.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Sunken
1006=Raised
1007=Glow
1008=Padding of text
1009=Date designations
1010=Mourning edges
3 changes: 3 additions & 0 deletions locales/German.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Sunken
1006=Raised
1007=Glow
1008=Padding of text
1009=Date designations
1010=Mourning edges
3 changes: 3 additions & 0 deletions locales/Hungarian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Sunken
1006=Raised
1007=Glow
1008=Padding of text
1009=Date designations
1010=Mourning edges
3 changes: 3 additions & 0 deletions locales/Icelandic.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Sunken
1006=Raised
1007=Glow
1008=Padding of text
1009=Date designations
1010=Mourning edges
3 changes: 3 additions & 0 deletions locales/Italian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Sunken
1006=Raised
1007=Glow
1008=Padding of text
1009=Date designations
1010=Mourning edges
3 changes: 3 additions & 0 deletions locales/Japanese.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Sunken
1006=Raised
1007=Glow
1008=Padding of text
1009=Date designations
1010=Mourning edges
3 changes: 3 additions & 0 deletions locales/Kazakh (Cyrillic).lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Sunken
1006=Raised
1007=Glow
1008=Padding of text
1009=Date designations
1010=Mourning edges
3 changes: 3 additions & 0 deletions locales/Polish.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Sunken
1006=Raised
1007=Glow
1008=Padding of text
1009=Date designations
1010=Mourning edges
3 changes: 3 additions & 0 deletions locales/Portuguese.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Sunken
1006=Raised
1007=Glow
1008=Padding of text
1009=Date designations
1010=Mourning edges
3 changes: 3 additions & 0 deletions locales/Russian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Утопленный
1006=Приподнятый
1007=Светящийся
1008=Отступ текста
1009=Обозначения дат
1010=Траурные края
3 changes: 3 additions & 0 deletions locales/Serbian (Latin).lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Sunken
1006=Raised
1007=Glow
1008=Padding of text
1009=Date designations
1010=Mourning edges
3 changes: 3 additions & 0 deletions locales/Spanish.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Sunken
1006=Raised
1007=Glow
1008=Padding of text
1009=Date designations
1010=Mourning edges
3 changes: 3 additions & 0 deletions locales/Ukrainian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1018,3 +1018,6 @@
1005=Sunken
1006=Raised
1007=Glow
1008=Padding of text
1009=Date designations
1010=Mourning edges
1 change: 1 addition & 0 deletions locales/help_enu/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1>Change log</h1>

<p>
<b>??.??.2024 [v2.32.0 &amp; v3.8.0]</b><ul>
<li>Added options in tree diagrams: text paddings, date designations and mourning edges.
<li>Added text effect options in tree diagrams (GKv2 only).
<li>Added an option to disable the search for places without coordinates in geocoders (general maps).
<li>Added the feature to display on maps all subordinate locations and persons of the selected hierarchy of locations.
Expand Down
1 change: 1 addition & 0 deletions locales/help_rus/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1>История версий</h1>

<p>
<b>??.??.2024 [v2.32.0 &amp; v3.8.0]</b><ul>
<li>Добавлены опции в диаграммах деревьев: отступа текста, обозначений дат и траурных рамок.
<li>Добавлены опции эффектов текста в диаграммах деревьев (только GKv2).
<li>Добавлена опция выключения поиска мест без координат в геокодерах (общие карты).
<li>Добавлена возможность выводить на карты все подчиненные места и персоны выбранной иерархии мест.
Expand Down
4 changes: 2 additions & 2 deletions projects/GKCore/GKCore/Charts/TreeChartModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ private void Predef()
fBranchDistance = (int)Math.Round(fOptions.BranchDistance * fScale);
fLevelDistance = (int)Math.Round(fOptions.LevelDistance * fScale);
fMargins = (int)Math.Round(fOptions.Margins * fScale);
fNodePadding = (int)(DEF_PERSON_NODE_PADDING * fScale);
fNodePadding = (int)(fOptions.Padding * fScale);
fSpouseDistance = (int)Math.Round(fOptions.SpouseDistance * fScale);
}

Expand Down Expand Up @@ -1803,7 +1803,7 @@ private void DrawPerson(TreeChartPerson person, ChartDrawMode drawMode, bool isS

prt.Offset(fOffsetX, fOffsetY);

if (person.HasFlag(PersonFlag.pfIsDead)) {
if (person.HasFlag(PersonFlag.pfIsDead) && fOptions.MourningEdges) {
ExtRect dt = prt.GetOffset(-2, -2);
DrawBorder(null, dt, true, person);
}
Expand Down
11 changes: 7 additions & 4 deletions projects/GKCore/GKCore/Charts/TreeChartPerson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,10 @@ public void BuildBy(GDMIndividualRecord iRec)
fAge = "";
}

if (!string.IsNullOrEmpty(fBirthDate)) {
if (!string.IsNullOrEmpty(fBirthDate) && options.DateDesignations) {
fBirthDate = ImportUtils.STD_BIRTH_SIGN + " " + fBirthDate;
}
if (!string.IsNullOrEmpty(fDeathDate)) {
if (!string.IsNullOrEmpty(fDeathDate) && options.DateDesignations) {
fDeathDate = ImportUtils.STD_DEATH_SIGN + " " + fDeathDate;
}

Expand Down Expand Up @@ -573,15 +573,18 @@ private void InitInfo(int lines)
}

if (options.OnlyYears && !options.ShowPlaces) {
string lifeYears = "[ ";
string lifeYears = string.Empty;
if (options.DateDesignations) lifeYears = "[ ";

lifeYears += (fBirthDate == "") ? "?" : fBirthDate;
if (HasFlag(PersonFlag.pfIsDead)) {
lifeYears += (fDeathDate == "") ? " - ?" : " - " + fDeathDate;
}
if (!string.IsNullOrEmpty(fAge)) {
lifeYears += string.Concat(" (", fAge, ")");
}
lifeYears += " ]";

if (options.DateDesignations) lifeYears += " ]";

Lines[idx] = lifeYears;
idx++;
Expand Down
9 changes: 9 additions & 0 deletions projects/GKCore/GKCore/Controllers/OptionsDlgController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,8 @@ public void UpdateTreeChartsOptions()
GetControl<ICheckBox>("chkShortenDateRanges").Checked = fOptions.TreeChartOptions.ShortenDateRanges;
GetControl<ICheckBox>("chkSameCardsWidth").Checked = fOptions.TreeChartOptions.SameCardsWidth;
GetControl<ICheckBox>("chkFullNameOnOneLine").Checked = fOptions.TreeChartOptions.FullNameOnOneLine;
GetControl<ICheckBox>("chkDateDesignations").Checked = fOptions.TreeChartOptions.DateDesignations;
GetControl<ICheckBox>("chkMourningEdges").Checked = fOptions.TreeChartOptions.MourningEdges;

GetControl<ILabel>("lblMaleColor").BackColor = fOptions.TreeChartOptions.MaleColor;
GetControl<ILabel>("lblFemaleColor").BackColor = fOptions.TreeChartOptions.FemaleColor;
Expand All @@ -670,6 +672,7 @@ public void UpdateTreeChartsOptions()
GetControl<INumericBox>("numBranchDist").Value = fOptions.TreeChartOptions.BranchDistance;
GetControl<INumericBox>("numGenDist").Value = fOptions.TreeChartOptions.LevelDistance;
GetControl<INumericBox>("numSpouseDist").Value = fOptions.TreeChartOptions.SpouseDistance;
GetControl<INumericBox>("numPadding").Value = fOptions.TreeChartOptions.Padding;

GetControl<ICheckBox>("chkSeparateDepth").Checked = fOptions.TreeChartOptions.SeparateDepth;

Expand Down Expand Up @@ -763,6 +766,8 @@ public void AcceptTreeChartsOptions()
fOptions.TreeChartOptions.ShortenDateRanges = GetControl<ICheckBox>("chkShortenDateRanges").Checked;
fOptions.TreeChartOptions.SameCardsWidth = GetControl<ICheckBox>("chkSameCardsWidth").Checked;
fOptions.TreeChartOptions.FullNameOnOneLine = GetControl<ICheckBox>("chkFullNameOnOneLine").Checked;
fOptions.TreeChartOptions.DateDesignations = GetControl<ICheckBox>("chkDateDesignations").Checked;
fOptions.TreeChartOptions.MourningEdges = GetControl<ICheckBox>("chkMourningEdges").Checked;

fOptions.TreeChartOptions.MaleColor = GetControl<ILabel>("lblMaleColor").BackColor;
fOptions.TreeChartOptions.FemaleColor = GetControl<ILabel>("lblFemaleColor").BackColor;
Expand All @@ -774,6 +779,7 @@ public void AcceptTreeChartsOptions()
fOptions.TreeChartOptions.BranchDistance = (int)GetControl<INumericBox>("numBranchDist").Value;
fOptions.TreeChartOptions.LevelDistance = (int)GetControl<INumericBox>("numGenDist").Value;
fOptions.TreeChartOptions.SpouseDistance = (int)GetControl<INumericBox>("numSpouseDist").Value;
fOptions.TreeChartOptions.Padding = (int)GetControl<INumericBox>("numPadding").Value;

fOptions.TreeChartOptions.SeparateDepth = GetControl<ICheckBox>("chkSeparateDepth").Checked;
fOptions.TreeChartOptions.DepthLimit = (int)GetControl<INumericBox>("numDefaultDepth").Value;
Expand Down Expand Up @@ -964,6 +970,8 @@ public override void SetLocale()
GetControl<ICheckBox>("chkShortenDateRanges").Text = LangMan.LS(LSID.ShortenDateRanges);
GetControl<ICheckBox>("chkSameCardsWidth").Text = LangMan.LS(LSID.SameCardsWidth);
GetControl<ICheckBox>("chkFullNameOnOneLine").Text = LangMan.LS(LSID.FullNameOnOneLine);
GetControl<ICheckBox>("chkDateDesignations").Text = LangMan.LS(LSID.DateDesignations);
GetControl<ICheckBox>("chkMourningEdges").Text = LangMan.LS(LSID.MourningEdges);

GetControl<ILabel>("lblMaleColor").Text = LangMan.LS(LSID.Man);
GetControl<ILabel>("lblFemaleColor").Text = LangMan.LS(LSID.Woman);
Expand All @@ -979,6 +987,7 @@ public override void SetLocale()
GetControl<ILabel>("lblBranchDist").Text = LangMan.LS(LSID.BranchDist);
GetControl<ILabel>("lblGenDist").Text = LangMan.LS(LSID.GenDist);
GetControl<ILabel>("lblSpouseDist").Text = LangMan.LS(LSID.SpouseDist);
GetControl<ILabel>("lblPadding").Text = LangMan.LS(LSID.Padding);

GetControl<ICheckBox>("chkSeparateDepth").Text = LangMan.LS(LSID.SeparateDepth);
GetControl<ILabel>("lblDefaultDepth").Text = LangMan.LS(LSID.DefaultDepth);
Expand Down
8 changes: 7 additions & 1 deletion projects/GKCore/GKCore/LangMan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1082,8 +1082,11 @@ public enum LSID
/* 1005 */ TE_Sunken,
/* 1006 */ TE_Raised,
/* 1007 */ TE_Glow,
/* 1008 */ Padding,
/* 1009 */ DateDesignations,
/* 1010 */ MourningEdges,

/* 000 */ Last = TE_Glow
/* 000 */ Last = MourningEdges
}


Expand Down Expand Up @@ -2119,6 +2122,9 @@ public static class LangMan
/* 1005 */ "Sunken",
/* 1006 */ "Raised",
/* 1007 */ "Glow",
/* 1008 */ "Padding of text",
/* 1009 */ "Date designations",
/* 1010 */ "Mourning edges",
};

private static readonly LangManager fLangMan = new LangManager();
Expand Down
15 changes: 15 additions & 0 deletions projects/GKCore/GKCore/Options/TreeChartOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public sealed class TreeChartOptions : IOptions
public bool TrackMatchedSources;
public bool FullNameOnOneLine;
public bool ParentAges;
public bool DateDesignations;
public bool MourningEdges;

public IColor MaleColor;
public IColor FemaleColor;
Expand All @@ -97,6 +99,7 @@ public sealed class TreeChartOptions : IOptions
public int LevelDistance;
public int Margins;
public int SpouseDistance;
public int Padding;

public bool SeparateDepth { get; set; }
public int DepthLimit { get; set; }
Expand Down Expand Up @@ -171,6 +174,7 @@ public void ResetDefaults()
LevelDistance = TreeChartModel.DEF_LEVEL_DISTANCE;
Margins = TreeChartModel.DEF_MARGINS;
SpouseDistance = TreeChartModel.DEF_SPOUSE_DISTANCE;
Padding = TreeChartModel.DEF_PERSON_NODE_PADDING;

SeparateDepth = false;
DepthLimit = -1;
Expand All @@ -181,6 +185,8 @@ public void ResetDefaults()
UseInlineImagesInSvg = true;
ExtendedTree = false;
ParentAges = false;
DateDesignations = true;
MourningEdges = true;
}

public void Assign(IOptions source)
Expand Down Expand Up @@ -244,11 +250,14 @@ public void Assign(IOptions source)
LevelDistance = srcOptions.LevelDistance;
Margins = srcOptions.Margins;
SpouseDistance = srcOptions.SpouseDistance;
Padding = srcOptions.Padding;

UseExtraControls = srcOptions.UseExtraControls;
UseInlineImagesInSvg = srcOptions.UseInlineImagesInSvg;
ExtendedTree = srcOptions.ExtendedTree;
ParentAges = srcOptions.ParentAges;
DateDesignations = srcOptions.DateDesignations;
MourningEdges = srcOptions.MourningEdges;
}

public void LoadFromFile(IniFile iniFile)
Expand Down Expand Up @@ -307,6 +316,7 @@ public void LoadFromFile(IniFile iniFile)
LevelDistance = iniFile.ReadInteger("Chart", "LevelDistance", TreeChartModel.DEF_LEVEL_DISTANCE);
Margins = iniFile.ReadInteger("Chart", "Margins", TreeChartModel.DEF_MARGINS);
SpouseDistance = iniFile.ReadInteger("Chart", "SpouseDistance", TreeChartModel.DEF_SPOUSE_DISTANCE);
Padding = iniFile.ReadInteger("Chart", "Padding", TreeChartModel.DEF_PERSON_NODE_PADDING);

SeparateDepth = iniFile.ReadBool("Chart", "SeparateDepth", false);
DepthLimit = iniFile.ReadInteger("Chart", "DepthLimit", -1);
Expand All @@ -322,6 +332,8 @@ public void LoadFromFile(IniFile iniFile)
FullNameOnOneLine = iniFile.ReadBool("Chart", "FullNameOnOneLine", false);

ParentAges = iniFile.ReadBool("Chart", "ParentAges", false);
DateDesignations = iniFile.ReadBool("Chart", "DateDesignations", true);
MourningEdges = iniFile.ReadBool("Chart", "MourningEdges", true);
}

public void SaveToFile(IniFile iniFile)
Expand Down Expand Up @@ -380,6 +392,7 @@ public void SaveToFile(IniFile iniFile)
iniFile.WriteInteger("Chart", "LevelDistance", LevelDistance);
iniFile.WriteInteger("Chart", "Margins", Margins);
iniFile.WriteInteger("Chart", "SpouseDistance", SpouseDistance);
iniFile.WriteInteger("Chart", "Padding", Padding);

iniFile.WriteBool("Chart", "SeparateDepth", SeparateDepth);
iniFile.WriteInteger("Chart", "DepthLimit", DepthLimit);
Expand All @@ -395,6 +408,8 @@ public void SaveToFile(IniFile iniFile)
iniFile.WriteBool("Chart", "FullNameOnOneLine", FullNameOnOneLine);

iniFile.WriteBool("Chart", "ParentAges", ParentAges);
iniFile.WriteBool("Chart", "DateDesignations", DateDesignations);
iniFile.WriteBool("Chart", "MourningEdges", MourningEdges);
}
}
}
14 changes: 7 additions & 7 deletions projects/GKv2/GEDKeeper2.sln
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,22 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "locales", "locales", "{4AF8
..\..\locales\Afrikaans.lng = ..\..\locales\Afrikaans.lng
..\..\locales\Belarusian.lng = ..\..\locales\Belarusian.lng
..\..\locales\Chinese Simplified.lng = ..\..\locales\Chinese Simplified.lng
..\..\locales\czech.lng = ..\..\locales\czech.lng
..\..\locales\Czech.lng = ..\..\locales\Czech.lng
..\..\locales\Dutch.lng = ..\..\locales\Dutch.lng
..\..\locales\English.lng = ..\..\locales\English.lng
..\..\locales\french.lng = ..\..\locales\french.lng
..\..\locales\german.lng = ..\..\locales\german.lng
..\..\locales\French.lng = ..\..\locales\French.lng
..\..\locales\German.lng = ..\..\locales\German.lng
..\..\locales\Hungarian.lng = ..\..\locales\Hungarian.lng
..\..\locales\Icelandic.lng = ..\..\locales\Icelandic.lng
..\..\locales\italian.lng = ..\..\locales\italian.lng
..\..\locales\Italian.lng = ..\..\locales\Italian.lng
..\..\locales\Japanese.lng = ..\..\locales\Japanese.lng
..\..\locales\Kazakh (Cyrillic).lng = ..\..\locales\Kazakh (Cyrillic).lng
..\..\locales\polish.lng = ..\..\locales\polish.lng
..\..\locales\Polish.lng = ..\..\locales\Polish.lng
..\..\locales\Portuguese.lng = ..\..\locales\Portuguese.lng
..\..\locales\russian.lng = ..\..\locales\russian.lng
..\..\locales\Russian.lng = ..\..\locales\Russian.lng
..\..\locales\Serbian (Latin).lng = ..\..\locales\Serbian (Latin).lng
..\..\locales\Spanish.lng = ..\..\locales\Spanish.lng
..\..\locales\ukrainian.lng = ..\..\locales\ukrainian.lng
..\..\locales\Ukrainian.lng = ..\..\locales\Ukrainian.lng
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "subprojects", "subprojects", "{BBA8D997-B7FB-45FE-86A2-08C01C0AAB4C}"
Expand Down
Loading

0 comments on commit 75145ee

Please sign in to comment.