Skip to content

Commit

Permalink
Experimental development (30) (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serg-Norseman committed Nov 2, 2023
1 parent 3d5bb8d commit 5ee3c6d
Show file tree
Hide file tree
Showing 40 changed files with 230 additions and 212 deletions.
10 changes: 2 additions & 8 deletions projects/GKCore/GKCore/Controllers/FARDlgController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@
using System;
using BSLib;
using GDModel;
using GKCore.Design.Controls;
using GKCore.Design;
using GKCore.Design.Controls;
using GKCore.Design.Views;
using GKCore.Options;
using GKCore.Search;
using GKCore.Types;

namespace GKCore.Controllers
{
Expand All @@ -53,12 +52,7 @@ public override void SetLocale()
GetControl<ICheckBox>("chkMatchCase").Text = LangMan.LS(LSID.MatchCase);
GetControl<ICheckBox>("chkMatchWildcards").Text = LangMan.LS(LSID.MatchWildcards);
GetControl<ICheckBox>("chkWholeWord").Text = LangMan.LS(LSID.WholeWord);

if (!AppHost.Instance.HasFeatureSupport(Feature.Mobile)) {
GetControl<IGroupBox>("gbFilters").Text = LangMan.LS(LSID.MIFilter);
} else {
GetControl<ILabel>("gbFilters").Text = LangMan.LS(LSID.MIFilter);
}
GetControl<IGroupBox>("gbFilters").Text = LangMan.LS(LSID.MIFilter);
GetControl<ILabel>("lblRecord").Text = LangMan.LS(LSID.Record);
GetControl<ILabel>("lblProperty").Text = LangMan.LS(LSID.Property);

Expand Down
23 changes: 21 additions & 2 deletions projects/GKCore/GKCore/Controllers/FilePropertiesDlgController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,23 @@ public sealed class FilePropertiesDlgController : DialogController<IFileProperti

public FilePropertiesDlgController(IFilePropertiesDlg view) : base(view)
{
if (AppHost.Instance.HasFeatureSupport(Feature.Mobile)) {
var mobileView = view as IMobileFilePropertiesDlg;
for (var lid = GDMLanguageID.Unknown; lid < GDMLanguageID.Yiddish; lid++) {
mobileView.LanguageCombo.AddItem(GEDCOMUtils.GetLanguageStr(lid), lid);
}
}
}

public override bool Accept()
{
try {
fBase.Context.Tree.Header.Language = GEDCOMUtils.GetLanguageVal(fView.Language.Text);
if (!AppHost.Instance.HasFeatureSupport(Feature.Mobile)) {
fBase.Context.Tree.Header.Language = GEDCOMUtils.GetLanguageVal(fView.Language.Text);
} else {
var mobileView = fView as IMobileFilePropertiesDlg;
fBase.Context.Tree.Header.Language = mobileView.LanguageCombo.GetSelectedTag<GDMLanguageID>();
}

GDMSubmitterRecord submitter = fBase.Context.Tree.GetSubmitter();
submitter.Name = fView.Name.Text;
Expand All @@ -64,7 +75,12 @@ public override bool Accept()

public override void UpdateView()
{
fView.Language.Text = GEDCOMUtils.GetLanguageStr(fBase.Context.Tree.Header.Language);
if (!AppHost.Instance.HasFeatureSupport(Feature.Mobile)) {
fView.Language.Text = GEDCOMUtils.GetLanguageStr(fBase.Context.Tree.Header.Language);
} else {
var mobileView = fView as IMobileFilePropertiesDlg;
mobileView.LanguageCombo.Text = GEDCOMUtils.GetLanguageStr(fBase.Context.Tree.Header.Language);
}

GDMSubmitterRecord submitter = fBase.Context.Tree.GetSubmitter();
fView.Name.Text = submitter.Name;
Expand All @@ -84,6 +100,9 @@ public override void UpdateView()

public void ChangeLanguage()
{
if (AppHost.Instance.HasFeatureSupport(Feature.Mobile))
return;

using (var dlg = AppHost.ResolveDialog<ILanguageEditDlg>()) {
dlg.LanguageID = fBase.Context.Tree.Header.Language;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,7 @@ public override void SetLocale()
GetControl<ILabel>("lblLatitude").Text = LangMan.LS(LSID.Latitude);
GetControl<ILabel>("lblLongitude").Text = LangMan.LS(LSID.Longitude);
GetControl<IButton>("btnShowOnMap").Text = LangMan.LS(LSID.Show);

if (!AppHost.Instance.HasFeatureSupport(Feature.Mobile)) {
GetControl<IGroupBox>("grpSearch").Text = LangMan.LS(LSID.SearchCoords);
} else {
GetControl<ILabel>("grpSearch").Text = LangMan.LS(LSID.SearchCoords);
}

GetControl<IGroupBox>("grpSearch").Text = LangMan.LS(LSID.SearchCoords);
GetControl<IButton>("btnSearch").Text = LangMan.LS(LSID.Search);
GetControl<IButton>("btnSelect").Text = LangMan.LS(LSID.SelectCoords);
GetControl<IButton>("btnSelectName").Text = LangMan.LS(LSID.SelectName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public override void UpdateView()

public override void SetLocale()
{
((IView)fView).Title = LangMan.LS(LSID.Source);
fView.Title = LangMan.LS(LSID.Source);

GetControl<IButton>("btnAccept").Text = LangMan.LS(LSID.DlgAccept);
GetControl<IButton>("btnCancel").Text = LangMan.LS(LSID.DlgCancel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public override void SetLocale()
if (!AppHost.Instance.HasFeatureSupport(Feature.Mobile)) {
GetControl<ITabPage>("pageTreeCompare").Text = LangMan.LS(LSID.ToolOp_1);
GetControl<IButton>("btnClose").Text = LangMan.LS(LSID.DlgClose);
GetControl<IGroupBox>("grpMatchType").Text = LangMan.LS(LSID.MatchType);
}
GetControl<IGroupBox>("grpMatchType").Text = LangMan.LS(LSID.MatchType);
GetControl<ILabel>("lblFile").Text = LangMan.LS(LSID.MIFile);
GetControl<IButton>("btnFileChoose").Text = LangMan.LS(LSID.DlgSelect) + @"...";
GetControl<IRadioButton>("radMatchInternal").Text = LangMan.LS(LSID.MatchInternal);
Expand Down
11 changes: 11 additions & 0 deletions projects/GKCore/GKCore/Design/Views/IFilePropertiesDlg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,15 @@ public interface IFilePropertiesDlg : ICommonDialog, IBaseEditor
ITextBox Address { get; }
ITextBox Tel { get; }
}


public interface IDesktopFilePropertiesDlg : IFilePropertiesDlg
{
}


public interface IMobileFilePropertiesDlg : IFilePropertiesDlg
{
IComboBox LanguageCombo { get; }
}
}
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 @@ -143,7 +143,7 @@ private void OnPaint(object sender, SKPaintSurfaceEventArgs args)
try {
SKPaint textPaint = new SKPaint {
Color = SKColors.White,
TextSize = 24.0f
TextSize = (float)Device.GetNamedSize(NamedSize.Default, typeof(Label))
};

foreach (ArborNode node in fSys.Nodes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ protected virtual void OnFontChanged(EventArgs e)

private void PaintHandler(object sender, SKPaintSurfaceEventArgs e)
{
e.Surface.Canvas.Clear();
OnPaint(e);

#if DEBUG_VIEWPORT
Expand Down
4 changes: 2 additions & 2 deletions projects/GKvX/GEDKeeperX/GKUI/Components/TreeChartBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ public TreeChartBox()
fTraceSelected = true;

fTreeControls = new TreeControlsList<ITreeControl>();
fTreeControls.Add(new TCScaleControl(this));
fTreeControls.Add(new TCGenerationsControl(this, TreeChartKind.ckDescendants));
//fTreeControls.Add(new TCScaleControl(this));
//fTreeControls.Add(new TCGenerationsControl(this, TreeChartKind.ckDescendants));
//fPersonControl = new PersonControl(this);

InitTimer();
Expand Down
8 changes: 8 additions & 0 deletions projects/GKvX/GEDKeeperX/GKUI/Components/TreeMapViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public PaintItemEventArgs(SKSurface surface, MapItem item)

public delegate void PaintItemEventHandler(object sender, PaintItemEventArgs args);

/// <summary>
/// TreeMap Viewer's control.
/// </summary>
public class TreeMapViewer : ContentView
{
private MapItem fCurrentItem;
Expand Down Expand Up @@ -150,6 +153,8 @@ public MapItem UpperItem

public TreeMapViewer()
{
fModel = new TreemapModel();
fModel.CreatingItem += CreateSimpleItem;
}

private MapItem CreateSimpleItem(MapItem parent, string name, double size)
Expand All @@ -164,6 +169,9 @@ private List<MapItem> GetRootList()

public void UpdateView()
{
try {
} catch {
}
}
}
}
29 changes: 16 additions & 13 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/AddressEditDlg.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,27 @@
<xp:TabItem x:Name="pageCommon">
<StackLayout Orientation="Vertical">
<Grid ColumnSpacing="4" RowSpacing="4">
<Grid.Children>
<Label x:Name="lblCountry" Grid.Column="0" Grid.Row="0" />
<Entry x:Name="txtCountry" Grid.Column="1" Grid.Row="0" />
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<Label x:Name="lblState" Grid.Column="0" Grid.Row="1" />
<Entry x:Name="txtState" Grid.Column="1" Grid.Row="1" />
<Label x:Name="lblCountry" Grid.Column="0" Grid.Row="0" />
<Entry x:Name="txtCountry" Grid.Column="1" Grid.Row="0" />

<Label x:Name="lblCity" Grid.Column="0" Grid.Row="2" />
<Entry x:Name="txtCity" Grid.Column="1" Grid.Row="2" />
<Label x:Name="lblState" Grid.Column="0" Grid.Row="1" />
<Entry x:Name="txtState" Grid.Column="1" Grid.Row="1" />

<Label x:Name="lblPostalCode" Grid.Column="0" Grid.Row="3" />
<Entry x:Name="txtPostalCode" Grid.Column="1" Grid.Row="3" />
<Label x:Name="lblCity" Grid.Column="0" Grid.Row="2" />
<Entry x:Name="txtCity" Grid.Column="1" Grid.Row="2" />

<Label x:Name="lblAddress" Grid.Column="0" Grid.Row="4" />
<Entry x:Name="txtAddress" Grid.Column="1" Grid.Row="4" />
</Grid.Children>
<Label x:Name="lblPostalCode" Grid.Column="0" Grid.Row="3" />
<Entry x:Name="txtPostalCode" Grid.Column="1" Grid.Row="3" />

<Label x:Name="lblAddress" Grid.Column="0" Grid.Row="4" />
<Entry x:Name="txtAddress" Grid.Column="1" Grid.Row="4" />
</Grid>

<Label VerticalOptions="FillAndExpand" />
</StackLayout>
</xp:TabItem>
Expand Down
4 changes: 0 additions & 4 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/AddressEditDlg.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ ITextBox IAddressEditDlg.AddressLine

#endregion

public AddressEditDlg() : this(null)
{
}

public AddressEditDlg(IBaseWindow baseWin)
{
InitializeComponent();
Expand Down
4 changes: 2 additions & 2 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/AssociationEditDlg.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

<Label x:Name="lblPerson" Grid.Column="0" Grid.Row="1" />
<StackLayout Orientation="Horizontal" Spacing="4" Grid.Column="1" Grid.Row="1">
<Entry x:Name="txtPerson" IsReadOnly="true" />
<Button x:Name="btnPersonAdd" Style="{StaticResource iconBtn}" ImageSource="{plat:ImageResourceExt Resources.btn_rec_new.gif}" Clicked="btnPersonAdd_Click" />
<Entry x:Name="txtPerson" IsReadOnly="true" HorizontalOptions="FillAndExpand" />
<Button x:Name="btnPersonAdd" Style="{StaticResource iconBtn}" ImageSource="{plat:ImageResourceExt Resources.btn_rec_new.gif}" Clicked="btnPersonAdd_Click" HorizontalOptions="End" />
</StackLayout>
</Grid>

Expand Down
8 changes: 4 additions & 4 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/BaseWinSDI.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -836,16 +836,16 @@ void IProgressController.Begin(string title, int maximum, bool cancelable)

void IProgressController.End()
{
/*Device.BeginInvokeOnMainThread(() => {
Device.BeginInvokeOnMainThread(() => {
progressBar.IsVisible = false;
});*/
});
}

void IProgressController.End(ThreadError threadError)
{
/*Device.BeginInvokeOnMainThread(() => {
Device.BeginInvokeOnMainThread(() => {
progressBar.IsVisible = false;
});*/
});
}

void IProgressController.SetText(string text)
Expand Down
5 changes: 1 addition & 4 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/CommonFilterDlg.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,10 @@ public IFilterGridView FilterGrid

#endregion

public CommonFilterDlg()
public CommonFilterDlg(IBaseWindow baseWin, IRecordsListModel listMan)
{
InitializeComponent();
}

public CommonFilterDlg(IBaseWindow baseWin, IRecordsListModel listMan) : this()
{
if (baseWin == null)
throw new ArgumentNullException("baseWin");

Expand Down
2 changes: 1 addition & 1 deletion projects/GKvX/GEDKeeperX/GKUI/Forms/CommonForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public class CommonWindow : CommonForm, IWindow
{
public virtual void Show(bool showInTaskbar)
{
XFAppHost.GetMainPage().Navigate(this);
XFAppHost.GetMainPage().Navigation.PushAsync(this);
}

public virtual void SetLocale()
Expand Down
5 changes: 5 additions & 0 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/EventEditDlg.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<xp:TabItem x:Name="pageCommon">
<StackLayout Orientation="Vertical" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
<Grid ColumnSpacing="4" RowSpacing="4" VerticalOptions="Start" HorizontalOptions="FillAndExpand">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>

<Label x:Name="lblEvent" Grid.Column="0" Grid.Row="0" />
<StackLayout Orientation="Horizontal" Spacing="4" Grid.Column="1" Grid.Row="0">
<comcom:GKComboBox x:Name="cmbEventType" IsReadOnly="True" SelectedIndexChanged="EditEventType_SelectedIndexChanged" />
Expand Down
8 changes: 6 additions & 2 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/FilePropertiesDlg.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<xp:TabItem x:Name="pageAuthor">
<StackLayout Orientation="Vertical">
<Grid ColumnSpacing="4" RowSpacing="4" VerticalOptions="Start">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<Label x:Name="lblName" Grid.Column="0" Grid.Row="0" />
<Entry x:Name="txtName" Grid.Column="1" Grid.Row="0" />

Expand All @@ -28,8 +33,7 @@
<Entry x:Name="txtTel" Grid.Column="1" Grid.Row="2" />

<Label x:Name="lblLanguage" Grid.Column="0" Grid.Row="3" />
<Entry x:Name="txtLanguage" Grid.Column="1" Grid.Row="3" IsReadOnly="True" />
<Button x:Name="btnLangEdit" Grid.Column="2" Grid.Row="3" Style="{StaticResource iconBtn}" ImageSource="{plat:ImageResourceExt Resources.btn_rec_edit.gif}" Clicked="btnLangEdit_Click" />
<comcom:GKComboBox x:Name="txtLanguage" Grid.Column="1" Grid.Row="3" IsReadOnly="True" />
</Grid>

<Label VerticalOptions="FillAndExpand" />
Expand Down
13 changes: 6 additions & 7 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/FilePropertiesDlg.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using GKCore.Controllers;
using GKCore.Design.Controls;
using GKCore.Design.Views;
using GKCore.Interfaces;

namespace GKUI.Forms
{
public sealed partial class FilePropertiesDlg : CommonDialog<IFilePropertiesDlg, FilePropertiesDlgController>, IFilePropertiesDlg
public sealed partial class FilePropertiesDlg : CommonDialog<IFilePropertiesDlg, FilePropertiesDlgController>, IFilePropertiesDlg, IMobileFilePropertiesDlg
{
public IBaseWindow Base
{
Expand All @@ -45,6 +44,11 @@ ITextBox IFilePropertiesDlg.Language
get { return GetControlHandler<ITextBox>(txtLanguage); }
}

IComboBox IMobileFilePropertiesDlg.LanguageCombo
{
get { return GetControlHandler<IComboBox>(txtLanguage); }
}

ITextBox IFilePropertiesDlg.Name
{
get { return GetControlHandler<ITextBox>(txtName); }
Expand All @@ -70,10 +74,5 @@ public FilePropertiesDlg(IBaseWindow baseWin)
fController.Init(baseWin);
fController.UpdateView();
}

private void btnLangEdit_Click(object sender, EventArgs e)
{
fController.ChangeLanguage();
}
}
}
24 changes: 10 additions & 14 deletions projects/GKvX/GEDKeeperX/GKUI/Forms/FindAndReplaceDlg.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,18 @@
<Label VerticalOptions="FillAndExpand" />
</StackLayout>

<StackLayout Orientation="Vertical">
<Label x:Name="gbFilters" />
<Frame>
<Grid ColumnSpacing="4" RowSpacing="4">
<Label x:Name="lblRecord" Grid.Column="0" Grid.Row="0" />
<comcom:GKComboBox x:Name="cmbRecord" Grid.Column="1" Grid.Row="0" />

<Label x:Name="lblProperty" Grid.Column="0" Grid.Row="1" />
<comcom:GKComboBox x:Name="cmbProperty" Grid.Column="1" Grid.Row="1" />
</Grid>
</Frame>
<Label VerticalOptions="FillAndExpand" />
</StackLayout>
<comcom:GroupBox x:Name="gbFilters">
<Grid ColumnSpacing="4" RowSpacing="4">
<Label x:Name="lblRecord" Grid.Column="0" Grid.Row="0" />
<comcom:GKComboBox x:Name="cmbRecord" Grid.Column="1" Grid.Row="0" />

<Label x:Name="lblProperty" Grid.Column="0" Grid.Row="1" />
<comcom:GKComboBox x:Name="cmbProperty" Grid.Column="1" Grid.Row="1" />
</Grid>
</comcom:GroupBox>
</StackLayout>

<Label HorizontalOptions="FillAndExpand" />
<Label VerticalOptions="FillAndExpand" />

<StackLayout Style="{StaticResource dlgFooter}">
<Button x:Name="btnPrev" Style="{StaticResource dlgBtn}" Clicked="btnPrev_Click" />
Expand Down
Loading

0 comments on commit 5ee3c6d

Please sign in to comment.