Skip to content

Commit

Permalink
Experimental development (15) (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serg-Norseman committed Oct 11, 2023
1 parent 1a065d2 commit 71405c3
Show file tree
Hide file tree
Showing 17 changed files with 59 additions and 128 deletions.
2 changes: 1 addition & 1 deletion projects/GKCore/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[assembly: AssemblyDescription("")]
[assembly: AssemblyProduct(GKData.APP_TITLE)]
[assembly: AssemblyCopyright(GKData.APP_COPYRIGHT)]
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyVersion(GKData.APP_VERSION_3X)]
[assembly: AssemblyCulture("")]

#if DEBUG
Expand Down
36 changes: 21 additions & 15 deletions projects/GKCore/GKCore/AppHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,15 @@ public void SaveWinMRU(IBaseWindow baseWin)
if (mf != null) SaveWinState(baseWin, mf);
}

public abstract void SaveWinState(IBaseWindow baseWin, MRUFile mf);
public virtual void SaveWinState(IBaseWindow baseWin, MRUFile mf)
{
// May have a desktop-only implementation
}

public abstract void RestoreWinState(IBaseWindow baseWin, MRUFile mf);
public virtual void RestoreWinState(IBaseWindow baseWin, MRUFile mf)
{
// May have a desktop-only implementation
}

