Skip to content

Commit

Permalink
GKv3: ported GKCalendarPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Serg-Norseman committed Apr 9, 2023
1 parent 1f4a796 commit 2957db8
Show file tree
Hide file tree
Showing 18 changed files with 570 additions and 48 deletions.
6 changes: 3 additions & 3 deletions clean.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ rmdir .\projects\GKv3\GKComponents\obj /s /q

rem <<< Plugins cleaning >>>

rmdir .\projects\GKv2\GKCalendarPlugin\bin /s /q
rmdir .\projects\GKv2\GKCalendarPlugin\obj /s /q

rmdir .\projects\GKv2\GKFlowInputPlugin\bin /s /q
rmdir .\projects\GKv2\GKFlowInputPlugin\obj /s /q

Expand Down Expand Up @@ -108,6 +105,9 @@ rem <<< Cross-platform Plugins cleaning >>>
rmdir .\projects\plugins\GKCalculatorPlugin\bin /s /q
rmdir .\projects\plugins\GKCalculatorPlugin\obj /s /q

rmdir .\projects\plugins\GKCalendarPlugin\bin /s /q
rmdir .\projects\plugins\GKCalendarPlugin\obj /s /q

rmdir .\projects\plugins\GKStdReports\bin /s /q
rmdir .\projects\plugins\GKStdReports\obj /s /q

Expand Down
2 changes: 1 addition & 1 deletion projects/GKv2/GEDKeeper2.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GKFlowInputPlugin", "GKFlow
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GKCalculatorPlugin", "..\plugins\GKCalculatorPlugin\GKCalculatorPlugin.csproj", "{782E9338-ECA7-4095-9157-6CA003801F05}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GKCalendarPlugin", "GKCalendarPlugin\GKCalendarPlugin.csproj", "{091DFD9D-5599-4EEA-A616-A55FC12E9613}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GKCalendarPlugin", "..\plugins\GKCalendarPlugin\GKCalendarPlugin.csproj", "{091DFD9D-5599-4EEA-A616-A55FC12E9613}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GKLifePlugin", "GKLifePlugin\GKLifePlugin.csproj", "{4A523280-2DEA-43C6-BE11-48BDFF283751}"
EndProject
Expand Down
51 changes: 51 additions & 0 deletions projects/GKv3/GEDKeeper3.sln
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GKStdReports.nstd", "..\plu
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GKCalculatorPlugin.net", "..\plugins\GKCalculatorPlugin\GKCalculatorPlugin.net.csproj", "{3B065DB0-B182-4268-A2A5-2924A9617970}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GKCalendarPlugin.net", "..\plugins\GKCalendarPlugin\GKCalendarPlugin.net.csproj", "{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
FreeBSD_Debug|Any CPU = FreeBSD_Debug|Any CPU
Expand Down Expand Up @@ -454,6 +456,54 @@ Global
{3B065DB0-B182-4268-A2A5-2924A9617970}.MSWin_Release|x64.Build.0 = MSWin_Release|Any CPU
{3B065DB0-B182-4268-A2A5-2924A9617970}.MSWin_Release|x86.ActiveCfg = MSWin_Release|Any CPU
{3B065DB0-B182-4268-A2A5-2924A9617970}.MSWin_Release|x86.Build.0 = MSWin_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.FreeBSD_Debug|Any CPU.ActiveCfg = FreeBSD_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.FreeBSD_Debug|Any CPU.Build.0 = FreeBSD_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.FreeBSD_Debug|x64.ActiveCfg = FreeBSD_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.FreeBSD_Debug|x64.Build.0 = FreeBSD_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.FreeBSD_Debug|x86.ActiveCfg = FreeBSD_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.FreeBSD_Debug|x86.Build.0 = FreeBSD_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.FreeBSD_Release|Any CPU.ActiveCfg = FreeBSD_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.FreeBSD_Release|Any CPU.Build.0 = FreeBSD_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.FreeBSD_Release|x64.ActiveCfg = FreeBSD_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.FreeBSD_Release|x64.Build.0 = FreeBSD_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.FreeBSD_Release|x86.ActiveCfg = FreeBSD_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.FreeBSD_Release|x86.Build.0 = FreeBSD_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.Linux_Debug|Any CPU.ActiveCfg = Linux_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.Linux_Debug|Any CPU.Build.0 = Linux_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.Linux_Debug|x64.ActiveCfg = Linux_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.Linux_Debug|x64.Build.0 = Linux_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.Linux_Debug|x86.ActiveCfg = Linux_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.Linux_Debug|x86.Build.0 = Linux_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.Linux_Release|Any CPU.ActiveCfg = Linux_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.Linux_Release|Any CPU.Build.0 = Linux_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.Linux_Release|x64.ActiveCfg = Linux_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.Linux_Release|x64.Build.0 = Linux_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.Linux_Release|x86.ActiveCfg = Linux_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.Linux_Release|x86.Build.0 = Linux_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MacOS_Debug|Any CPU.ActiveCfg = MacOS_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MacOS_Debug|Any CPU.Build.0 = MacOS_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MacOS_Debug|x64.ActiveCfg = MacOS_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MacOS_Debug|x64.Build.0 = MacOS_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MacOS_Debug|x86.ActiveCfg = MacOS_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MacOS_Debug|x86.Build.0 = MacOS_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MacOS_Release|Any CPU.ActiveCfg = MacOS_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MacOS_Release|Any CPU.Build.0 = MacOS_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MacOS_Release|x64.ActiveCfg = MacOS_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MacOS_Release|x64.Build.0 = MacOS_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MacOS_Release|x86.ActiveCfg = MacOS_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MacOS_Release|x86.Build.0 = MacOS_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MSWin_Debug|Any CPU.ActiveCfg = MSWin_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MSWin_Debug|Any CPU.Build.0 = MSWin_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MSWin_Debug|x64.ActiveCfg = MSWin_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MSWin_Debug|x64.Build.0 = MSWin_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MSWin_Debug|x86.ActiveCfg = MSWin_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MSWin_Debug|x86.Build.0 = MSWin_Debug|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MSWin_Release|Any CPU.ActiveCfg = MSWin_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MSWin_Release|Any CPU.Build.0 = MSWin_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MSWin_Release|x64.ActiveCfg = MSWin_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MSWin_Release|x64.Build.0 = MSWin_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MSWin_Release|x86.ActiveCfg = MSWin_Release|Any CPU
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE}.MSWin_Release|x86.Build.0 = MSWin_Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -464,6 +514,7 @@ Global
{ECED32B7-1081-48D3-A223-1CB67A2D7016} = {B8B3F590-CF25-40FC-8454-D673B594DBF3}
{364F77E2-0ABF-49E6-9BFF-484CA1B8FBE7} = {B8B3F590-CF25-40FC-8454-D673B594DBF3}
{3B065DB0-B182-4268-A2A5-2924A9617970} = {B8B3F590-CF25-40FC-8454-D673B594DBF3}
{58303D52-0C44-4E3A-A8BA-8E75FC4C7AFE} = {B8B3F590-CF25-40FC-8454-D673B594DBF3}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C05CBCB7-0B24-41CC-8BDC-E5BB79045E5D}
Expand Down
92 changes: 92 additions & 0 deletions projects/plugins/GKCalendarPlugin/CalendarWidget.net.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
* "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 Eto.Forms;
using Eto.Serialization.Xaml;
using GKCore;
using GKCore.Interfaces;

