Skip to content

Commit

Permalink
Added a button to the location editing dialog for taking coordinates …
Browse files Browse the repository at this point in the history
…from the cursor on the map
  • Loading branch information
Serg-Norseman committed Dec 3, 2024
1 parent f7ac2d0 commit f37cedf
Show file tree
Hide file tree
Showing 29 changed files with 72 additions and 11 deletions.
1 change: 1 addition & 0 deletions locales/Afrikaans.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Date designations
1010=Mourning edges
1011=Use additional dates
1012=Cursor coordinates
1 change: 1 addition & 0 deletions locales/Belarusian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Date designations
1010=Mourning edges
1011=Use additional dates
1012=Cursor coordinates
1 change: 1 addition & 0 deletions locales/Chinese Simplified.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Date designations
1010=Mourning edges
1011=Use additional dates
1012=Cursor coordinates
1 change: 1 addition & 0 deletions locales/Czech.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Date designations
1010=Mourning edges
1011=Use additional dates
1012=Cursor coordinates
1 change: 1 addition & 0 deletions locales/Dutch.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Date designations
1010=Mourning edges
1011=Use additional dates
1012=Cursor coordinates
1 change: 1 addition & 0 deletions locales/English.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Date designations
1010=Mourning edges
1011=Use additional dates
1012=Cursor coordinates
1 change: 1 addition & 0 deletions locales/French.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Date designations
1010=Mourning edges
1011=Use additional dates
1012=Cursor coordinates
1 change: 1 addition & 0 deletions locales/German.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Date designations
1010=Mourning edges
1011=Use additional dates
1012=Cursor coordinates
1 change: 1 addition & 0 deletions locales/Hungarian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Date designations
1010=Mourning edges
1011=Use additional dates
1012=Cursor coordinates
1 change: 1 addition & 0 deletions locales/Icelandic.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Date designations
1010=Mourning edges
1011=Use additional dates
1012=Cursor coordinates
1 change: 1 addition & 0 deletions locales/Italian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Date designations
1010=Mourning edges
1011=Use additional dates
1012=Cursor coordinates
1 change: 1 addition & 0 deletions locales/Japanese.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Date designations
1010=Mourning edges
1011=Use additional dates
1012=Cursor coordinates
1 change: 1 addition & 0 deletions locales/Kazakh (Cyrillic).lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Date designations
1010=Mourning edges
1011=Use additional dates
1012=Cursor coordinates
1 change: 1 addition & 0 deletions locales/Polish.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Date designations
1010=Mourning edges
1011=Use additional dates
1012=Cursor coordinates
1 change: 1 addition & 0 deletions locales/Portuguese.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Date designations
1010=Mourning edges
1011=Use additional dates
1012=Cursor coordinates
1 change: 1 addition & 0 deletions locales/Russian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Обозначения дат
1010=Траурные края
1011=Использовать дополнительные даты
1012=Коорд. курсора
1 change: 1 addition & 0 deletions locales/Serbian (Latin).lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Date designations
1010=Mourning edges
1011=Use additional dates
1012=Cursor coordinates
1 change: 1 addition & 0 deletions locales/Spanish.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Date designations
1010=Mourning edges
1011=Use additional dates
1012=Cursor coordinates
1 change: 1 addition & 0 deletions locales/Ukrainian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,4 @@
1009=Date designations
1010=Mourning edges
1011=Use additional dates
1012=Cursor coordinates
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.12.2024 [v2.32.0 &amp; v3.8.0]</b><ul>
<li>Added a button to the location editing dialog for taking coordinates from the cursor on the map.
<li>Added protection for empty records (individual, notes and multimedia) in files from other programs.
<li>Added option in tree diagrams - use additional dates (baptism, burial) if the main ones (births, deaths) are missing.
<li>Added options in tree diagrams: text paddings, date designations and mourning edges.
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.12.2024 [v2.32.0 &amp; v3.8.0]</b><ul>
<li>Добавлена кнопка в диалог редактирования локаций для взятия координат по курсору на карте.
<li>Добавлена защита пустых записей (персональных, заметок и мультимедиа) в файлах из сторонних программ.
<li>Добавлена опция в диаграммах деревьев - использовать дополнительные даты (крещения и похорон), если отсутствуют основные (рождения, смерти).
<li>Добавлены опции в диаграммах деревьев: отступа текста, обозначений дат и траурных рамок.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,14 @@ public void SelectGeoPoint()
fView.MapBrowser.SetCenter(pt.Latitude, pt.Longitude, -1);
}

