Skip to content

Commit

Permalink
Added an option to display the full name in one line in trees (fix #572)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serg-Norseman committed Jun 17, 2024
1 parent 0aa7b4a commit dbfb497
Show file tree
Hide file tree
Showing 30 changed files with 147 additions and 94 deletions.
2 changes: 1 addition & 1 deletion locales/Afrikaans.lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Description
967=For custom events and facts, the type must be entered
968=Event Definition
969=<?>
969=Full name on one line
970=<?>

971=Single
Expand Down
2 changes: 1 addition & 1 deletion locales/Belarusian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Description
967=For custom events and facts, the type must be entered
968=Event Definition
969=<?>
969=Full name on one line
970=<?>

971=Single
Expand Down
2 changes: 1 addition & 1 deletion locales/Chinese Simplified.lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Description
967=For custom events and facts, the type must be entered
968=Event Definition
969=<?>
969=Full name on one line
970=<?>

971=Single
Expand Down
2 changes: 1 addition & 1 deletion locales/Dutch.lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Description
967=For custom events and facts, the type must be entered
968=Event Definition
969=<?>
969=Full name on one line
970=<?>

971=Single
Expand Down
2 changes: 1 addition & 1 deletion locales/English.lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Description
967=For custom events and facts, the type must be entered
968=Event Definition
969=<?>
969=Full name on one line
970=<?>

971=Single ; tree border style
Expand Down
2 changes: 1 addition & 1 deletion locales/Hungarian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Description
967=For custom events and facts, the type must be entered
968=Event Definition
969=<?>
969=Full name on one line
970=<?>

971=Single
Expand Down
2 changes: 1 addition & 1 deletion locales/Icelandic.lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Description
967=For custom events and facts, the type must be entered
968=Event Definition
969=<?>
969=Full name on one line
970=<?>

971=Single
Expand Down
2 changes: 1 addition & 1 deletion locales/Japanese.lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Description
967=For custom events and facts, the type must be entered
968=Event Definition
969=<?>
969=Full name on one line
970=<?>

971=Single
Expand Down
2 changes: 1 addition & 1 deletion locales/Kazakh (Cyrillic).lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Description
967=For custom events and facts, the type must be entered
968=Event Definition
969=<?>
969=Full name on one line
970=<?>

971=Single
Expand Down
2 changes: 1 addition & 1 deletion locales/Portuguese.lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Description
967=For custom events and facts, the type must be entered
968=Event Definition
969=<?>
969=Full name on one line
970=<?>

971=Single
Expand Down
2 changes: 1 addition & 1 deletion locales/Serbian (Latin).lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Description
967=For custom events and facts, the type must be entered
968=Event Definition
969=<?>
969=Full name on one line
970=<?>

971=Single
Expand Down
2 changes: 1 addition & 1 deletion locales/Spanish.lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Description
967=For custom events and facts, the type must be entered
968=Event Definition
969=<?>
969=Full name on one line
970=<?>

971=Single
Expand Down
2 changes: 1 addition & 1 deletion locales/czech.lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Description
967=For custom events and facts, the type must be entered
968=Event Definition
969=<?>
969=Full name on one line
970=<?>

971=Single
Expand Down
2 changes: 1 addition & 1 deletion locales/french.lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Description
967=For custom events and facts, the type must be entered
968=Event Definition
969=<?>
969=Full name on one line
970=<?>

971=Single
Expand Down
2 changes: 1 addition & 1 deletion locales/german.lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Description
967=For custom events and facts, the type must be entered
968=Event Definition
969=<?>
969=Full name on one line
970=<?>

971=Single
Expand Down
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>14.06.2024 [v2.30.1 &amp; v3.6.1]</b><ul>
<li>Added an option to display the full name in one line in trees, for countries with a short form of the full name (hieroglyphs).
<li>Added custom event types, the feature to turn off events and add custom ones.
<li>Added localizable names for tree borders.
<li>Fixed an issue where blood group fact values would get stuck after use and when a different fact type was subsequently selected.
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>14.06.2024 [v2.30.1 &amp; v3.6.1]</b><ul>
<li>Добавлена опция вывода в деревьях полного имени в одну строку, для стран с короткой формой полного имени (иероглифы).
<li>Добавлены настраиваемые типы событий, возможность выключения событий и добавления пользовательских.
<li>Добавлены локализуемые названия границ деревьев.
<li>Исправлена ошибка застревания значений факта групп крови после использования и при последующем выборе другого типа факта.
Expand Down
2 changes: 1 addition & 1 deletion locales/italian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Description
967=For custom events and facts, the type must be entered
968=Event Definition
969=<?>
969=Full name on one line
970=<?>

971=Single
Expand Down
2 changes: 1 addition & 1 deletion locales/polish.lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Description
967=For custom events and facts, the type must be entered
968=Event Definition
969=<?>
969=Full name on one line
970=<?>

971=Single
Expand Down
2 changes: 1 addition & 1 deletion locales/russian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Описание
967=Для пользовательских событий и фактов необходимо ввести тип
968=Определение события
969=<?>
969=Полное имя в одну строку
970=<?>

971=Одинарная
Expand Down
2 changes: 1 addition & 1 deletion locales/ukrainian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
966=Description
967=For custom events and facts, the type must be entered
968=Event Definition
969=<?>
969=Full name on one line
970=<?>

971=Single
Expand Down
45 changes: 1 addition & 44 deletions projects/GKCore/GKCore/Charts/TreeChartModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -889,49 +889,6 @@ public void ToggleCollapse(TreeChartPerson person)
}
}

