From 5ee3c6d8ea864f5d7bfdeba80b9aefb59c3c6019 Mon Sep 17 00:00:00 2001 From: "Sergey V. Zhdanovskih" Date: Fri, 3 Nov 2023 00:31:01 +0300 Subject: [PATCH] Experimental development (30) (#182) --- .../GKCore/Controllers/FARDlgController.cs | 10 +- .../FilePropertiesDlgController.cs | 23 ++++- .../Controllers/LocationEditDlgController.cs | 8 +- .../Controllers/SourceEditDlgController.cs | 2 +- .../Controllers/TreeCompareController.cs | 2 +- .../GKCore/Design/Views/IFilePropertiesDlg.cs | 11 +++ .../GEDKeeperX/GKUI/Components/ArborViewer.cs | 2 +- .../GKUI/Components/ScrollablePanel.cs | 1 + .../GKUI/Components/TreeChartBox.cs | 4 +- .../GKUI/Components/TreeMapViewer.cs | 8 ++ .../GEDKeeperX/GKUI/Forms/AddressEditDlg.xaml | 29 +++--- .../GKUI/Forms/AddressEditDlg.xaml.cs | 4 - .../GKUI/Forms/AssociationEditDlg.xaml | 4 +- .../GEDKeeperX/GKUI/Forms/BaseWinSDI.xaml.cs | 8 +- .../GKUI/Forms/CommonFilterDlg.xaml.cs | 5 +- .../GKvX/GEDKeeperX/GKUI/Forms/CommonForm.cs | 2 +- .../GEDKeeperX/GKUI/Forms/EventEditDlg.xaml | 5 + .../GKUI/Forms/FilePropertiesDlg.xaml | 8 +- .../GKUI/Forms/FilePropertiesDlg.xaml.cs | 13 ++- .../GKUI/Forms/FindAndReplaceDlg.xaml | 24 ++--- .../GKUI/Forms/FindAndReplaceDlg.xaml.cs | 5 - .../GKUI/Forms/LocationEditDlg.xaml | 29 +++--- .../GKvX/GEDKeeperX/GKUI/Forms/MainPage.cs | 8 -- .../GEDKeeperX/GKUI/Forms/NoteEditDlg.xaml.cs | 4 - .../GEDKeeperX/GKUI/Forms/OptionsDlg.xaml | 91 +++++++++---------- .../GKUI/Forms/OrganizerWin.xaml.cs | 4 - .../GEDKeeperX/GKUI/Forms/ParentsEditDlg.xaml | 7 ++ .../GKUI/Forms/PatriarchsViewerWin.xaml.cs | 4 - .../GEDKeeperX/GKUI/Forms/PersonEditDlg.xaml | 7 ++ .../GKUI/Forms/QuickSearchDlg.xaml.cs | 4 - .../GKUI/Forms/RepositoryEditDlg.xaml.cs | 4 - .../GKUI/Forms/SourceCitEditDlg.xaml | 2 +- .../GKUI/Forms/SourceEditDlg.xaml.cs | 4 - .../GKUI/Forms/TTFamilyGroupsDlg.xaml | 6 +- .../GKUI/Forms/TTPlacesManagerDlg.xaml | 2 +- .../GKUI/Forms/TTTreeCompareDlg.xaml | 30 +++--- .../GKUI/Forms/TreeChartWin.xaml.cs | 9 +- .../GEDKeeperX/GKUI/Forms/UserRefEditDlg.xaml | 2 + .../GKUI/Forms/UserRefEditDlg.xaml.cs | 4 - .../GEDKeeperX/GKUI/Platform/XFGfxRenderer.cs | 43 +++++++-- 40 files changed, 230 insertions(+), 212 deletions(-) diff --git a/projects/GKCore/GKCore/Controllers/FARDlgController.cs b/projects/GKCore/GKCore/Controllers/FARDlgController.cs index bd866741e..d3270e04d 100644 --- a/projects/GKCore/GKCore/Controllers/FARDlgController.cs +++ b/projects/GKCore/GKCore/Controllers/FARDlgController.cs @@ -21,12 +21,11 @@ using System; using BSLib; using GDModel; -using GKCore.Design.Controls; using GKCore.Design; +using GKCore.Design.Controls; using GKCore.Design.Views; using GKCore.Options; using GKCore.Search; -using GKCore.Types; namespace GKCore.Controllers { @@ -53,12 +52,7 @@ public override void SetLocale() GetControl("chkMatchCase").Text = LangMan.LS(LSID.MatchCase); GetControl("chkMatchWildcards").Text = LangMan.LS(LSID.MatchWildcards); GetControl("chkWholeWord").Text = LangMan.LS(LSID.WholeWord); - - if (!AppHost.Instance.HasFeatureSupport(Feature.Mobile)) { - GetControl("gbFilters").Text = LangMan.LS(LSID.MIFilter); - } else { - GetControl("gbFilters").Text = LangMan.LS(LSID.MIFilter); - } + GetControl("gbFilters").Text = LangMan.LS(LSID.MIFilter); GetControl("lblRecord").Text = LangMan.LS(LSID.Record); GetControl("lblProperty").Text = LangMan.LS(LSID.Property); diff --git a/projects/GKCore/GKCore/Controllers/FilePropertiesDlgController.cs b/projects/GKCore/GKCore/Controllers/FilePropertiesDlgController.cs index 6f772826c..f8a7c892a 100644 --- a/projects/GKCore/GKCore/Controllers/FilePropertiesDlgController.cs +++ b/projects/GKCore/GKCore/Controllers/FilePropertiesDlgController.cs @@ -36,12 +36,23 @@ public sealed class FilePropertiesDlgController : DialogController(); + } GDMSubmitterRecord submitter = fBase.Context.Tree.GetSubmitter(); submitter.Name = fView.Name.Text; @@ -64,7 +75,12 @@ public override bool Accept() public override void UpdateView() { - fView.Language.Text = GEDCOMUtils.GetLanguageStr(fBase.Context.Tree.Header.Language); + if (!AppHost.Instance.HasFeatureSupport(Feature.Mobile)) { + fView.Language.Text = GEDCOMUtils.GetLanguageStr(fBase.Context.Tree.Header.Language); + } else { + var mobileView = fView as IMobileFilePropertiesDlg; + mobileView.LanguageCombo.Text = GEDCOMUtils.GetLanguageStr(fBase.Context.Tree.Header.Language); + } GDMSubmitterRecord submitter = fBase.Context.Tree.GetSubmitter(); fView.Name.Text = submitter.Name; @@ -84,6 +100,9 @@ public override void UpdateView() public void ChangeLanguage() { + if (AppHost.Instance.HasFeatureSupport(Feature.Mobile)) + return; + using (var dlg = AppHost.ResolveDialog()) { dlg.LanguageID = fBase.Context.Tree.Header.Language; diff --git a/projects/GKCore/GKCore/Controllers/LocationEditDlgController.cs b/projects/GKCore/GKCore/Controllers/LocationEditDlgController.cs index 0165fe19f..6cd7e51a1 100644 --- a/projects/GKCore/GKCore/Controllers/LocationEditDlgController.cs +++ b/projects/GKCore/GKCore/Controllers/LocationEditDlgController.cs @@ -186,13 +186,7 @@ public override void SetLocale() GetControl("lblLatitude").Text = LangMan.LS(LSID.Latitude); GetControl("lblLongitude").Text = LangMan.LS(LSID.Longitude); GetControl("btnShowOnMap").Text = LangMan.LS(LSID.Show); - - if (!AppHost.Instance.HasFeatureSupport(Feature.Mobile)) { - GetControl("grpSearch").Text = LangMan.LS(LSID.SearchCoords); - } else { - GetControl("grpSearch").Text = LangMan.LS(LSID.SearchCoords); - } - + GetControl("grpSearch").Text = LangMan.LS(LSID.SearchCoords); GetControl("btnSearch").Text = LangMan.LS(LSID.Search); GetControl("btnSelect").Text = LangMan.LS(LSID.SelectCoords); GetControl("btnSelectName").Text = LangMan.LS(LSID.SelectName); diff --git a/projects/GKCore/GKCore/Controllers/SourceEditDlgController.cs b/projects/GKCore/GKCore/Controllers/SourceEditDlgController.cs index c7fa1c75f..75784b3ba 100644 --- a/projects/GKCore/GKCore/Controllers/SourceEditDlgController.cs +++ b/projects/GKCore/GKCore/Controllers/SourceEditDlgController.cs @@ -101,7 +101,7 @@ public override void UpdateView() public override void SetLocale() { - ((IView)fView).Title = LangMan.LS(LSID.Source); + fView.Title = LangMan.LS(LSID.Source); GetControl("btnAccept").Text = LangMan.LS(LSID.DlgAccept); GetControl("btnCancel").Text = LangMan.LS(LSID.DlgCancel); diff --git a/projects/GKCore/GKCore/Controllers/TreeCompareController.cs b/projects/GKCore/GKCore/Controllers/TreeCompareController.cs index 31b7b92f8..7461cab52 100644 --- a/projects/GKCore/GKCore/Controllers/TreeCompareController.cs +++ b/projects/GKCore/GKCore/Controllers/TreeCompareController.cs @@ -131,8 +131,8 @@ public override void SetLocale() if (!AppHost.Instance.HasFeatureSupport(Feature.Mobile)) { GetControl("pageTreeCompare").Text = LangMan.LS(LSID.ToolOp_1); GetControl("btnClose").Text = LangMan.LS(LSID.DlgClose); - GetControl("grpMatchType").Text = LangMan.LS(LSID.MatchType); } + GetControl("grpMatchType").Text = LangMan.LS(LSID.MatchType); GetControl("lblFile").Text = LangMan.LS(LSID.MIFile); GetControl("btnFileChoose").Text = LangMan.LS(LSID.DlgSelect) + @"..."; GetControl("radMatchInternal").Text = LangMan.LS(LSID.MatchInternal); diff --git a/projects/GKCore/GKCore/Design/Views/IFilePropertiesDlg.cs b/projects/GKCore/GKCore/Design/Views/IFilePropertiesDlg.cs index 2804fd995..cce6df3e3 100644 --- a/projects/GKCore/GKCore/Design/Views/IFilePropertiesDlg.cs +++ b/projects/GKCore/GKCore/Design/Views/IFilePropertiesDlg.cs @@ -32,4 +32,15 @@ public interface IFilePropertiesDlg : ICommonDialog, IBaseEditor ITextBox Address { get; } ITextBox Tel { get; } } + + + public interface IDesktopFilePropertiesDlg : IFilePropertiesDlg + { + } + + + public interface IMobileFilePropertiesDlg : IFilePropertiesDlg + { + IComboBox LanguageCombo { get; } + } } diff --git a/projects/GKvX/GEDKeeperX/GKUI/Components/ArborViewer.cs b/projects/GKvX/GEDKeeperX/GKUI/Components/ArborViewer.cs index dcfb149b2..35648e8e7 100644 --- a/projects/GKvX/GEDKeeperX/GKUI/Components/ArborViewer.cs +++ b/projects/GKvX/GEDKeeperX/GKUI/Components/ArborViewer.cs @@ -143,7 +143,7 @@ private void OnPaint(object sender, SKPaintSurfaceEventArgs args) try { SKPaint textPaint = new SKPaint { Color = SKColors.White, - TextSize = 24.0f + TextSize = (float)Device.GetNamedSize(NamedSize.Default, typeof(Label)) }; foreach (ArborNode node in fSys.Nodes) { diff --git a/projects/GKvX/GEDKeeperX/GKUI/Components/ScrollablePanel.cs b/projects/GKvX/GEDKeeperX/GKUI/Components/ScrollablePanel.cs index 815dc9691..64377a008 100644 --- a/projects/GKvX/GEDKeeperX/GKUI/Components/ScrollablePanel.cs +++ b/projects/GKvX/GEDKeeperX/GKUI/Components/ScrollablePanel.cs @@ -154,6 +154,7 @@ protected virtual void OnFontChanged(EventArgs e) private void PaintHandler(object sender, SKPaintSurfaceEventArgs e) { + e.Surface.Canvas.Clear(); OnPaint(e); #if DEBUG_VIEWPORT diff --git a/projects/GKvX/GEDKeeperX/GKUI/Components/TreeChartBox.cs b/projects/GKvX/GEDKeeperX/GKUI/Components/TreeChartBox.cs index e208c7772..7c97a064c 100644 --- a/projects/GKvX/GEDKeeperX/GKUI/Components/TreeChartBox.cs +++ b/projects/GKvX/GEDKeeperX/GKUI/Components/TreeChartBox.cs @@ -187,8 +187,8 @@ public TreeChartBox() fTraceSelected = true; fTreeControls = new TreeControlsList(); - fTreeControls.Add(new TCScaleControl(this)); - fTreeControls.Add(new TCGenerationsControl(this, TreeChartKind.ckDescendants)); + //fTreeControls.Add(new TCScaleControl(this)); + //fTreeControls.Add(new TCGenerationsControl(this, TreeChartKind.ckDescendants)); //fPersonControl = new PersonControl(this); InitTimer(); diff --git a/projects/GKvX/GEDKeeperX/GKUI/Components/TreeMapViewer.cs b/projects/GKvX/GEDKeeperX/GKUI/Components/TreeMapViewer.cs index d09a0ea23..9600f2193 100644 --- a/projects/GKvX/GEDKeeperX/GKUI/Components/TreeMapViewer.cs +++ b/projects/GKvX/GEDKeeperX/GKUI/Components/TreeMapViewer.cs @@ -54,6 +54,9 @@ public PaintItemEventArgs(SKSurface surface, MapItem item) public delegate void PaintItemEventHandler(object sender, PaintItemEventArgs args); + /// + /// TreeMap Viewer's control. + /// public class TreeMapViewer : ContentView { private MapItem fCurrentItem; @@ -150,6 +153,8 @@ public MapItem UpperItem public TreeMapViewer() { + fModel = new TreemapModel(); + fModel.CreatingItem += CreateSimpleItem; } private MapItem CreateSimpleItem(MapItem parent, string name, double size) @@ -164,6 +169,9 @@ private List GetRootList() public void UpdateView() { + try { + } catch { + } } } } diff --git a/projects/GKvX/GEDKeeperX/GKUI/Forms/AddressEditDlg.xaml b/projects/GKvX/GEDKeeperX/GKUI/Forms/AddressEditDlg.xaml index edf2b12f1..4fcff9b02 100644 --- a/projects/GKvX/GEDKeeperX/GKUI/Forms/AddressEditDlg.xaml +++ b/projects/GKvX/GEDKeeperX/GKUI/Forms/AddressEditDlg.xaml @@ -18,24 +18,27 @@ - - + - + diff --git a/projects/GKvX/GEDKeeperX/GKUI/Forms/AddressEditDlg.xaml.cs b/projects/GKvX/GEDKeeperX/GKUI/Forms/AddressEditDlg.xaml.cs index bbf4201a4..3b2255782 100644 --- a/projects/GKvX/GEDKeeperX/GKUI/Forms/AddressEditDlg.xaml.cs +++ b/projects/GKvX/GEDKeeperX/GKUI/Forms/AddressEditDlg.xaml.cs @@ -81,10 +81,6 @@ ITextBox IAddressEditDlg.AddressLine #endregion - public AddressEditDlg() : this(null) - { - } - public AddressEditDlg(IBaseWindow baseWin) { InitializeComponent(); diff --git a/projects/GKvX/GEDKeeperX/GKUI/Forms/AssociationEditDlg.xaml b/projects/GKvX/GEDKeeperX/GKUI/Forms/AssociationEditDlg.xaml index 1c5cb2502..b52ae4fe9 100644 --- a/projects/GKvX/GEDKeeperX/GKUI/Forms/AssociationEditDlg.xaml +++ b/projects/GKvX/GEDKeeperX/GKUI/Forms/AssociationEditDlg.xaml @@ -18,8 +18,8 @@