public void RestoreWinMRU(IBaseWindow baseWin)
{
Expand Down Expand Up @@ -321,16 +327,15 @@ public void SaveLastBases()

public abstract bool ExecuteWorkExt(ProgressStart proc, string title);

public abstract void LayoutWindows(WinLayout layout);
public virtual void LayoutWindows(WinLayout layout)
{
// May have a desktop-only implementation
}

#region Extended clipboard functions

public abstract void SetClipboardText(string text);

//public abstract void SetClipboardObject(string objTypeName, string objContent);

//public abstract string GetClipboardObject(string objTypeName);

public void SetClipboardObj<T>(object obj) where T : class
{
/*string objName = obj.GetType().FullName;
Expand Down Expand Up @@ -374,24 +379,22 @@ public T GetClipboardObj<T>() where T : class

#region Executing environment

private static Assembly GetAssembly()
private static Assembly GetImplementationAssembly()
{
Assembly asm = Assembly.GetEntryAssembly();
if (asm == null) {
asm = Assembly.GetExecutingAssembly();
}
Assembly asm = (fInstance != null) ? fInstance.GetType().Assembly : Assembly.GetEntryAssembly();
if (asm == null) asm = Assembly.GetExecutingAssembly();
return asm;
}

public static Version GetAppVersion()
{
var asm = GetAssembly();
var asm = GetImplementationAssembly();
return (asm == null) ? null : asm.GetName().Version;
}

public static string GetAppCopyright()
{
var asm = GetAssembly();
var asm = GetImplementationAssembly();
if (asm == null) {
return string.Empty;
} else {
Expand Down Expand Up @@ -530,7 +533,10 @@ public void WidgetClose(IWidget widget)

public abstract ExtRect GetActiveScreenWorkingArea();

public abstract void WidgetLocate(IWidgetForm view, WidgetLocation location);
public virtual void WidgetLocate(IWidgetForm view, WidgetLocation location)
{
// May have a desktop-only implementation
}

protected ExtPoint WidgetLocate(ExtRect formBounds, WidgetLocation location)
{
Expand Down
5 changes: 3 additions & 2 deletions projects/GKvX/GEDKeeperX.Android/GEDKeeperX.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2291" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2545" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.3" />

<PackageReference Include="Xamarin.Forms.InputKit" Version="3.7.2" />
<PackageReference Include="Xamarin.Forms.DataGrid" Version="4.8.0" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
<PackageReference Include="Xamarin.CommunityToolkit" Version="2.0.6" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.3" />
Expand Down
5 changes: 3 additions & 2 deletions projects/GKvX/GEDKeeperX.UWP/GEDKeeperX.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,11 @@
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2291" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2545" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.3" />

<PackageReference Include="Xamarin.Forms.InputKit" Version="3.7.2" />
<PackageReference Include="Xamarin.Forms.DataGrid" Version="4.8.0" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
<PackageReference Include="Xamarin.CommunityToolkit" Version="2.0.6" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.14" />
</ItemGroup>
Expand Down
5 changes: 3 additions & 2 deletions projects/GKvX/GEDKeeperX.iOS/GEDKeeperX.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,11 @@
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2291" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2545" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.3" />

<PackageReference Include="Xamarin.Forms.InputKit" Version="3.7.2" />
<PackageReference Include="Xamarin.Forms.DataGrid" Version="4.8.0" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
<PackageReference Include="Xamarin.CommunityToolkit" Version="2.0.6" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
Expand Down
5 changes: 3 additions & 2 deletions projects/GKvX/GEDKeeperX/GEDKeeperX.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
<ItemGroup>
<PackageReference Include="System.Text.Encoding.CodePages" Version="7.0.0" />

<PackageReference Include="Xamarin.Forms" Version="5.0.0.2291" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2545" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.3" />

<PackageReference Include="Xamarin.Forms.InputKit" Version="3.7.2" />
<PackageReference Include="Xamarin.Forms.DataGrid" Version="4.8.0" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
<PackageReference Include="Xamarin.CommunityToolkit" Version="2.0.6" />

<PackageReference Include="SkiaSharp.Views.Forms" Version="2.80.2" />
Expand Down
4 changes: 3 additions & 1 deletion projects/GKvX/GEDKeeperX/GKUI/Components/GKListView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,10 @@ public void SelectItem(int index)
item = fListMan.ContentList[index];
}

if (item != null)
if (item != null) {
SelectedItem = item;
ScrollTo(item, ScrollToPosition.MakeVisible, true);
}
}

public void SelectItem(object rowData)
Expand Down
5 changes: 0 additions & 5 deletions projects/GKvX/GEDKeeperX/GKUI/Components/UIHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,5 @@ public static ImageSource LoadResourceImage(Type baseType, string resName)
{
return ImageSource.FromResource(resName, baseType.Assembly);
}

public static void SetClipboardText(string text)
{
Clipboard.SetTextAsync(text);
}
}
}
5 changes: 0 additions & 5 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/AboutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@
BackgroundColor="{StaticResource Primary}" TextColor="White" />
</StackLayout>

<StackLayout Spacing="8" Orientation="Horizontal">
<Label HorizontalOptions="FillAndExpand" />
<Button x:Name="btnClose" Style="{StaticResource dlgBtn}" ImageSource="{plat:ImageResourceExt Resources.btn_accept.gif}" />
</StackLayout>

</StackLayout>

</ContentPage>
9 changes: 4 additions & 5 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/AboutPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using System;
using GKCore;
using GKCore.Options;
using Xamarin.Essentials;
using Xamarin.Forms;

namespace GKUI.Forms
Expand All @@ -31,10 +32,8 @@ public AboutPage()
{
InitializeComponent();

// FontSize="12" FontAttributes="Bold"

Title = LangMan.LS(LSID.MIAbout);
btnClose.Text = LangMan.LS(LSID.DlgClose);
//btnClose.Text = LangMan.LS(LSID.DlgClose);
//lblProduct.Text = GKData.APP_TITLE;
lblVersion.Text = @"Version " + AppHost.GetAppVersion();
lblCopyright.Text = AppHost.GetAppCopyright();
Expand All @@ -48,11 +47,11 @@ public AboutPage()
}
}

private void lblURL_Clicked(object sender, EventArgs e)
private async void lblURL_Clicked(object sender, EventArgs e)
{
var btn = sender as Button;
if (btn != null) {
Device.OpenUri(new Uri(btn.Text));
await Launcher.TryOpenAsync(new Uri(btn.Text));
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion projects/GKvX/GEDKeeperX/GKUI/Forms/LanguageSelectDlg.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
xmlns:forms="clr-namespace:GKUI.Forms" xmlns:plat="clr-namespace:GKUI.Platform" xmlns:comp="clr-namespace:GKUI.Components"
xmlns:mvp="clr-namespace:GKCore.Design.Views;assembly=GKCore" xmlns:contr="clr-namespace:GKCore.Controllers;assembly=GKCore"
x:Class="GKUI.Forms.LanguageSelectDlg" Title="Select language"
x:TypeArguments="mvp:ILanguageSelectDlg, contr:LanguageSelectDlgController">
x:TypeArguments="mvp:ILanguageSelectDlg, contr:LanguageSelectDlgController"
Size="300,300">

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

Expand Down
53 changes: 0 additions & 53 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/LaunchPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,66 +82,13 @@ public LaunchPage()
BindingContext = this;
}

private void Item_Tapped(object sender, EventArgs e)
{
var item = launchList.SelectedItem as LaunchItem;
if (item != null) {
AppHost.StdDialogs.ShowMessage($"Tapped {item.Title}");
//item.Action?.Invoke();
}
/*
<Grid>
<Grid.GestureRecognizers>
<TapGestureRecognizer Tapped="Item_Tapped" />
</Grid.GestureRecognizers>
</Grid>
*/
}

private async void lv_ItemSelected(object sender, SelectedItemChangedEventArgs e)
{
var item = e.SelectedItem as LaunchItem;
item?.Action?.Invoke();
}

/*public void FlowScrollTo(object item)
{
flowListView.FlowScrollTo(item, ScrollToPosition.MakeVisible, true);
}*/
}