public void SelectCursorCoords()
{
var pos = fView.MapBrowser.TargetPosition;

fView.Latitude.Text = GEDCOMUtils.CoordToStr(pos.Lat);
fView.Longitude.Text = GEDCOMUtils.CoordToStr(pos.Lng);
}

public void ShowOnMap()
{
if (fView.Latitude.Text != "" && fView.Longitude.Text != "") {
Expand All @@ -222,6 +230,7 @@ public override void SetLocale()
GetControl<IButton>("btnSearch").Text = LangMan.LS(LSID.Search);
GetControl<IButton>("btnSelect").Text = LangMan.LS(LSID.SelectCoords);
GetControl<IButton>("btnSelectName").Text = LangMan.LS(LSID.SelectName);
GetControl<IButton>("btnSelectCursor").Text = LangMan.LS(LSID.CursorCoords);

SetToolTip("btnShowOnMap", LangMan.LS(LSID.ShowOnMapTip));

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 @@ -1086,8 +1086,9 @@ public enum LSID
/* 1009 */ DateDesignations,
/* 1010 */ MourningEdges,
/* 1011 */ UseAdditionalDates,
/* 1012 */ CursorCoords,

/* 000 */ Last = UseAdditionalDates
/* 000 */ Last = CursorCoords
}


Expand Down Expand Up @@ -2127,6 +2128,7 @@ public static class LangMan
/* 1009 */ "Date designations",
/* 1010 */ "Mourning edges",
/* 1011 */ "Use additional dates",
/* 1012 */ "Cursor coordinates",
};

private static readonly LangManager fLangMan = new LangManager();
Expand Down
32 changes: 22 additions & 10 deletions projects/GKv2/GEDKeeper2/GKUI/Forms/LocationEditDlg.Designer.cs

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

5 changes: 5 additions & 0 deletions projects/GKv2/GEDKeeper2/GKUI/Forms/LocationEditDlg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ private void btnSelectName_Click(object sender, EventArgs e)
fController.SelectName();
}

private void btnSelectCursor_Click(object sender, EventArgs e)
{
fController.SelectCursorCoords();
}

private void ListGeoCoords_Click(object sender, EventArgs e)
{
fController.SelectGeoPoint();
Expand Down
5 changes: 5 additions & 0 deletions projects/GKv3/GEDKeeper3/GKUI/Forms/LocationEditDlg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ private void btnSelectName_Click(object sender, EventArgs e)
fController.SelectName();
}

private void btnSelectCursor_Click(object sender, EventArgs e)
{
fController.SelectCursorCoords();
}

private void ListGeoCoords_Click(object sender, EventArgs e)
{
fController.SelectGeoPoint();
Expand Down
1 change: 1 addition & 0 deletions projects/GKv3/GEDKeeper3/GKUI/Forms/LocationEditDlg.xeto
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<Button x:Name="btnSearch" Style="funcBtn" Click="btnSearch_Click" />
<Button x:Name="btnSelect" Style="funcBtn" Click="btnSelect_Click" />
<Button x:Name="btnSelectName" Style="funcBtn" Click="btnSelectName_Click" />
<Button x:Name="btnSelectCursor" Style="funcBtn" Click="btnSelectCursor_Click" />
<Button x:Name="btnShowOnMap" Style="funcBtn" Click="btnShowOnMap_Click" />
</StackLayout>
</TableRow>
Expand Down
1 change: 1 addition & 0 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/LocationEditDlg.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<Button x:Name="btnSearch" Style="{StaticResource funcBtn}" Clicked="btnSearch_Click" />
<Button x:Name="btnSelect" Style="{StaticResource funcBtn}" Clicked="btnSelect_Click" />
<Button x:Name="btnSelectName" Style="{StaticResource funcBtn}" Clicked="btnSelectName_Click" />
<Button x:Name="btnSelectCursor" Style="{StaticResource funcBtn}" Clicked="btnSelectCursor_Click" />
<Button x:Name="btnShowOnMap" Style="{StaticResource funcBtn}" Clicked="btnShowOnMap_Click" />
</StackLayout>
</StackLayout>
Expand Down
5 changes: 5 additions & 0 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/LocationEditDlg.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ private void btnSelectName_Click(object sender, EventArgs e)
fController.SelectName();
}

private void btnSelectCursor_Click(object sender, EventArgs e)
{
fController.SelectCursorCoords();
}

private void ListGeoCoords_Click(object sender, EventArgs e)
{
fController.SelectGeoPoint();
Expand Down

0 comments on commit f37cedf

Please sign in to comment.