Skip to content

Commit

Permalink
Experimental development (28) (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serg-Norseman committed Oct 30, 2023
1 parent ed65c6f commit d93cb50
Show file tree
Hide file tree
Showing 19 changed files with 114 additions and 69 deletions.
6 changes: 6 additions & 0 deletions locales/help_enu/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

<h1>Change log</h1>

<p>
<b>30.10.2023</b><ul>
<li>First successful launch of GEDKeeperX v3.4.0 on Android.
</ul>
</p>

<p>
<b>28.10.2023 [v2.28.0 &amp; v3.4.0]</b><ul>
<li>Updated Hungarian, German and Icelandic localizations.
Expand Down
6 changes: 6 additions & 0 deletions locales/help_rus/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

<h1>История версий</h1>

<p>
<b>30.10.2023</b><ul>
<li>Первый успешный запуск GEDKeeperX v3.4.0 на Android.
</ul>
</p>

<p>
<b>28.10.2023 [v2.28.0 &amp; v3.4.0]</b><ul>
<li>Обновлены венгерская, немецкая и исландская локализации.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.GEDKeeperX">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.SVZsoft.GEDKeeperX">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29" />
<application android:label="GEDKeeperX.Android"></application>
</manifest>
2 changes: 1 addition & 1 deletion projects/GKvX/GEDKeeperX.iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<key>CFBundleDisplayName</key>
<string>GEDKeeperX</string>
<key>CFBundleIdentifier</key>
<string>com.companyname.GEDKeeperX</string>
<string>com.SVZsoft.GEDKeeperX</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>UILaunchStoryboardName</key>
Expand Down
2 changes: 1 addition & 1 deletion projects/GKvX/GEDKeeperX/GKUI/Components/ArborViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected override ArborEdge CreateEdge(ArborNode src, ArborNode tgt, double len

public sealed class ArborViewer : ContentView, IArborRenderer
{
private SKCanvasView fCanvas;
private readonly SKCanvasView fCanvas;
private bool fEnergyDebug;
private ArborNode fDragged;
private bool fNodesDragging;
Expand Down
42 changes: 38 additions & 4 deletions projects/GKvX/GEDKeeperX/GKUI/Components/GroupBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,25 @@ namespace GKUI.Components
public class GroupBox : ContentView
{
private readonly Frame fContent;
private readonly StackLayout fContentLayout;
private readonly Label fTitle;

public new View Content
{
get { return fContent.Content; }
set { fContent.Content = value; }
get {
return fContent.Content;
}
set {
fContent.Content = value;
}
}

public string Text
{
get { return fTitle.Text; }
set {
fTitle.Text = value;
ForceLayout();
///fTitle.Text = value;
//ForceLayout();
}
}

Expand All @@ -50,13 +55,24 @@ public GroupBox()
Text = "GroupBox",
};

fContentLayout = new StackLayout() {
Orientation = StackOrientation.Vertical,
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand
};

fContent = new Frame() {
//HorizontalOptions = LayoutOptions.FillAndExpand,
//VerticalOptions = LayoutOptions.FillAndExpand,
//Padding = 4
Content = fContentLayout
};

var contentGrid = new Grid() {
RowDefinitions = {
new RowDefinition() { Height = GridLength.Auto },
new RowDefinition() { Height = GridLength.Auto }
}
//Padding = new Thickness(4),
//HorizontalOptions = LayoutOptions.FillAndExpand,
//VerticalOptions = LayoutOptions.FillAndExpand,
Expand All @@ -68,5 +84,23 @@ public GroupBox()

base.Content = contentGrid;
}

/*protected override void OnChildAdded(Element child)
{
View childView = child as View;
if (childView != null) {
((Layout<View>)fContentLayout).Children.Add(childView);
base.OnChildAdded(child);
}
}
protected override void OnChildRemoved(Element child, int oldLogicalIndex)
{
View childView = child as View;
if (childView != null) {
((Layout<View>)fContentLayout).Children.Remove(childView);
base.OnChildRemoved(child, oldLogicalIndex);
}
}*/
}
}
2 changes: 1 addition & 1 deletion projects/GKvX/GEDKeeperX/GKUI/Components/UIHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public static async Task<T> SelectItem<T>(object owner, IEnumerable<T> items)

var title = GKData.APP_TITLE;
string[] strItems = items.Select(x => x.ToString()).ToArray();
string action = await page.DisplayActionSheet(title, "Cancel", null, strItems);
string action = await page.DisplayActionSheet(title, LangMan.LS(LSID.DlgCancel), null, strItems);
return string.IsNullOrEmpty(action) ? default(T) : items.FirstOrDefault(x => x.ToString() == action);
}
}
Expand Down
4 changes: 2 additions & 2 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/AboutPage.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
<forms:CommonDialog
xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:forms="clr-namespace:GKUI.Forms" xmlns:plat="clr-namespace:GKUI.Platform"
x:Class="GKUI.Forms.AboutPage">
Expand Down Expand Up @@ -41,4 +41,4 @@