/*
<ListView x:Name="launchList" HasUnevenRows="True" ItemsSource="{Binding LaunchItems}" IsGroupingEnabled="True">
<ListView.GroupHeaderTemplate>
<DataTemplate>
<ViewCell>
<Label Text="{Binding Name}" FontSize="Large" Margin="8" />
</ViewCell>
</DataTemplate>
</ListView.GroupHeaderTemplate>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Label Text="{Binding Title}" Margin="6" />
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<CollectionView x:Name="launchList" ItemsSource="{Binding LaunchItems}" IsGrouped="true">
<CollectionView.GroupHeaderTemplate>
<DataTemplate>
<Label Text="{Binding Name}" TextColor="Orange" FontSize="Large" FontAttributes="Bold" Margin="8" />
</DataTemplate>
</CollectionView.GroupHeaderTemplate>
<CollectionView.ItemTemplate>
<DataTemplate>
<Label Text="{Binding Title}" Margin="6" />
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
*/

public class Grouping<K, T> : ObservableCollection<T>
{
public K Name { get; private set; }
Expand Down
6 changes: 0 additions & 6 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/PrintableForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

//define DEBUG_PRINT

using GKCore.Design.Graphics;

namespace GKUI.Forms
Expand All @@ -33,10 +31,6 @@ protected PrintableForm()
{
}

#region Internal print support

#endregion

#region Public interface

protected virtual IPrintable GetPrintable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

using GKCore;
using GKCore.Design.Controls;
using GKUI.Components;
using Xamarin.Forms;

namespace GKUI.Platform
Expand Down Expand Up @@ -86,7 +86,7 @@ private void SetBackColor()

public void Copy()
{
UIHelper.SetClipboardText(SelectedText);
AppHost.Instance.SetClipboardText(SelectedText);
}

public void SelectAll()
Expand Down Expand Up @@ -155,7 +155,7 @@ private void SetBackColor()

public void Copy()
{
UIHelper.SetClipboardText(SelectedText);
AppHost.Instance.SetClipboardText(SelectedText);
}

public void SelectAll()
Expand Down
1 change: 0 additions & 1 deletion projects/GKvX/GEDKeeperX/GKUI/Platform/Sandbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace GKUI.Platform
{
//[Preserve(AllMembers = true)]
[ContentProperty("Source")]
public class ImageResourceExt : IMarkupExtension
{
Expand Down
Loading

0 comments on commit 71405c3

Please sign in to comment.