Skip to content

Commit

Permalink
Added display of person bookmarks in tree diagrams (fix #508)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serg-Norseman committed Oct 22, 2023
1 parent 252b2fb commit 3adc480
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 2 deletions.
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>28.10.2023 [v2.28.0 &amp; v3.4.0]</b><ul>
<li>Added display of person bookmarks in tree diagrams.
<li>Added localization into Dutch [Leo Krap].
<li>Added separate options for selecting the numbering of ascending and descending pedigrees.
<li>Added indistinct matching feature to record filtering.
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>28.10.2023 [v2.28.0 &amp; v3.4.0]</b><ul>
<li>Добавлено отображение закладок персон в диаграммах деревьев.
<li>Добавлена локализация на голландский язык [Leo Krap].
<li>Добавлены раздельные опции выбора нумерации восходящих и нисходящих родословных росписей.
<li>Добавлена функция нечеткого сопоставления для фильтрации записей.
Expand Down
1 change: 1 addition & 0 deletions projects/GKCore/GKCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@
<EmbeddedResource Include="Resources\btn_volume_mute.png" />
<EmbeddedResource Include="Resources\pnl_video.png" />
<EmbeddedResource Include="Resources\btn_info.gif" />
<EmbeddedResource Include="Resources\tg_bookmark.png" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
1 change: 1 addition & 0 deletions projects/GKCore/GKCore.nstd.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,6 @@
<EmbeddedResource Include="Resources\btn_volume_mute.png" />
<EmbeddedResource Include="Resources\pnl_video.png" />
<EmbeddedResource Include="Resources\btn_info.gif" />
<EmbeddedResource Include="Resources\tg_bookmark.png" />
</ItemGroup>
</Project>
10 changes: 9 additions & 1 deletion projects/GKCore/GKCore/Charts/TreeChartModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public class TreeChartModel : ChartModel
#else
private TreeChartDesk fDesk;
#endif
private IImage fBookmarkPic;
private IImage fExpPic;
private IImage fInfoPic;
private IImage fPersExpPic;
Expand Down Expand Up @@ -316,6 +317,7 @@ private void InitSigns(ChartRenderer renderer)
fExpPic = PrepareImage(renderer, "btn_expand.gif", true);
fPersExpPic = PrepareImage(renderer, "btn_expand2.gif", true);
fInfoPic = PrepareImage(renderer, "btn_info.gif", true);
fBookmarkPic = PrepareImage(renderer, "tg_bookmark.png", false);
} catch (Exception ex) {
Logger.WriteError("TreeChartModel.InitSigns()", ex);
}
Expand All @@ -339,6 +341,7 @@ public void Assign(TreeChartModel sourceModel)
fDottedLinePen = sourceModel.fDottedLinePen;
fDottedDecorativeLinePen = sourceModel.fDottedDecorativeLinePen;
fDrawFont = sourceModel.fDrawFont;
fBookmarkPic = sourceModel.fBookmarkPic;
fExpPic = sourceModel.fExpPic;
fPersExpPic = sourceModel.fPersExpPic;
fInfoPic = sourceModel.fInfoPic;
Expand Down Expand Up @@ -1806,10 +1809,15 @@ private void DrawPerson(TreeChartPerson person, ChartDrawMode drawMode)
fRenderer.DrawImage(fPersExpPic, expRt.Left, expRt.Top, string.Empty);
}

ExtRect infoRt = GetInfoRect(brt);

if (person.Selected) {
ExtRect infoRt = GetInfoRect(brt);
fRenderer.DrawImage(fInfoPic, infoRt.Left, infoRt.Top, string.Empty);
}

if (person.HasFlag(PersonFlag.pfBookmark)) {
fRenderer.DrawImage(fBookmarkPic, infoRt.Left - 16, infoRt.Top, string.Empty);
}
}
} catch (Exception ex) {
Logger.WriteError("TreeChartModel.DrawPerson()", ex);
Expand Down
4 changes: 3 additions & 1 deletion projects/GKCore/GKCore/Charts/TreeChartPerson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public enum PersonFlag
pfHasInvAnc, pfHasInvDesc, // invisible flags
pfSpecialMark, // debug flag for special goals
pfOutsideKin, pfCanExpand, pfAdopted,
pfRootSpouse
pfRootSpouse, pfBookmark
}

/// <summary>
Expand Down Expand Up @@ -375,6 +375,8 @@ public void BuildBy(GDMIndividualRecord iRec)
}
}

SetFlag(PersonFlag.pfBookmark, iRec.Bookmark);

CertaintyAssessment = GKUtils.GetCertaintyAssessment(iRec);
} else {
fSurname = "";
Expand Down
Binary file added projects/GKCore/Resources/tg_bookmark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3adc480

Please sign in to comment.