</StackLayout>

</ContentPage>
</forms:CommonDialog>
3 changes: 2 additions & 1 deletion projects/GKvX/GEDKeeperX/GKUI/Forms/AboutPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@

using System;
using GKCore;
using GKCore.Design.Views;
using GKCore.Options;
using Xamarin.Essentials;
using Xamarin.Forms;

namespace GKUI.Forms
{
public partial class AboutPage : ContentPage
public partial class AboutPage : CommonDialog, IAboutDlg
{
public AboutPage()
{
Expand Down
5 changes: 0 additions & 5 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/BaseWinSDI.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -667,11 +667,6 @@ private void miOptions_Click(object sender, EventArgs e)
AppHost.Instance.ShowOptions(this);
}

private void miFileClose_Click(object sender, EventArgs e)
{
Close();
}

private void miFileNew_Click(object sender, EventArgs e)
{
fController.NewFile();
Expand Down
63 changes: 29 additions & 34 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/CommonForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

using System;
using System.Threading.Tasks;
using GKCore;
using GKCore.Design;
using GKCore.Interfaces;
Expand Down Expand Up @@ -70,13 +71,14 @@ public object GetControl(string controlName)
return FindByName(controlName);
}

public void Close()
public virtual void Close()
{
//base.Close();
Navigation.PopAsync();
}

public void Dispose()
{
// not supported
}

public virtual void ApplyTheme()
Expand Down Expand Up @@ -135,47 +137,45 @@ public class CommonWindow<TView, TController> : CommonWindow
/// </summary>
public class CommonDialog : CommonForm, ICommonDialog
{
/*public DialogResult DialogResult
{
get { return base.Result; }
set {
if (base.Result != value) {
base.Result = value;
if (value != DialogResult.None) {
Close();
}
}
}
}*/
private DialogResult fResult;

public DialogResult DialogResult
{
get { return fResult; }
}

public CommonDialog()
{
fResult = DialogResult.None;
}

public virtual bool ShowModalX(IView owner)
{
XFAppHost.GetMainPage().Navigate(this);
XFAppHost.GetMainPage().Navigation.PushModalAsync(this);
return false;//(ShowModal((Control)owner) == DialogResult.Ok);
}

/*public void Close(DialogResult dialogResult)
public override void Close()
{
Navigation.PopModalAsync();
}

public void Close(DialogResult dialogResult)
{
fResult = dialogResult;
if (fResult != DialogResult.None) {
Close();
Navigation.PopModalAsync();
}
}*/
}

protected async virtual void AcceptClickHandler(object sender, EventArgs e)
{
//Close(DialogResult.Cancel);
await Navigation.PopAsync();
Close(DialogResult.Ok);
}

protected async virtual void CancelClickHandler(object sender, EventArgs e)
{
//Close(DialogResult.Cancel);
await Navigation.PopAsync();
Close(DialogResult.Cancel);
}
}

Expand All @@ -192,9 +192,8 @@ public class CommonDialog<TView, TController> : CommonDialog
protected async override void AcceptClickHandler(object sender, EventArgs e)
{
try {
fController.Accept();
await Navigation.PopAsync();
//DialogResult = fController.Accept() ? DialogResult.Ok : DialogResult.None;
if (fController.Accept())
Close(DialogResult.Ok);
} catch (Exception ex) {
Logger.WriteError("CommonDialog<>.AcceptClickHandler()", ex);
}
Expand All @@ -203,18 +202,14 @@ protected async override void AcceptClickHandler(object sender, EventArgs e)
protected async override void CancelClickHandler(object sender, EventArgs e)
{
try {
fController.Cancel();
await Navigation.PopAsync();
//DialogResult = fController.Cancel() ? DialogResult.Cancel : DialogResult.None;
if (fController.CheckChangesPersistence())
return;

if (fController.Cancel())
Close(DialogResult.Cancel);
} catch (Exception ex) {
Logger.WriteError("CommonDialog<>.CancelClickHandler()", ex);
}
}

/*protected override void OnClosing(CancelEventArgs e)
{
base.OnClosing(e);
e.Cancel = fController.CheckChangesPersistence();
}*/
}
}
16 changes: 6 additions & 10 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/LaunchPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
using System.Linq;
using GKCore;
using GKCore.Controllers;
using GKCore.Names;
using GKUI.Components;
using GKUI.Platform;
using Xamarin.CommunityToolkit.Extensions;
using Xamarin.Forms;

