Skip to content

Commit

Permalink
Added option to display dotted lines for divorced spouses in tree dia…
Browse files Browse the repository at this point in the history
…grams (fix #537)
  • Loading branch information
Serg-Norseman committed Mar 29, 2024
1 parent 082bc73 commit 2270f51
Show file tree
Hide file tree
Showing 28 changed files with 67 additions and 12 deletions.
1 change: 1 addition & 0 deletions locales/Afrikaans.lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=RI:Recruit
952=Reverse order of places
953=Abbreviated location names
954=Dotted lines of divorced spouses
1 change: 1 addition & 0 deletions locales/Belarusian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=RI:Recruit
952=Reverse order of places
953=Abbreviated location names
954=Dotted lines of divorced spouses
1 change: 1 addition & 0 deletions locales/Chinese Simplified.lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=RI:Recruit
952=Reverse order of places
953=Abbreviated location names
954=Dotted lines of divorced spouses
1 change: 1 addition & 0 deletions locales/Dutch.lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=RI:Recruit
952=Reverse order of places
953=Abbreviated location names
954=Dotted lines of divorced spouses
1 change: 1 addition & 0 deletions locales/English.lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=RI:Recruit
952=Reverse order of places
953=Abbreviated location names
954=Dotted lines of divorced spouses
1 change: 1 addition & 0 deletions locales/Hungarian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=RI:Recruit
952=Reverse order of places
953=Abbreviated location names
954=Dotted lines of divorced spouses
1 change: 1 addition & 0 deletions locales/Icelandic.lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=RI:Recruit
952=Reverse order of places
953=Abbreviated location names
954=Dotted lines of divorced spouses
1 change: 1 addition & 0 deletions locales/Japanese.lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=RI:Recruit
952=Reverse order of places
953=Abbreviated location names
954=Dotted lines of divorced spouses
1 change: 1 addition & 0 deletions locales/Kazakh (Cyrillic).lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=RI:Recruit
952=Reverse order of places
953=Abbreviated location names
954=Dotted lines of divorced spouses
1 change: 1 addition & 0 deletions locales/Portuguese.lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=RI:Recruit
952=Reverse order of places
953=Abbreviated location names
954=Dotted lines of divorced spouses
1 change: 1 addition & 0 deletions locales/Serbian (Latin).lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=RI:Recruit
952=Reverse order of places
953=Abbreviated location names
954=Dotted lines of divorced spouses
1 change: 1 addition & 0 deletions locales/Spanish.lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=RI:Recruit
952=Reverse order of places
953=Abbreviated location names
954=Dotted lines of divorced spouses
1 change: 1 addition & 0 deletions locales/czech.lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=RI:Recruit
952=Reverse order of places
953=Abbreviated location names
954=Dotted lines of divorced spouses
1 change: 1 addition & 0 deletions locales/french.lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=RI:Recruit
952=Reverse order of places
953=Abbreviated location names
954=Dotted lines of divorced spouses
1 change: 1 addition & 0 deletions locales/german.lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=RI:Recruit
952=Reverse order of places
953=Abbreviated location names
954=Dotted lines of divorced spouses
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>02.03.2024 [v2.29.1 &amp; v3.5.1]</b><ul>
<li>Added option to display dotted lines for divorced spouses in tree diagrams.
<li>Added the option to generate extended places by full or abbreviated names.
<li>Added option for the reverse order of listing places in the ATD (by default, direct - from largest to smallest, reverse - from smallest to largest),
the option only affects the listing of places in events/facts (when using extended processing of places) and when displayed in diagrams trees.
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>02.03.2024 [v2.29.1 &amp; v3.5.1]</b><ul>
<li>Добавлена опция вывода пунктирных линий разведенных супругов в диаграммах деревьев.
<li>Добавлена опция формирования расширенных мест по полным или сокращенным названиям.
<li>Выведена опция обратного порядка перечисления мест в АТД (по умолчанию прямой - от большего к меньшему, обратный - от меньшего к большему),
опция действует только на перечисление мест в событиях/фактах (при использовании расширенной обработки мест) и при выводе в диаграммах деревьев.
Expand Down
1 change: 1 addition & 0 deletions locales/italian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=RI:Recruit
952=Reverse order of places
953=Abbreviated location names
954=Dotted lines of divorced spouses
1 change: 1 addition & 0 deletions locales/polish.lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=RI:Recruit
952=Reverse order of places
953=Abbreviated location names
954=Dotted lines of divorced spouses
1 change: 1 addition & 0 deletions locales/russian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=РИ:Рекрут
952=Обратный порядок мест (от меньш. к больш.)
953=Сокращенные названия мест
954=Пунктирные линии разведенных супругов
1 change: 1 addition & 0 deletions locales/ukrainian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,4 @@
951=RI:Recruit
952=Reverse order of places
953=Abbreviated location names
954=Dotted lines of divorced spouses
14 changes: 11 additions & 3 deletions projects/GKCore/GKCore/Charts/TreeChartModel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* "GEDKeeper", the personal genealogical database editor.
* Copyright (C) 2009-2023 by Sergey V. Zhdanovskih.
* Copyright (C) 2009-2024 by Sergey V. Zhdanovskih.
*
* This file is part of "GEDKeeper".
*
Expand Down Expand Up @@ -1931,9 +1931,13 @@ private void DrawDescendants(TreeChartPerson person, ChartDrawMode drawMode)
case GDMSex.svMale:
for (int i = 0; i < spousesCount; i++) {
TreeChartPerson spouse = person.GetSpouse(i);
bool divorced = fOptions.DottedLinesOfDivorcedSpouses && spouse.HasFlag(PersonFlag.pfDivorced);

var linePen = (!divorced) ? fLinePen : fDottedLinePen;
var decorativeLinePen = (!divorced) ? fDecorativeLinePen : fDottedDecorativeLinePen;

int spbV = spbBeg + spbOfs * i;
DrawLine(person.Rect.Right + 1, spbV, spouse.Rect.Left, spbV); // h
DrawLine(person.Rect.Right + 1, spbV, spouse.Rect.Left, spbV, linePen, decorativeLinePen); // h

if (!string.IsNullOrEmpty(spouse.MarriageDate)) {
int q = (!fOptions.InvertedTree) ? 4 : 3;
Expand All @@ -1945,9 +1949,13 @@ private void DrawDescendants(TreeChartPerson person, ChartDrawMode drawMode)
case GDMSex.svFemale:
for (int i = 0; i < spousesCount; i++) {
TreeChartPerson spouse = person.GetSpouse(i);
bool divorced = fOptions.DottedLinesOfDivorcedSpouses && spouse.HasFlag(PersonFlag.pfDivorced);

var linePen = (!divorced) ? fLinePen : fDottedLinePen;
var decorativeLinePen = (!divorced) ? fDecorativeLinePen : fDottedDecorativeLinePen;

int spbV = spbBeg + spbOfs * i;
DrawLine(spouse.Rect.Right + 1, spbV, person.Rect.Left, spbV); // h
DrawLine(spouse.Rect.Right + 1, spbV, person.Rect.Left, spbV, linePen, decorativeLinePen); // h

if (!string.IsNullOrEmpty(spouse.MarriageDate)) {
int q = (!fOptions.InvertedTree) ? 1 : 2;
Expand Down
3 changes: 3 additions & 0 deletions projects/GKCore/GKCore/Controllers/OptionsDlgController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ public void UpdateTreeChartsOptions()
GetControl<ICheckBox>("chkHideUnknownSpouses").Checked = fOptions.TreeChartOptions.HideUnknownSpouses;
GetControl<ICheckBox>("chkCheckTreeSize").Checked = fOptions.CheckTreeSize;
GetControl<ICheckBox>("chkDottedLinesOfAdoptedChildren").Checked = fOptions.TreeChartOptions.DottedLinesOfAdoptedChildren;
GetControl<ICheckBox>("chkDottedLinesOfDivorcedSpouses").Checked = fOptions.TreeChartOptions.DottedLinesOfDivorcedSpouses;
GetControl<ICheckBox>("chkSeparateDAPLines").Checked = fOptions.TreeChartOptions.SeparateDatesAndPlacesLines;
GetControl<ICheckBox>("chkOnlyLocality").Checked = fOptions.TreeChartOptions.OnlyLocality;
GetControl<ICheckBox>("chkBoldNames").Checked = fOptions.TreeChartOptions.BoldNames;
Expand Down Expand Up @@ -687,6 +688,7 @@ public void AcceptTreeChartsOptions()
fOptions.TreeChartOptions.HideUnknownSpouses = GetControl<ICheckBox>("chkHideUnknownSpouses").Checked;
fOptions.CheckTreeSize = GetControl<ICheckBox>("chkCheckTreeSize").Checked;
fOptions.TreeChartOptions.DottedLinesOfAdoptedChildren = GetControl<ICheckBox>("chkDottedLinesOfAdoptedChildren").Checked;
fOptions.TreeChartOptions.DottedLinesOfDivorcedSpouses = GetControl<ICheckBox>("chkDottedLinesOfDivorcedSpouses").Checked;
fOptions.TreeChartOptions.SeparateDatesAndPlacesLines = GetControl<ICheckBox>("chkSeparateDAPLines").Checked;
fOptions.TreeChartOptions.OnlyLocality = GetControl<ICheckBox>("chkOnlyLocality").Checked;
fOptions.TreeChartOptions.BoldNames = GetControl<ICheckBox>("chkBoldNames").Checked;
Expand Down Expand Up @@ -881,6 +883,7 @@ public override void SetLocale()
GetControl<ICheckBox>("chkHideUnknownSpouses").Text = LangMan.LS(LSID.HideUnknownSpouses);
GetControl<ICheckBox>("chkCheckTreeSize").Text = LangMan.LS(LSID.CheckTreeSize);
GetControl<ICheckBox>("chkDottedLinesOfAdoptedChildren").Text = LangMan.LS(LSID.DottedLinesOfAdoptedChildren);
GetControl<ICheckBox>("chkDottedLinesOfDivorcedSpouses").Text = LangMan.LS(LSID.DottedLinesOfDivorcedSpouses);
GetControl<ICheckBox>("chkBoldNames").Text = LangMan.LS(LSID.BoldNames);
GetControl<ICheckBox>("chkMinimizingWidth").Text = LangMan.LS(LSID.MinimizingWidth);
GetControl<ICheckBox>("chkShowAge").Text = LangMan.LS(LSID.ShowAge);
Expand Down
4 changes: 3 additions & 1 deletion projects/GKCore/GKCore/LangMan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1025,8 +1025,9 @@ public enum LSID
/* 951 */ RI_Recruit,
/* 952 */ ReversePlacesOrder,
/* 953 */ EL_AbbreviatedNames,
/* 954 */ DottedLinesOfDivorcedSpouses,

/* 000 */ Last = EL_AbbreviatedNames
/* 000 */ Last = DottedLinesOfDivorcedSpouses
}


Expand Down Expand Up @@ -2005,6 +2006,7 @@ public static class LangMan
/* 951 */ "RI:Recruit",
/* 952 */ "Reverse order of places",
/* 953 */ "Abbreviated location names",
/* 954 */ "Dotted lines of divorced spouses",
};

private static readonly LangManager fLangMan = new LangManager();
Expand Down
5 changes: 5 additions & 0 deletions projects/GKCore/GKCore/Options/TreeChartOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public sealed class TreeChartOptions : IOptions
public bool ShowPlaces;
public bool HideUnknownSpouses;
public bool DottedLinesOfAdoptedChildren;
public bool DottedLinesOfDivorcedSpouses;
public bool SeparateDatesAndPlacesLines;
public bool BoldNames;
public bool OnlyLocality;
Expand Down Expand Up @@ -133,6 +134,7 @@ public void ResetDefaults()
ShowPlaces = false;
HideUnknownSpouses = false;
DottedLinesOfAdoptedChildren = false;
DottedLinesOfDivorcedSpouses = false;
SeparateDatesAndPlacesLines = false;
BoldNames = false;
OnlyLocality = false;
Expand Down Expand Up @@ -207,6 +209,7 @@ public void Assign(IOptions source)
ShowPlaces = srcOptions.ShowPlaces;
HideUnknownSpouses = srcOptions.HideUnknownSpouses;
DottedLinesOfAdoptedChildren = srcOptions.DottedLinesOfAdoptedChildren;
DottedLinesOfDivorcedSpouses = srcOptions.DottedLinesOfDivorcedSpouses;
SeparateDatesAndPlacesLines = srcOptions.SeparateDatesAndPlacesLines;
BoldNames = srcOptions.BoldNames;
SeparateDepth = srcOptions.SeparateDepth;
Expand Down Expand Up @@ -258,6 +261,7 @@ public void LoadFromFile(IniFile iniFile)
ShowPlaces = iniFile.ReadBool("Chart", "ShowPlaces", false);
HideUnknownSpouses = iniFile.ReadBool("Chart", "HideUnknownSpouses", false);
DottedLinesOfAdoptedChildren = iniFile.ReadBool("Chart", "DottedLinesOfAdoptedChildren", false);
DottedLinesOfDivorcedSpouses = iniFile.ReadBool("Chart", "DottedLinesOfDivorcedSpouses", false);
SeparateDatesAndPlacesLines = iniFile.ReadBool("Chart", "SeparateDatesAndPlacesLines", false);
BoldNames = iniFile.ReadBool("Chart", "BoldNames", false);
BorderStyle = (GfxBorderStyle)iniFile.ReadInteger("Chart", "BorderStyle", 0);
Expand Down Expand Up @@ -324,6 +328,7 @@ public void SaveToFile(IniFile iniFile)
iniFile.WriteBool("Chart", "ShowPlaces", ShowPlaces);
iniFile.WriteBool("Chart", "HideUnknownSpouses", HideUnknownSpouses);
iniFile.WriteBool("Chart", "DottedLinesOfAdoptedChildren", DottedLinesOfAdoptedChildren);
iniFile.WriteBool("Chart", "DottedLinesOfDivorcedSpouses", DottedLinesOfDivorcedSpouses);
iniFile.WriteBool("Chart", "SeparateDatesAndPlacesLines", SeparateDatesAndPlacesLines);
iniFile.WriteBool("Chart", "BoldNames", BoldNames);
iniFile.WriteInteger("Chart", "BorderStyle", (int)BorderStyle);
Expand Down
30 changes: 22 additions & 8 deletions projects/GKv2/GEDKeeper2/GKUI/Forms/OptionsDlg.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions projects/GKv3/GEDKeeper3/GKUI/Forms/OptionsDlg.xeto
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
<CheckBox x:Name="chkHideUnknownSpouses" CheckedChanged="chkTreeChartOption_CheckedChanged" />
<CheckBox x:Name="chkCheckTreeSize" CheckedChanged="chkTreeChartOption_CheckedChanged" />
<CheckBox x:Name="chkDottedLinesOfAdoptedChildren" CheckedChanged="chkTreeChartOption_CheckedChanged" />
<CheckBox x:Name="chkDottedLinesOfDivorcedSpouses" CheckedChanged="chkTreeChartOption_CheckedChanged" />
<CheckBox x:Name="chkBoldNames" CheckedChanged="chkTreeChartOption_CheckedChanged" />
<CheckBox x:Name="chkMinimizingWidth" CheckedChanged="chkTreeChartOption_CheckedChanged" />
<CheckBox x:Name="chkURNotesVisible" CheckedChanged="chkTreeChartOption_CheckedChanged" />
Expand Down
Loading

0 comments on commit 2270f51

Please sign in to comment.