Skip to content

Commit

Permalink
Experimental development (24) (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serg-Norseman committed Oct 19, 2023
1 parent fb0ce28 commit 21f1e39
Show file tree
Hide file tree
Showing 26 changed files with 1,615 additions and 110 deletions.
12 changes: 9 additions & 3 deletions projects/GKCore/GKCore/Controllers/OptionsDlgController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,9 @@ public override void UpdateView()
UpdateSpecials();

// plugins
UpdatePlugins();
if (!AppHost.Instance.HasFeatureSupport(Feature.Mobile)) {
UpdatePlugins();
}
}

public override bool Accept()
Expand Down Expand Up @@ -755,7 +757,9 @@ public override bool Accept()
AcceptSpecials();

// plugins
AcceptPlugins();
if (!AppHost.Instance.HasFeatureSupport(Feature.Mobile)) {
AcceptPlugins();
}

return true;
}
Expand Down Expand Up @@ -952,7 +956,9 @@ public override void SetLocale()
GetControl<ICheckBox>("chkExtendedKinships").Text = LangMan.LS(LSID.ExtendedKinships);

// Plugins
GetControl<ITabPage>("pagePlugins").Text = LangMan.LS(LSID.Plugins);
if (!AppHost.Instance.HasFeatureSupport(Feature.Mobile)) {
GetControl<ITabPage>("pagePlugins").Text = LangMan.LS(LSID.Plugins);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
22 changes: 20 additions & 2 deletions projects/GKvX/GEDKeeperX/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
<ResourceDictionary>

<Style x:Key="dlgBtn" TargetType="Button">
<!--Setter Property="HeightRequest" Value="32" /-->
<Setter Property="WidthRequest" Value="120" />
<Setter Property="VerticalOptions" Value="CenterAndExpand" />
<Setter Property="HorizontalOptions" Value="Center" />
<Setter Property="ContentLayout" Value="Left, 8" />
</Style>

<Style x:Key="funcBtn" TargetType="Button">
<!--Setter Property="HeightRequest" Value="32" /-->
<Setter Property="WidthRequest" Value="120" />
<Setter Property="VerticalOptions" Value="CenterAndExpand" />
<Setter Property="HorizontalOptions" Value="Center" />
Expand All @@ -43,6 +41,26 @@
<Setter Property="Orientation" Value="Vertical" />
</Style>

<Style x:Key="InputBlock" TargetType="StackLayout">
<Setter Property="Orientation" Value="Horizontal" />
<Setter Property="Spacing" Value="2" />
<Setter Property="Padding" Value="0" />
</Style>

<Style x:Key="ColorLbl" TargetType="Label">
<Setter Property="HorizontalTextAlignment" Value="Center" />
<Setter Property="VerticalTextAlignment" Value="Center" />
<Setter Property="TextColor" Value="Black" />
<Setter Property="WidthRequest" Value="100" />
<Setter Property="HeightRequest" Value="20" />
</Style>

<Style x:Key="ColorBox" TargetType="Frame">
<Setter Property="Padding" Value="1" />
<Setter Property="BorderColor" Value="Black" />
<Setter Property="CornerRadius" Value="2" />
</Style>

</ResourceDictionary>
</Application.Resources>

Expand Down
55 changes: 55 additions & 0 deletions projects/GKvX/GEDKeeperX/GKUI/Components/ACOptionsControl.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:input="clr-namespace:Plugin.InputKit.Shared.Controls;assembly=Plugin.InputKit"
x:Class="GKUI.Components.ACOptionsControl">

<StackLayout Orientation="Vertical" Padding="8" Spacing="4">

<Grid ColumnSpacing="4" RowSpacing="4">

<Frame Style="{StaticResource ColorBox}" Grid.Column="0" Grid.Row="0">
<Label x:Name="acb0" Style="{StaticResource ColorLbl}" />
</Frame>
<Frame Style="{StaticResource ColorBox}" Grid.Column="1" Grid.Row="0">
<Label x:Name="acb1" Style="{StaticResource ColorLbl}" />
</Frame>
<Frame Style="{StaticResource ColorBox}" Grid.Column="2" Grid.Row="0">
<Label x:Name="acb2" Style="{StaticResource ColorLbl}" />
</Frame>
<Frame Style="{StaticResource ColorBox}" Grid.Column="3" Grid.Row="0">
<Label x:Name="acb3" Style="{StaticResource ColorLbl}" />
</Frame>

<Frame Style="{StaticResource ColorBox}" Grid.Column="0" Grid.Row="1">
<Label x:Name="acb4" Style="{StaticResource ColorLbl}" />
</Frame>
<Frame Style="{StaticResource ColorBox}" Grid.Column="1" Grid.Row="1">
<Label x:Name="acb5" Style="{StaticResource ColorLbl}" />
</Frame>
<Frame Style="{StaticResource ColorBox}" Grid.Column="2" Grid.Row="1">
<Label x:Name="acb6" Style="{StaticResource ColorLbl}" />
</Frame>
<Frame Style="{StaticResource ColorBox}" Grid.Column="3" Grid.Row="1">
<Label x:Name="acb7" Style="{StaticResource ColorLbl}" />
</Frame>

<Frame Style="{StaticResource ColorBox}" Grid.Column="0" Grid.Row="2">
<Label x:Name="acbText" Style="{StaticResource ColorLbl}" TextColor="White" />
</Frame>
<Frame Style="{StaticResource ColorBox}" Grid.Column="1" Grid.Row="2">
<Label x:Name="acbBack" Style="{StaticResource ColorLbl}" />
</Frame>
<Frame Style="{StaticResource ColorBox}" Grid.Column="2" Grid.Row="2">
<Label x:Name="acbLine" Style="{StaticResource ColorLbl}" TextColor="White" />
</Frame>

</Grid>

<input:CheckBox x:Name="chkHideEmptySegments" />
<input:CheckBox x:Name="chkArcText" />

</StackLayout>

</ContentView>
154 changes: 154 additions & 0 deletions projects/GKvX/GEDKeeperX/GKUI/Components/ACOptionsControl.xaml.cs
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
*/

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)));
}
}
}
32 changes: 31 additions & 1 deletion projects/GKvX/GEDKeeperX/GKUI/Components/FilterGridView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,41 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

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)
{
}
}
}
29 changes: 29 additions & 0 deletions projects/GKvX/GEDKeeperX/GKUI/Components/GroupBox.cs
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
*/

using Xamarin.Forms;

namespace GKUI.Components
{
public class GroupBox : ContentView
{
public string Text { get; set; }
}
}
9 changes: 6 additions & 3 deletions projects/GKvX/GEDKeeperX/GKUI/Components/HyperView.xaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="GKUI.Components.HyperView">
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="GKUI.Components.HyperView">

<ContentView.Content>
<Label x:Name="hvContent" TextType="Html" />
</ContentView.Content>

</ContentView>
Loading

0 comments on commit 21f1e39

Please sign in to comment.