namespace GKCalendarPlugin
{
/// <summary>
///
/// </summary>
public partial class CalendarWidget : Form, IWidgetForm
{
#region Design components
#pragma warning disable CS0169, CS0649, IDE0044, IDE0051

private GroupBox grpSourceDate;
private HistoryDateBox historyDateBox1;
private GroupBox grpConvertedDate;
private HistoryDateBox historyDateBox2;

#pragma warning restore CS0169, CS0649, IDE0044, IDE0051
#endregion

private readonly Plugin fPlugin;

public CalendarWidget(Plugin plugin)
{
XamlReader.Load(this);

fPlugin = plugin;

historyDateBox1.DateChanged += hdb_DateChanged;

historyDateBox2.ReadOnly = true;
historyDateBox2.CalendarChanged += hdb_DateChanged;

SetLocale();
}

private void CalendarWidget_Shown(object sender, EventArgs e)
{
AppHost.Instance.WidgetLocate(this, WidgetLocation.HRight | WidgetLocation.VTop);

fPlugin.Host.WidgetShow(fPlugin);
}

private void CalendarWidget_Closed(object sender, EventArgs e)
{
fPlugin.Host.WidgetClose(fPlugin);
}

private void hdb_DateChanged(object sender, EventArgs e)
{
double jd = historyDateBox1.Date;
historyDateBox2.Date = jd;
}

#region ILocalizable support

public void SetLocale()
{
var langMan = fPlugin.LangMan;

Title = langMan.LS(PLS.LSID_MICalendar);
grpSourceDate.Text = langMan.LS(PLS.LSID_SourceDate);
grpConvertedDate.Text = langMan.LS(PLS.LSID_ConvertedDate);
}

#endregion
}
}
23 changes: 23 additions & 0 deletions projects/plugins/GKCalendarPlugin/CalendarWidget.xeto
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<Form xmlns="http://schema.picoe.ca/eto.forms" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:plg="clr-namespace:GKCalendarPlugin"
x:Class="GKCalendarPlugin.CalendarWidget"
Closed="CalendarWidget_Closed" Shown="CalendarWidget_Shown" Maximizable="False" Minimizable="False" Resizable="False" ShowInTaskbar="False" Topmost="True">

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