private int InitInfoSize()
{
int lines = 0;

if (fOptions.FamilyVisible) {
lines++;
}

if (!fOptions.DiffLines) {
lines++;
} else {
lines++;
lines++;
}

if (fOptions.OnlyYears && !fOptions.ShowPlaces) {
lines++;
} else {
if (fOptions.BirthDateVisible) {
lines++;
if (fOptions.SeparateDatesAndPlacesLines) {
lines++;
}
}
if (fOptions.DeathDateVisible) {
lines++;
if (fOptions.SeparateDatesAndPlacesLines) {
lines++;
}
}
}

if (fOptions.Kinship) {
lines++;
}

if (fOptions.URNotesVisible) {
lines++;
}

return lines;
}

private void Predef()
{
fPicScale = (fScale < 1.0f) ? fScale : 1.0f;
Expand Down Expand Up @@ -961,7 +918,7 @@ private void RecalcPersonBounds()
fGraph.SetTreeRoot(fKinRoot.Rec);
}

int lines = InitInfoSize();
int lines = TreeChartPerson.InitInfoSize(fOptions);

int maxWidth = 0;
int num = fPersons.Count;
Expand Down
121 changes: 92 additions & 29 deletions projects/GKCore/GKCore/Charts/TreeChartPerson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,53 @@ public void BuildBy(GDMIndividualRecord iRec)
}
}

internal static int InitInfoSize(TreeChartOptions options)
{
int lines = 0;

if (options.FullNameOnOneLine) {
lines += 3;
} else {
if (options.FamilyVisible) {
lines++;
}

if (!options.DiffLines) {
lines++;
} else {
lines++;
lines++;
}
}

if (options.OnlyYears && !options.ShowPlaces) {
lines++;
} else {
if (options.BirthDateVisible) {
lines++;
if (options.SeparateDatesAndPlacesLines) {
lines++;
}
}
if (options.DeathDateVisible) {
lines++;
if (options.SeparateDatesAndPlacesLines) {
lines++;
}
}
}

if (options.Kinship) {
lines++;
}

if (options.URNotesVisible) {
lines++;
}

return lines;
}

private void InitInfo(int lines)
{
Lines = new string[lines];
Expand All @@ -431,45 +478,61 @@ private void InitInfo(int lines)
// create lines
int idx = 0;

if (options.SurnameFirstInOrder) {
if (options.FamilyVisible) {
Lines[idx] = fSurname;
NameLines++;
idx++;
}

if (!options.DiffLines) {
Lines[idx] = nameLine + " " + fPatronymic; // attention: "Name" is combined property
if (options.FullNameOnOneLine) {
if (options.SurnameFirstInOrder) {
NameLines++;
idx++;
Lines[idx] = fSurname + " " + nameLine;
NameLines += 2;
idx += 2;
} else {
Lines[idx] = nameLine;
NameLines++;
idx++;

Lines[idx] = fPatronymic;
NameLines++;
idx++;
Lines[idx] = nameLine + " " + fSurname;
NameLines += 2;
idx += 2;
}
} else {
if (!options.DiffLines) {
Lines[idx] = nameLine + " " + fPatronymic; // attention: "Name" is combined property
NameLines++;
idx++;
if (options.SurnameFirstInOrder) {
if (options.FamilyVisible) {
Lines[idx] = fSurname;
NameLines++;
idx++;
}

if (!options.DiffLines) {
Lines[idx] = nameLine + " " + fPatronymic; // attention: "Name" is combined property
NameLines++;
idx++;
} else {
Lines[idx] = nameLine;
NameLines++;
idx++;

Lines[idx] = fPatronymic;
NameLines++;
idx++;
}
} else {
Lines[idx] = nameLine;
NameLines++;
idx++;
if (!options.DiffLines) {
Lines[idx] = nameLine + " " + fPatronymic; // attention: "Name" is combined property
NameLines++;
idx++;
} else {
Lines[idx] = nameLine;
NameLines++;
idx++;

Lines[idx] = fPatronymic;
NameLines++;
idx++;
}
Lines[idx] = fPatronymic;
NameLines++;
idx++;
}

if (options.FamilyVisible) {
Lines[idx] = fSurname;
NameLines++;
idx++;
if (options.FamilyVisible) {
Lines[idx] = fSurname;
NameLines++;
idx++;
}
}
}

Expand Down
Loading

0 comments on commit dbfb497

Please sign in to comment.