namespace GKUI.Forms
Expand Down Expand Up @@ -90,23 +90,19 @@ public LaunchPage()
new LaunchItem("Test", "Progress", async () => {
XFAppHost.GetMainPage().NavigateAsync(new ProgressDlg());
}),
new LaunchItem("Test", "PatriarchsViewer", async () => {
XFAppHost.GetMainPage().NavigateAsync(new PatriarchsViewerWin());
}),
new LaunchItem("Test", "SexCheckDlg", async () => {
XFAppHost.GetMainPage().NavigateAsync(new SexCheckDlg());
var baseWin = AppHost.Instance.GetCurrentFile() as BaseWinSDI;
baseWin.Context.DefineSex(baseWin, "Ivan", "Ivanovich");
}),
new LaunchItem("Test", "NameEditDlg", async () => {
XFAppHost.GetMainPage().NavigateAsync(new NameEditDlg());
var baseWin = AppHost.Instance.GetCurrentFile() as BaseWinSDI;
var nameEntry = new NameEntry();
BaseController.ModifyName(baseWin, baseWin.Context, ref nameEntry);
}),
new LaunchItem("Test", "PortraitSelectDlg", async () => {
var baseWin = AppHost.Instance.GetCurrentFile() as BaseWinSDI;
XFAppHost.GetMainPage().NavigateAsync(new PortraitSelectDlg(baseWin));
}),
new LaunchItem("Test", "DayTipsDlg", async () => {
var baseWin = AppHost.Instance.GetCurrentFile() as BaseWinSDI;
XFAppHost.GetMainPage().NavigateAsync(new DayTipsDlg());
}),
};

var groups = launchItems.GroupBy(p => p.Group).Select(g => new Grouping<string, LaunchItem>(g.Key, g));
Expand Down
4 changes: 2 additions & 2 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/ProgressDlg.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<forms:CommonForm
<forms:CommonDialog
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:forms="clr-namespace:GKUI.Forms"
Expand Down Expand Up @@ -41,4 +41,4 @@
<input:RadioButton Text="Option 5 Disabled" IsDisabled="True"/>
</input:RadioButtonGroupView>
</StackLayout>
</forms:CommonForm>
</forms:CommonDialog>
2 changes: 1 addition & 1 deletion projects/GKvX/GEDKeeperX/GKUI/Forms/ProgressDlg.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

namespace GKUI.Forms
{
public sealed partial class ProgressDlg : CommonForm, IProgressController
public sealed partial class ProgressDlg : CommonDialog, IProgressController
{
private int fMaximum;
private DateTime fStartTime;
Expand Down
4 changes: 2 additions & 2 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/QuickSearchDlg.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<forms:CommonForm
<forms:CommonDialog
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:forms="clr-namespace:GKUI.Forms" xmlns:plat="clr-namespace:GKUI.Platform"
Expand All @@ -12,4 +12,4 @@
</StackLayout>
</StackLayout>

</forms:CommonForm>
</forms:CommonDialog>
2 changes: 1 addition & 1 deletion projects/GKvX/GEDKeeperX/GKUI/Forms/QuickSearchDlg.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace GKUI.Forms
{
public sealed partial class QuickSearchDlg : CommonForm, IQuickSearchDlg
public sealed partial class QuickSearchDlg : CommonDialog, IQuickSearchDlg
{
private readonly QuickSearchDlgController fController;

Expand Down
Loading

0 comments on commit d93cb50

Please sign in to comment.