diff --git a/projects/GKCore/GKCore/Controllers/BaseController.cs b/projects/GKCore/GKCore/Controllers/BaseController.cs index 63d29adda..6608dda52 100644 --- a/projects/GKCore/GKCore/Controllers/BaseController.cs +++ b/projects/GKCore/GKCore/Controllers/BaseController.cs @@ -20,6 +20,7 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Text; using System.Threading.Tasks; using BSLib; @@ -1106,13 +1107,15 @@ public static GDMRecord DuplicateRecord(IBaseContext context, GDMRecord original context.BeginUpdate(); GDMRecord result; - - if (original.RecordType == GDMRecordType.rtIndividual) { - result = context.Tree.CreateIndividual(); - } else if (original.RecordType == GDMRecordType.rtLocation) { - result = context.Tree.CreateLocation(); - } else { - return null; + switch (original.RecordType) { + case GDMRecordType.rtIndividual: + result = context.Tree.CreateIndividual(); + break; + case GDMRecordType.rtLocation: + result = context.Tree.CreateLocation(); + break; + default: + return null; } result.Assign(original); @@ -1479,6 +1482,8 @@ public static void ShowMap_Indi(IBaseWindow baseWin, GDMLocationRecord locRec) var subLinks = new HashSet(); GKUtils.GetLocationRecursiveSubordinateLinks(tree, locRec, subLinks, true); + var selectedIndividuals = baseWin.GetContentList(GDMRecordType.rtIndividual).Cast(); + var locName = new StringBuilder(); var geoPoints = new List(); @@ -1486,6 +1491,9 @@ public static void ShowMap_Indi(IBaseWindow baseWin, GDMLocationRecord locRec) var individualRecords = new HashSet(); GKUtils.GetLocationIndividuals(tree, location, individualRecords); + individualRecords.IntersectWith(selectedIndividuals); + if (individualRecords.Count == 0) continue; + locName.AppendLine(GKUtils.GetRecordName(tree, location, false)); var mapPt = location.Map; diff --git a/projects/GKCore/GKCore/Controllers/LocationEditDlgController.cs b/projects/GKCore/GKCore/Controllers/LocationEditDlgController.cs index 8c3b1a378..911dd6cd3 100644 --- a/projects/GKCore/GKCore/Controllers/LocationEditDlgController.cs +++ b/projects/GKCore/GKCore/Controllers/LocationEditDlgController.cs @@ -225,7 +225,8 @@ public override void SetLocale() SetToolTip("btnShowOnMap", LangMan.LS(LSID.ShowOnMapTip)); - fView.GeoCoordsList.AddColumn(LangMan.LS(LSID.Title), 200, false); + fView.GeoCoordsList.ClearColumns(); + fView.GeoCoordsList.AddColumn(LangMan.LS(LSID.Title), 300, false); fView.GeoCoordsList.AddColumn(LangMan.LS(LSID.Latitude), 80, false); fView.GeoCoordsList.AddColumn(LangMan.LS(LSID.Longitude), 80, false); diff --git a/projects/GKCore/GKCore/Lists/LocationLinksListModel.cs b/projects/GKCore/GKCore/Lists/LocationLinksListModel.cs index 4d9f58de8..abb7d7616 100644 --- a/projects/GKCore/GKCore/Lists/LocationLinksListModel.cs +++ b/projects/GKCore/GKCore/Lists/LocationLinksListModel.cs @@ -36,7 +36,7 @@ public sealed class LocationLinksListModel : SheetModel public LocationLinksListModel(IView owner, IBaseWindow baseWin, ChangeTracker undoman) : base(owner, baseWin, undoman, CreateListColumns()) { - AllowedActions = EnumSet.Create(RecordAction.raAdd, RecordAction.raEdit, RecordAction.raDelete); + AllowedActions = EnumSet.Create(RecordAction.raAdd, RecordAction.raEdit, RecordAction.raDelete, RecordAction.raCopy, RecordAction.raPaste); } public static ListColumns CreateListColumns() @@ -111,10 +111,25 @@ public override async Task Modify(object sender, ModifyEventArgs eArgs) result = fUndoman.DoOrdinaryOperation(OperationType.otLocationLinkRemove, dataOwner, locLink); } break; + + case RecordAction.raCopy: + AppHost.Instance.SetClipboardObj(locLink); + break; + + case RecordAction.raCut: + break; + + case RecordAction.raPaste: + locLink = AppHost.Instance.GetClipboardObj(); + if (locLink != null) { + locLink = locLink.Clone(); + result = fUndoman.DoOrdinaryOperation(OperationType.otLocationLinkAdd, dataOwner, locLink); + } + break; } if (result) { - if (eArgs.Action == RecordAction.raAdd) { + if (eArgs.Action == RecordAction.raAdd || eArgs.Action == RecordAction.raPaste) { eArgs.ItemData = locLink; } diff --git a/projects/GKCore/GKCore/Lists/LocationNamesListModel.cs b/projects/GKCore/GKCore/Lists/LocationNamesListModel.cs index e37ab424e..8dab51aca 100644 --- a/projects/GKCore/GKCore/Lists/LocationNamesListModel.cs +++ b/projects/GKCore/GKCore/Lists/LocationNamesListModel.cs @@ -34,7 +34,7 @@ public sealed class LocationNamesListModel : SheetModel { public LocationNamesListModel(IView owner, IBaseWindow baseWin, ChangeTracker undoman) : base(owner, baseWin, undoman, CreateListColumns()) { - AllowedActions = EnumSet.Create(RecordAction.raAdd, RecordAction.raEdit, RecordAction.raDelete); + AllowedActions = EnumSet.Create(RecordAction.raAdd, RecordAction.raEdit, RecordAction.raDelete, RecordAction.raCopy, RecordAction.raPaste); } public static ListColumns CreateListColumns() @@ -125,12 +125,27 @@ public override async Task Modify(object sender, ModifyEventArgs eArgs) result = fUndoman.DoOrdinaryOperation(OperationType.otLocationNameRemove, dataOwner, locName); } break; + + case RecordAction.raCopy: + AppHost.Instance.SetClipboardObj(locName); + break; + + case RecordAction.raCut: + break; + + case RecordAction.raPaste: + locName = AppHost.Instance.GetClipboardObj(); + if (locName != null) { + locName = locName.Clone(); + result = fUndoman.DoOrdinaryOperation(OperationType.otLocationNameAdd, dataOwner, locName); + } + break; } if (result) { UpdateButtons(); - if (eArgs.Action == RecordAction.raAdd) { + if (eArgs.Action == RecordAction.raAdd || eArgs.Action == RecordAction.raPaste) { eArgs.ItemData = locName; } diff --git a/projects/GKv2/GEDKeeper2/GKUI/Forms/LocationEditDlg.Designer.cs b/projects/GKv2/GEDKeeper2/GKUI/Forms/LocationEditDlg.Designer.cs index e199d06b4..e3ac9ae44 100644 --- a/projects/GKv2/GEDKeeper2/GKUI/Forms/LocationEditDlg.Designer.cs +++ b/projects/GKv2/GEDKeeper2/GKUI/Forms/LocationEditDlg.Designer.cs @@ -66,7 +66,7 @@ private void InitializeComponent() // btnAccept // this.btnAccept.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnAccept.Location = new System.Drawing.Point(538, 534); + this.btnAccept.Location = new System.Drawing.Point(598, 534); this.btnAccept.Name = "btnAccept"; this.btnAccept.Size = new System.Drawing.Size(113, 31); this.btnAccept.TabIndex = 1; @@ -78,7 +78,7 @@ private void InitializeComponent() // this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnCancel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnCancel.Location = new System.Drawing.Point(661, 534); + this.btnCancel.Location = new System.Drawing.Point(721, 534); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(113, 31); this.btnCancel.TabIndex = 2; @@ -95,7 +95,7 @@ private void InitializeComponent() this.tabsData.Location = new System.Drawing.Point(0, 0); this.tabsData.Name = "tabsData"; this.tabsData.SelectedIndex = 0; - this.tabsData.Size = new System.Drawing.Size(785, 516); + this.tabsData.Size = new System.Drawing.Size(844, 516); this.tabsData.TabIndex = 0; // // pageCommon @@ -173,7 +173,7 @@ private void InitializeComponent() this.grpSearch.Controls.Add(this.panMap); this.grpSearch.Location = new System.Drawing.Point(0, 62); this.grpSearch.Name = "grpSearch"; - this.grpSearch.Size = new System.Drawing.Size(774, 420); + this.grpSearch.Size = new System.Drawing.Size(834, 420); this.grpSearch.TabIndex = 7; this.grpSearch.TabStop = false; this.grpSearch.Text = "grpSearch"; @@ -187,7 +187,7 @@ private void InitializeComponent() this.ListGeoCoords.FullRowSelect = true; this.ListGeoCoords.Location = new System.Drawing.Point(22, 19); this.ListGeoCoords.Name = "ListGeoCoords"; - this.ListGeoCoords.Size = new System.Drawing.Size(563, 109); + this.ListGeoCoords.Size = new System.Drawing.Size(623, 109); this.ListGeoCoords.TabIndex = 1; this.ListGeoCoords.UseCompatibleStateImageBehavior = false; this.ListGeoCoords.View = System.Windows.Forms.View.Details; @@ -210,7 +210,7 @@ private void InitializeComponent() // // btnSearch // - this.btnSearch.Location = new System.Drawing.Point(601, 19); + this.btnSearch.Location = new System.Drawing.Point(661, 19); this.btnSearch.Name = "btnSearch"; this.btnSearch.Size = new System.Drawing.Size(147, 31); this.btnSearch.TabIndex = 2; @@ -219,7 +219,7 @@ private void InitializeComponent() // // btnSelect // - this.btnSelect.Location = new System.Drawing.Point(601, 58); + this.btnSelect.Location = new System.Drawing.Point(661, 58); this.btnSelect.Name = "btnSelect"; this.btnSelect.Size = new System.Drawing.Size(147, 31); this.btnSelect.TabIndex = 3; @@ -228,7 +228,7 @@ private void InitializeComponent() // // btnSelectName // - this.btnSelectName.Location = new System.Drawing.Point(601, 97); + this.btnSelectName.Location = new System.Drawing.Point(661, 97); this.btnSelectName.Name = "btnSelectName"; this.btnSelectName.Size = new System.Drawing.Size(147, 31); this.btnSelectName.TabIndex = 4; @@ -240,7 +240,7 @@ private void InitializeComponent() this.panMap.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.panMap.Location = new System.Drawing.Point(3, 135); this.panMap.Name = "panMap"; - this.panMap.Size = new System.Drawing.Size(768, 283); + this.panMap.Size = new System.Drawing.Size(828, 283); this.panMap.TabIndex = 0; // // btnShowOnMap @@ -313,7 +313,7 @@ private void InitializeComponent() this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(784, 578); + this.ClientSize = new System.Drawing.Size(844, 578); this.Controls.Add(this.tabsData); this.Controls.Add(this.btnAccept); this.Controls.Add(this.btnCancel); diff --git a/projects/GKv3/GEDKeeper3/GKUI/Forms/AddressEditDlg.xeto b/projects/GKv3/GEDKeeper3/GKUI/Forms/AddressEditDlg.xeto index eb3ff2046..18e71b577 100644 --- a/projects/GKv3/GEDKeeper3/GKUI/Forms/AddressEditDlg.xeto +++ b/projects/GKv3/GEDKeeper3/GKUI/Forms/AddressEditDlg.xeto @@ -46,14 +46,10 @@ - + - - - - - - + + diff --git a/projects/GKv3/GEDKeeper3/GKUI/Forms/LocExpertDlg.xeto b/projects/GKv3/GEDKeeper3/GKUI/Forms/LocExpertDlg.xeto index 60d8a968a..993a327cb 100644 --- a/projects/GKv3/GEDKeeper3/GKUI/Forms/LocExpertDlg.xeto +++ b/projects/GKv3/GEDKeeper3/GKUI/Forms/LocExpertDlg.xeto @@ -51,7 +51,7 @@ - +