<GroupBox x:Name="grpSourceDate">
<StackLayout>
<plg:HistoryDateBox x:Name="historyDateBox1" />
</StackLayout>
</GroupBox>

<GroupBox x:Name="grpConvertedDate">
<StackLayout>
<plg:HistoryDateBox x:Name="historyDateBox2" />
</StackLayout>
</GroupBox>

</StackLayout>

</Form>
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,16 @@
*/

using System;
using System.Drawing;
using System.IO;
using System.Reflection;
using GKCore;
using GKCore.Design.Graphics;
using GKCore.Interfaces;
using GKCore.Plugins;
using GKUI.Platform.Handlers;

[assembly: AssemblyTitle("GKCalendarPlugin")]
[assembly: AssemblyDescription("GEDKeeper Calendar plugin")]
[assembly: AssemblyProduct("GEDKeeper")]
[assembly: AssemblyCopyright("Copyright © 2014-2022 by Sergey V. Zhdanovskih")]
[assembly: AssemblyCopyright("Copyright © 2014-2023 by Sergey V. Zhdanovskih")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyCulture("")]

Expand Down Expand Up @@ -120,10 +117,7 @@ public override bool Startup(IHost host)
{
bool result = base.Startup(host);
try {
using (Stream stmIcon = LoadResourceStream("icon_time.gif")) {
Image bmp = Image.FromStream(stmIcon);
fIcon = new ImageHandler(bmp);
}
fIcon = AppHost.GfxProvider.LoadResourceImage(this.GetType(), "GKCalendarPlugin.Resources.icon_time.gif");
} catch (Exception ex) {
Logger.WriteError("GKCalendarPlugin.Startup()", ex);
result = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,17 @@
<SubType>UserControl</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="GKCalendarPlugin.enu">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="GKCalendarPlugin.pol">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="GKCalendarPlugin.rus">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="GKCalendarPlugin.ukr">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<EmbeddedResource Include="Resources\icon_time.gif" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\GKCore\GKCore.csproj">
<Project>{10d619af-e1cd-4f4a-9c19-5e434300b48f}</Project>
<Name>GKCore</Name>
</ProjectReference>
<ProjectReference Include="..\GKComponents\GKComponents.csproj">
<ProjectReference Include="..\..\GKv2\GKComponents\GKComponents.csproj">
<Project>{ef9864c5-4dec-46e8-bc11-a2e5bb9bb9d4}</Project>
<Name>GKComponents</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Import Project="GKCalendarPlugin.props" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
40 changes: 40 additions & 0 deletions projects/plugins/GKCalendarPlugin/GKCalendarPlugin.net.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<AssemblyName>GKCalendarPlugin</AssemblyName>
<RootNamespace>GKCalendarPlugin</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<OutputPath>..\..\..\plugins\</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>

<Configurations>MSWin_Debug;MSWin_Release;Linux_Debug;Linux_Release;MacOS_Debug;MacOS_Release;FreeBSD_Debug;FreeBSD_Release</Configurations>
</PropertyGroup>

<ItemGroup>
<Reference Include="BSLib">
<HintPath>..\..\libs\netstd\BSLib.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\GKCore\GKCore.nstd.csproj" />
<ProjectReference Include="..\..\GKv3\GKComponents\GKComponents.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Eto.Forms" Version="2.7.4" />
<PackageReference Include="Eto.Serialization.Xaml" Version="2.7.4" />
</ItemGroup>

<Import Project="GKCalendarPlugin.props" />

<ItemGroup>
<Compile Include="GKCalendarPlugin.cs" />
<Compile Include="CalendarWidget.net.cs" />
<EmbeddedResource Include="CalendarWidget.xeto" />
<Compile Include="HistoryDateBox.net.cs" />
</ItemGroup>

</Project>
20 changes: 20 additions & 0 deletions projects/plugins/GKCalendarPlugin/GKCalendarPlugin.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<ItemGroup>
<None Include="GKCalendarPlugin.enu">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="GKCalendarPlugin.pol">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="GKCalendarPlugin.rus">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="GKCalendarPlugin.ukr">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<EmbeddedResource Include="Resources\icon_time.gif" />
</ItemGroup>

</Project>
Loading

0 comments on commit 2957db8

Please sign in to comment.