From 21f1e39efa259a689bcac1072ebaa75c4e768115 Mon Sep 17 00:00:00 2001 From: "Sergey V. Zhdanovskih" Date: Thu, 19 Oct 2023 23:32:07 +0300 Subject: [PATCH] Experimental development (24) (#182) --- .../Controllers/OptionsDlgController.cs | 12 +- .../Controllers/PersonsFilterDlgController.cs | 5 +- projects/GKvX/GEDKeeperX/App.xaml | 22 +- .../GKUI/Components/ACOptionsControl.xaml | 55 +++ .../GKUI/Components/ACOptionsControl.xaml.cs | 154 +++++++ .../GKUI/Components/FilterGridView.cs | 32 +- .../GEDKeeperX/GKUI/Components/GroupBox.cs | 29 ++ .../GEDKeeperX/GKUI/Components/HyperView.xaml | 9 +- .../GKUI/Components/NumericStepper.cs | 32 ++ .../GKUI/Forms/CommonFilterDlg.xaml | 33 ++ .../GKUI/Forms/CommonFilterDlg.xaml.cs | 82 ++++ .../GEDKeeperX/GKUI/Forms/OptionsDlg.xaml | 412 ++++++++++++++++++ .../GEDKeeperX/GKUI/Forms/OptionsDlg.xaml.cs | 229 ++++++++++ .../GEDKeeperX/GKUI/Forms/PersonEditDlg.xaml | 122 ++---- .../GKUI/Forms/PersonsFilterDlg.xaml | 82 ++++ .../GKUI/Forms/PersonsFilterDlg.xaml.cs | 188 ++++++++ .../GKUI/Forms/ResearchEditDlg.xaml | 2 +- .../GEDKeeperX/GKUI/Forms/TTPatSearchDlg.xaml | 2 +- .../GEDKeeperX/GKUI/Forms/TTRecMergeDlg.xaml | 4 +- .../GEDKeeperX/GKUI/Forms/TreeChartWin.xaml | 14 +- .../GKUI/Forms/TreeChartWin.xaml.cs | 9 +- .../GEDKeeperX/GKUI/Forms/TreeFilterDlg.xaml | 54 +++ .../GKUI/Forms/TreeFilterDlg.xaml.cs | 86 ++++ .../GKUI/Platform/Handlers/ControlHandlers.cs | 7 +- .../GKUI/Platform/Handlers/GroupBoxHandler.cs | 38 ++ .../GEDKeeperX/GKUI/Platform/XFAppHost.cs | 11 +- 26 files changed, 1615 insertions(+), 110 deletions(-) create mode 100644 projects/GKvX/GEDKeeperX/GKUI/Components/ACOptionsControl.xaml create mode 100644 projects/GKvX/GEDKeeperX/GKUI/Components/ACOptionsControl.xaml.cs create mode 100644 projects/GKvX/GEDKeeperX/GKUI/Components/GroupBox.cs create mode 100644 projects/GKvX/GEDKeeperX/GKUI/Components/NumericStepper.cs create mode 100644 projects/GKvX/GEDKeeperX/GKUI/Forms/CommonFilterDlg.xaml create mode 100644 projects/GKvX/GEDKeeperX/GKUI/Forms/CommonFilterDlg.xaml.cs create mode 100644 projects/GKvX/GEDKeeperX/GKUI/Forms/OptionsDlg.xaml create mode 100644 projects/GKvX/GEDKeeperX/GKUI/Forms/OptionsDlg.xaml.cs create mode 100644 projects/GKvX/GEDKeeperX/GKUI/Forms/PersonsFilterDlg.xaml create mode 100644 projects/GKvX/GEDKeeperX/GKUI/Forms/PersonsFilterDlg.xaml.cs create mode 100644 projects/GKvX/GEDKeeperX/GKUI/Forms/TreeFilterDlg.xaml create mode 100644 projects/GKvX/GEDKeeperX/GKUI/Forms/TreeFilterDlg.xaml.cs create mode 100644 projects/GKvX/GEDKeeperX/GKUI/Platform/Handlers/GroupBoxHandler.cs diff --git a/projects/GKCore/GKCore/Controllers/OptionsDlgController.cs b/projects/GKCore/GKCore/Controllers/OptionsDlgController.cs index f4e34d2ef..8135075bf 100644 --- a/projects/GKCore/GKCore/Controllers/OptionsDlgController.cs +++ b/projects/GKCore/GKCore/Controllers/OptionsDlgController.cs @@ -726,7 +726,9 @@ public override void UpdateView() UpdateSpecials(); // plugins - UpdatePlugins(); + if (!AppHost.Instance.HasFeatureSupport(Feature.Mobile)) { + UpdatePlugins(); + } } public override bool Accept() @@ -755,7 +757,9 @@ public override bool Accept() AcceptSpecials(); // plugins - AcceptPlugins(); + if (!AppHost.Instance.HasFeatureSupport(Feature.Mobile)) { + AcceptPlugins(); + } return true; } @@ -952,7 +956,9 @@ public override void SetLocale() GetControl("chkExtendedKinships").Text = LangMan.LS(LSID.ExtendedKinships); // Plugins - GetControl("pagePlugins").Text = LangMan.LS(LSID.Plugins); + if (!AppHost.Instance.HasFeatureSupport(Feature.Mobile)) { + GetControl("pagePlugins").Text = LangMan.LS(LSID.Plugins); + } } } } diff --git a/projects/GKCore/GKCore/Controllers/PersonsFilterDlgController.cs b/projects/GKCore/GKCore/Controllers/PersonsFilterDlgController.cs index d02908562..58a4c213e 100644 --- a/projects/GKCore/GKCore/Controllers/PersonsFilterDlgController.cs +++ b/projects/GKCore/GKCore/Controllers/PersonsFilterDlgController.cs @@ -19,13 +19,12 @@ */ using System; -using BSLib; using GDModel; +using GKCore.Design; using GKCore.Design.Controls; +using GKCore.Design.Views; using GKCore.Interfaces; using GKCore.Lists; -using GKCore.Design; -using GKCore.Design.Views; using GKCore.Options; using GKCore.Types; diff --git a/projects/GKvX/GEDKeeperX/App.xaml b/projects/GKvX/GEDKeeperX/App.xaml index 367ac1633..78dcdb554 100644 --- a/projects/GKvX/GEDKeeperX/App.xaml +++ b/projects/GKvX/GEDKeeperX/App.xaml @@ -8,7 +8,6 @@ + + + + + + diff --git a/projects/GKvX/GEDKeeperX/GKUI/Components/ACOptionsControl.xaml b/projects/GKvX/GEDKeeperX/GKUI/Components/ACOptionsControl.xaml new file mode 100644 index 000000000..2283dc18e --- /dev/null +++ b/projects/GKvX/GEDKeeperX/GKUI/Components/ACOptionsControl.xaml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + diff --git a/projects/GKvX/GEDKeeperX/GKUI/Components/ACOptionsControl.xaml.cs b/projects/GKvX/GEDKeeperX/GKUI/Components/ACOptionsControl.xaml.cs new file mode 100644 index 000000000..ffb890c07 --- /dev/null +++ b/projects/GKvX/GEDKeeperX/GKUI/Components/ACOptionsControl.xaml.cs @@ -0,0 +1,154 @@ +/* + * "GEDKeeper", the personal genealogical database editor. + * Copyright (C) 2009-2023 by Sergey V. Zhdanovskih. + * + * This file is part of "GEDKeeper". + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +using System; +using GKCore; +using GKCore.Interfaces; +using GKCore.Options; +using Xamarin.Forms; + +namespace GKUI.Components +{ + public partial class ACOptionsControl : ContentView, IOptionsControl + { + private CircleChartOptions fOptions; + + public IOptions Options + { + get { + return fOptions; + } + set { + var circleOptions = value as CircleChartOptions; + if (circleOptions == null) return; + + fOptions = circleOptions; + UpdateControls(); + } + } + + public ACOptionsControl() + { + InitializeComponent(); + + SetLabelClickEvent(acb0); + SetLabelClickEvent(acb1); + SetLabelClickEvent(acb2); + SetLabelClickEvent(acb3); + SetLabelClickEvent(acb4); + SetLabelClickEvent(acb5); + SetLabelClickEvent(acb6); + SetLabelClickEvent(acb7); + SetLabelClickEvent(acbText); + SetLabelClickEvent(acbBack); + SetLabelClickEvent(acbLine); + + SetLocale(); + } + + private void SetLabelClickEvent(Label label) + { + var tapRecognizer = new TapGestureRecognizer(); + tapRecognizer.Tapped += (s, e) => { + lblColorClick(s, e); + }; + label.GestureRecognizers.Add(tapRecognizer); + } + + public void SetLocale() + { + //Title = LangMan.LS(LSID.MIOptions); + + //SheetAncCircle.Text = LangMan.LS(LSID.AncestorsCircle); + acb0.Text = LangMan.LS(LSID.Circle) + @" 0"; + acb1.Text = LangMan.LS(LSID.Circle) + @" 1"; + acb2.Text = LangMan.LS(LSID.Circle) + @" 2"; + acb3.Text = LangMan.LS(LSID.Circle) + @" 3"; + acb4.Text = LangMan.LS(LSID.Circle) + @" 4"; + acb5.Text = LangMan.LS(LSID.Circle) + @" 5"; + acb6.Text = LangMan.LS(LSID.Circle) + @" 6"; + acb7.Text = LangMan.LS(LSID.Circle) + @" 7"; + acbText.Text = LangMan.LS(LSID.TextColor); + acbBack.Text = LangMan.LS(LSID.BackColor); + acbLine.Text = LangMan.LS(LSID.LinesColor); + chkHideEmptySegments.Text = LangMan.LS(LSID.HideEmptySegments); + chkArcText.Text = LangMan.LS(LSID.ArcText); + } + + public void AcceptChanges() + { + if (fOptions == null) return; + + fOptions.BrushColor[0] = UIHelper.ConvertColor(acb0.BackgroundColor); + fOptions.BrushColor[1] = UIHelper.ConvertColor(acb1.BackgroundColor); + fOptions.BrushColor[2] = UIHelper.ConvertColor(acb2.BackgroundColor); + fOptions.BrushColor[3] = UIHelper.ConvertColor(acb3.BackgroundColor); + fOptions.BrushColor[4] = UIHelper.ConvertColor(acb4.BackgroundColor); + fOptions.BrushColor[5] = UIHelper.ConvertColor(acb5.BackgroundColor); + fOptions.BrushColor[6] = UIHelper.ConvertColor(acb6.BackgroundColor); + fOptions.BrushColor[7] = UIHelper.ConvertColor(acb7.BackgroundColor); + fOptions.BrushColor[8] = UIHelper.ConvertColor(acbText.BackgroundColor); + fOptions.BrushColor[9] = UIHelper.ConvertColor(acbBack.BackgroundColor); + fOptions.BrushColor[10] = UIHelper.ConvertColor(acbLine.BackgroundColor); + + fOptions.HideEmptySegments = chkHideEmptySegments.IsChecked; + fOptions.ArcText = chkArcText.IsChecked; + //fOptions.Apply(); + } + + public void UpdateControls() + { + if (fOptions == null) return; + //PanDefFont.Text = FOptions.ChartOptions.DefFont_Name + ", " + FOptions.ChartOptions.DefFont_Size.ToString(); + + acb0.BackgroundColor = UIHelper.ConvertColor(fOptions.BrushColor[0]); + acb1.BackgroundColor = UIHelper.ConvertColor(fOptions.BrushColor[1]); + acb2.BackgroundColor = UIHelper.ConvertColor(fOptions.BrushColor[2]); + acb3.BackgroundColor = UIHelper.ConvertColor(fOptions.BrushColor[3]); + acb4.BackgroundColor = UIHelper.ConvertColor(fOptions.BrushColor[4]); + acb5.BackgroundColor = UIHelper.ConvertColor(fOptions.BrushColor[5]); + acb6.BackgroundColor = UIHelper.ConvertColor(fOptions.BrushColor[6]); + acb7.BackgroundColor = UIHelper.ConvertColor(fOptions.BrushColor[7]); + acbText.BackgroundColor = UIHelper.ConvertColor(fOptions.BrushColor[8]); + acbBack.BackgroundColor = UIHelper.ConvertColor(fOptions.BrushColor[9]); + acbLine.BackgroundColor = UIHelper.ConvertColor(fOptions.BrushColor[10]); + + chkHideEmptySegments.IsChecked = fOptions.HideEmptySegments; + chkArcText.IsChecked = fOptions.ArcText; + } + + /*private void PanDefFont_Click(object sender, EventArgs e) + { + if (FontDialog1.ShowDialog() == DialogResult.OK) + { + //FOptions.ChartOptions.DefFont_Name = FontDialog1.Font.Name; + //FOptions.ChartOptions.DefFont_Size = (int)checked((long)Math.Round((double)FontDialog1.Font.Size)); + } + UpdateControls(); + }*/ + + private void lblColorClick(object sender, EventArgs e) + { + Label lbl = sender as Label; + if (lbl == null) return; + lbl.BackgroundColor = UIHelper.ConvertColor(AppHost.StdDialogs.SelectColor(UIHelper.ConvertColor(lbl.BackgroundColor))); + } + } +} diff --git a/projects/GKvX/GEDKeeperX/GKUI/Components/FilterGridView.cs b/projects/GKvX/GEDKeeperX/GKUI/Components/FilterGridView.cs index acff85619..cf2dba774 100644 --- a/projects/GKvX/GEDKeeperX/GKUI/Components/FilterGridView.cs +++ b/projects/GKvX/GEDKeeperX/GKUI/Components/FilterGridView.cs @@ -18,11 +18,41 @@ * along with this program. If not, see . */ +using GKCore.Design.Controls; +using GKCore.Interfaces; using Xamarin.Forms; namespace GKUI.Components { - public class FilterGridView : ContentView + public class FilterGridView : ContentView, IFilterGridView { + private readonly IRecordsListModel fListMan; + + public FilterCondition this[int index] + { + get { return null; } + } + + public IRecordsListModel ListMan { get; set; } + + public int Count { get; set; } + + public bool Enabled { get; set; } + + public void Activate() + { + } + + public void AddCondition(FilterCondition fcond) + { + } + + public void Clear() + { + } + + public void RemoveCondition(int index) + { + } } } diff --git a/projects/GKvX/GEDKeeperX/GKUI/Components/GroupBox.cs b/projects/GKvX/GEDKeeperX/GKUI/Components/GroupBox.cs new file mode 100644 index 000000000..bcad66da2 --- /dev/null +++ b/projects/GKvX/GEDKeeperX/GKUI/Components/GroupBox.cs @@ -0,0 +1,29 @@ +/* + * "GEDKeeper", the personal genealogical database editor. + * Copyright (C) 2009-2023 by Sergey V. Zhdanovskih. + * + * This file is part of "GEDKeeper". + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +using Xamarin.Forms; + +namespace GKUI.Components +{ + public class GroupBox : ContentView + { + public string Text { get; set; } + } +} diff --git a/projects/GKvX/GEDKeeperX/GKUI/Components/HyperView.xaml b/projects/GKvX/GEDKeeperX/GKUI/Components/HyperView.xaml index 9134406d9..57525c702 100644 --- a/projects/GKvX/GEDKeeperX/GKUI/Components/HyperView.xaml +++ b/projects/GKvX/GEDKeeperX/GKUI/Components/HyperView.xaml @@ -1,8 +1,11 @@  - + + + diff --git a/projects/GKvX/GEDKeeperX/GKUI/Components/NumericStepper.cs b/projects/GKvX/GEDKeeperX/GKUI/Components/NumericStepper.cs new file mode 100644 index 000000000..c192f4d03 --- /dev/null +++ b/projects/GKvX/GEDKeeperX/GKUI/Components/NumericStepper.cs @@ -0,0 +1,32 @@ +/* + * "GEDKeeper", the personal genealogical database editor. + * Copyright (C) 2009-2023 by Sergey V. Zhdanovskih. + * + * This file is part of "GEDKeeper". + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +using Xamarin.Forms; + +namespace GKUI.Components +{ + public class NumericStepper : ContentView + { + public int Increment { get; set; } + public int MinValue { get; set; } + public int MaxValue { get; set; } + public int Value { get; set; } + } +} diff --git a/projects/GKvX/GEDKeeperX/GKUI/Forms/CommonFilterDlg.xaml b/projects/GKvX/GEDKeeperX/GKUI/Forms/CommonFilterDlg.xaml new file mode 100644 index 000000000..8aeef2dab --- /dev/null +++ b/projects/GKvX/GEDKeeperX/GKUI/Forms/CommonFilterDlg.xaml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + +