Beispiel #1
0
        private void InitializeLayout()
        {
            StackLayout layout = new StackLayout()
            {
                // Padding around the table
                Padding = new Eto.Drawing.Padding(3, 5, 3, 0),
                // Spacing between table cells
                HorizontalContentAlignment = HorizontalAlignment.Stretch,
                Items =
                {
                    TableLayout.HorizontalScaled(10,
                                                 new Panel()
                    {
                        Padding = 10,
                        Content = new TableLayout()
                        {
                            Spacing = new Eto.Drawing.Size(1,                   5),
                            Rows    =
                            {
                                new TableRow(new TableCell(m_resetall, true)),
                            }
                        }
                    }
                                                 )
                }
            };

            Content = layout;
        }
Beispiel #2
0
        public DrawableSection()
        {
            Content = new TableLayout
            {
                Padding = new Padding(10),
                Spacing = new Size(10, 10),
                Rows    =
                {
                    TableLayout.HorizontalScaled(
                        10,
                        new TableLayout(
                            "Default",
                            Default()
                            ),
                        new TableLayout(
                            "With Background",
                            WithBackground()
                            )
                        ),

                    new TableLayout(
                        "Large Canvas",
                        // use a separate containing panel to test calculations in those cases
                        new Panel {
                        Content = LargeCanvas()
                    }
                        ),

                    new TableRow(TableLayout.Horizontal(
                                     10,
                                     new TableLayout(
                                         "Nested",
                                         Nested()
                                         ),
                                     new TableLayout(
                                         "Transparent",
                                         Transparent()
                                         ),
                                     new TableLayout(
                                         "Tools",
                                         TableLayout.Horizontal(
                                             Tools(1), Tools(2), Tools(0)
                                             ),
                                         Tools(3),
                                         Tools(0)
                                         )
                                     )),

                    (Platform.SupportedFeatures & PlatformFeatureFlags.DrawableWithTransparentContent) == 0 ?
                    new TableRow(
                        "(Transparent content on drawable not supported on this platform)"
                        ) : null,

                    null
                }
            };
        }
Beispiel #3
0
        public MainForm()
        {
            Title = "Adventure Analyzer";

            _loadCommand = new Command
            {
                MenuText = "Load",
                Enabled  = true,
            };
            _loadCommand.Executed += (sender, args) => Task.Run(LoadData);

            _saveCommand = new Command
            {
                MenuText = "Save",
                Shortcut = Application.Instance.CommonModifier | Keys.S,
                Enabled  = false,
            };
            Menu = new MenuBar
            {
                Items = { _loadCommand, _saveCommand }
            };

            _classes = new ObservableCollection <ClassInfo>();

            var grid = new GridView();

            grid.DataStore = _classes;
            grid.Columns.Add(new GridColumn {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <ClassInfo, string>(r => r.ID)
                },
                HeaderText = "ID"
            });
            grid.Columns.Add(new GridColumn {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <ClassInfo, string>(r => r.Name)
                },
                HeaderText = "Name"
            });
            grid.Columns.Add(new GridColumn {
                DataCell = new CheckBoxCell {
                    Binding = Binding.Property <ClassInfo, bool?>(r => r.IsRoom)
                },
                HeaderText = "Room?"
            });
            grid.Columns.Add(new GridColumn {
                DataCell = new CheckBoxCell {
                    Binding = Binding.Property <ClassInfo, bool?>(r => r.IsItem)
                },
                HeaderText = "Item?"
            });

            var info = new TableLayout();

            Content = TableLayout.HorizontalScaled(grid, info);
        }
 void Setup()
 {
     if (Orientation == Orientation.Vertical)
     {
         Control.Content = new TableLayout(true, upButton, downButton);
     }
     else
     {
         Control.Content = TableLayout.HorizontalScaled(downButton, upButton);
     }
 }
        private void InitializeLayout()
        {
            StackLayout layout = new StackLayout()
            {
                Padding = 10,
                Spacing = 5,
                HorizontalContentAlignment = HorizontalAlignment.Stretch,
                Orientation = Orientation.Vertical,
                Items       =
                {
                    TableLayout.HorizontalScaled(15,                    m_lb_curdev,     m_curdev),
                    new StackLayoutItem(m_tc,                           true),
                    m_for_app ? null : TableLayout.HorizontalScaled(15, m_lb_newdev,     m_newdev),
                    m_for_app ? null : TableLayout.HorizontalScaled(15, m_reset,         m_select),
                    m_for_app ? null : TableLayout.HorizontalScaled(15, m_useAppDevice),
                    m_for_app ? null : TableLayout.HorizontalScaled(15, m_appdev),
                }
            };

            Content = layout;
        }
        private void InitializeComponent()
        {
            SuspendLayout();

            lblMinutes      = new Label();
            lblMinutes.Text = "lblMinutes";

            numASMin          = new NumericUpDown();
            numASMin.MaxValue = 120;
            numASMin.MinValue = 1;
            numASMin.Width    = 60;
            numASMin.Value    = 1;

            chkAutosave      = new CheckBox();
            chkAutosave.Text = "chkAutosave";

            radFBNone      = new RadioButton();
            radFBNone.Text = "radFBNone";

            radFBOnlyPrev      = new RadioButton(radFBNone);
            radFBOnlyPrev.Text = "radFBOnlyPrev";

            radFBEachRevision      = new RadioButton(radFBNone);
            radFBEachRevision.Text = "radFBEachRevision";

            grpFileBackup         = new GroupBox();
            grpFileBackup.Text    = "grpFileBackup";
            grpFileBackup.Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        Cells =  { radFBNone         }
                    },
                    new TableRow {
                        Cells =  { radFBOnlyPrev     }
                    },
                    new TableRow {
                        Cells =  { radFBEachRevision }
                    }
                }
            };

            groupBox1         = new GroupBox();
            groupBox1.Content = new DefTableLayout {
                Rows =
                {
                    new TableRow                {
                        ScaleHeight = true,
                        Cells       =           { grpFileBackup      }
                    },
                    new TableRow                {
                        Cells =
                        {
                            new HDefStackLayout {
                                Items =         { chkAutosave, numASMin, lblMinutes}
                            }
                        }
                    }
                }
            };

            //

            chkUseProxy      = new CheckBox();
            chkUseProxy.Text = "chkUseProxy";

            lblProxyServer      = new Label();
            lblProxyServer.Text = "lblProxyServer";

            lblProxyPort      = new Label();
            lblProxyPort.Text = "lblProxyPort";

            lblProxyLogin      = new Label();
            lblProxyLogin.Text = "lblProxyLogin";

            lblProxyPassword      = new Label();
            lblProxyPassword.Text = "lblProxyPassword";

            txtProxyServer = new TextBox();
            //txtProxyServer.Size = new Size(192, 24);

            txtProxyPort = new TextBox();
            //txtProxyPort.Size = new Size(192, 24);

            txtProxyLogin = new TextBox();
            //txtProxyLogin.Size = new Size(192, 24);

            txtProxyPass = new PasswordBox();
            txtProxyPass.PasswordChar = '*';
            txtProxyPass.Text         = "txtProxyPass";

            grpInternet         = new GroupBox();
            grpInternet.Text    = "grpInternet";
            grpInternet.Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        ScaleHeight = true,
                        Cells       = { chkUseProxy }
                    },
                    new TableRow {
                        Cells =  { lblProxyServer, txtProxyServer}
                    },
                    new TableRow {
                        Cells =  { lblProxyPort, txtProxyPort}
                    },
                    new TableRow {
                        Cells =  { lblProxyLogin, txtProxyLogin}
                    },
                    new TableRow {
                        Cells =  { lblProxyPassword, txtProxyPass}
                    }
                }
            };

            //

            chkLoadRecentFiles      = new CheckBox();
            chkLoadRecentFiles.Text = "chkLoadRecentFiles";

            chkShowOnStart      = new CheckBox();
            chkShowOnStart.Text = "chkShowOnStart";

            lblGeocoder      = new Label();
            lblGeocoder.Text = "lblGeocoder";

            cmbGeocoder          = new ComboBox();
            cmbGeocoder.ReadOnly = true;
            cmbGeocoder.Items.Add("Google");
            cmbGeocoder.Items.Add("Yandex");
            cmbGeocoder.Items.Add("OSM");

            lblLanguage      = new Label();
            lblLanguage.Text = "lblLanguage";

            cmbLanguages          = new ComboBox();
            cmbLanguages.ReadOnly = true;

            grpOther         = new GroupBox();
            grpOther.Text    = "grpOther";
            grpOther.Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        Cells =  { chkLoadRecentFiles}
                    },
                    new TableRow {
                        Cells =  { chkShowOnStart    }
                    },
                    new TableRow {
                        Cells =  { lblLanguage, cmbLanguages}
                    },
                    new TableRow {
                        Cells =  { lblGeocoder, cmbGeocoder}
                    }
                }
            };

            pageCommon         = new TabPage();
            pageCommon.Text    = "pageCommon";
            pageCommon.Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        Cells =  { grpInternet,groupBox1 }
                    },
                    new TableRow {
                        Cells =  { grpOther }
                    },
                    null
                }
            };

            //

            chkAllowMediaDirectRefs      = new CheckBox();
            chkAllowMediaDirectRefs.Text = "chkAllowMediaDirectRefs";

            chkEmbeddedMediaPlayer      = new CheckBox();
            chkEmbeddedMediaPlayer.Text = "chkEmbeddedMediaPlayer";

            chkRemovableMediaWarning      = new CheckBox();
            chkRemovableMediaWarning.Text = "chkRemovableMediaWarning";

            pageMultimedia         = new TabPage();
            pageMultimedia.Text    = "pageMultimedia";
            pageMultimedia.Content = new VDefStackLayout {
                Items = { chkRemovableMediaWarning, chkEmbeddedMediaPlayer, chkAllowMediaDirectRefs }
            };

            //

            chkSurname      = new CheckBox();
            chkSurname.Text = "chkSurname";

            chkName      = new CheckBox();
            chkName.Text = "chkName";

            chkPatronymic      = new CheckBox();
            chkPatronymic.Text = "chkPatronymic";

            chkDiffLines      = new CheckBox();
            chkDiffLines.Text = "chkDiffLines";

            chkBirthDate      = new CheckBox();
            chkBirthDate.Text = "chkBirthDate";

            chkDeathDate      = new CheckBox();
            chkDeathDate.Text = "chkDeathDate";

            chkKinship      = new CheckBox();
            chkKinship.Text = "chkKinship";

            chkDefaultPortraits      = new CheckBox();
            chkDefaultPortraits.Text = "chkDefaultPortraits";

            chkOnlyYears      = new CheckBox();
            chkOnlyYears.Text = "chkOnlyYears";

            chkSignsVisible      = new CheckBox();
            chkSignsVisible.Text = "chkSignsVisible";

            chkChildlessExclude      = new CheckBox();
            chkChildlessExclude.Text = "chkChildlessExclude";

            chkTreeDecorative      = new CheckBox();
            chkTreeDecorative.Text = "chkTreeDecorative";

            chkPortraitsVisible                 = new CheckBox();
            chkPortraitsVisible.Text            = "chkPortraitsVisible";
            chkPortraitsVisible.CheckedChanged += chkPortraitsVisible_CheckedChanged;

            grpTreePersons         = new GroupBox();
            grpTreePersons.Text    = "grpTreePersons";
            grpTreePersons.Content = new VDefStackLayout {
                Items = { chkSurname, chkName,         chkPatronymic,     chkDiffLines,        chkBirthDate,        chkDeathDate, chkOnlyYears,
                          chkKinship, chkSignsVisible, chkTreeDecorative, chkPortraitsVisible, chkDefaultPortraits,
                          chkChildlessExclude }
            };

            //

            lblMaleColor                   = new Label();
            lblMaleColor.Size              = new Size(100, 26);
            lblMaleColor.Text              = "lblMaleColor";
            lblMaleColor.TextAlignment     = TextAlignment.Center;
            lblMaleColor.VerticalAlignment = VerticalAlignment.Center;
            lblMaleColor.MouseDown        += PanColor_Click;
            lblMaleColor.Cursor            = Cursors.Pointer;

            panMaleColor         = new Scrollable();
            panMaleColor.Border  = BorderType.Bezel;
            panMaleColor.Content = lblMaleColor;

            lblFemaleColor                   = new Label();
            lblFemaleColor.Size              = new Size(100, 26);
            lblFemaleColor.Text              = "lblFemaleColor";
            lblFemaleColor.TextAlignment     = TextAlignment.Center;
            lblFemaleColor.VerticalAlignment = VerticalAlignment.Center;
            lblFemaleColor.MouseDown        += PanColor_Click;
            lblFemaleColor.Cursor            = Cursors.Pointer;

            panFemaleColor         = new Scrollable();
            panFemaleColor.Border  = BorderType.Bezel;
            panFemaleColor.Content = lblFemaleColor;

            lblUnkSexColor                   = new Label();
            lblUnkSexColor.Size              = new Size(210, 26);
            lblUnkSexColor.Text              = "label7";
            lblUnkSexColor.TextAlignment     = TextAlignment.Center;
            lblUnkSexColor.VerticalAlignment = VerticalAlignment.Center;
            lblUnkSexColor.MouseDown        += PanColor_Click;
            lblUnkSexColor.Cursor            = Cursors.Pointer;

            panUnkSexColor         = new Scrollable();
            panUnkSexColor.Border  = BorderType.Bezel;
            panUnkSexColor.Content = lblUnkSexColor;

            lblUnHusbandColor                   = new Label();
            lblUnHusbandColor.Size              = new Size(210, 26);
            lblUnHusbandColor.Text              = "lblUnHusbandColor";
            lblUnHusbandColor.TextAlignment     = TextAlignment.Center;
            lblUnHusbandColor.VerticalAlignment = VerticalAlignment.Center;
            lblUnHusbandColor.MouseDown        += PanColor_Click;
            lblUnHusbandColor.Cursor            = Cursors.Pointer;

            panUnHusbandColor         = new Scrollable();
            panUnHusbandColor.Border  = BorderType.Bezel;
            panUnHusbandColor.Content = lblUnHusbandColor;

            lblUnWifeColor                   = new Label();
            lblUnWifeColor.Size              = new Size(210, 26);
            lblUnWifeColor.Text              = "lblUnWifeColor";
            lblUnWifeColor.TextAlignment     = TextAlignment.Center;
            lblUnWifeColor.VerticalAlignment = VerticalAlignment.Center;
            lblUnWifeColor.MouseDown        += PanColor_Click;
            lblUnWifeColor.Cursor            = Cursors.Pointer;

            panUnWifeColor         = new Scrollable();
            panUnWifeColor.Border  = BorderType.Bezel;
            panUnWifeColor.Content = lblUnWifeColor;

            lblChartFont                   = new Label();
            lblChartFont.Size              = new Size(210, 26);
            lblChartFont.Text              = "lblChartFont";
            lblChartFont.TextAlignment     = TextAlignment.Center;
            lblChartFont.VerticalAlignment = VerticalAlignment.Center;
            lblChartFont.MouseDown        += panDefFont_Click;
            lblChartFont.Cursor            = Cursors.Pointer;

            panDefFont         = new Scrollable();
            panDefFont.Border  = BorderType.Bezel;
            panDefFont.Content = lblChartFont;

            grpTreeDecor         = new GroupBox();
            grpTreeDecor.Text    = "grpTreeDecor";
            grpTreeDecor.Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        Cells =  { TableLayout.HorizontalScaled(10,panMaleColor, panFemaleColor) }
                    },
                    new TableRow {
                        Cells =  { panUnkSexColor }
                    },
                    new TableRow {
                        Cells =  { panUnHusbandColor,              }
                    },
                    new TableRow {
                        Cells =  { panUnWifeColor }
                    },
                    new TableRow {
                        ScaleHeight = false,
                        Cells       = { panDefFont }
                    },
                    null
                }
            };

            //

            pageTreeChart         = new TabPage();
            pageTreeChart.Text    = "pageTreeChart";
            pageTreeChart.Content = new HDefStackLayout {
                Items = { grpTreePersons, grpTreeDecor }
            };

            //

            ancOptionsControl1         = new GKUI.Components.ACOptionsControl();
            ancOptionsControl1.Options = null;

            pageAncCircle         = new TabPage();
            pageAncCircle.Content = ancOptionsControl1;
            pageAncCircle.Text    = "pageAncCircle";

            //

            tabsCharts = new TabControl();
            tabsCharts.Pages.Add(pageTreeChart);
            tabsCharts.Pages.Add(pageAncCircle);

            pageCharts         = new TabPage();
            pageCharts.Content = tabsCharts;
            pageCharts.Text    = "pageCharts";

            //

            lstPersonColumns = new GKListView();
            //lstPersonColumns.Size = new Size(468, 409);
            //lstPersonColumns.ItemCheck += new ItemCheckEventHandler(ListPersonColumns_ItemCheck);

            btnColumnUp        = new Button();
            btnColumnUp.Size   = new Size(26, 26);
            btnColumnUp.Click += btnColumnUp_Click;

            btnColumnDown        = new Button();
            btnColumnDown.Size   = new Size(26, 26);
            btnColumnDown.Click += btnColumnDown_Click;

            btnDefList        = new Button();
            btnDefList.Size   = new Size(190, 26);
            btnDefList.Text   = "btnDefList";
            btnDefList.Click += btnDefList_Click;

            panel1         = new Panel();
            panel1.Width   = 210;
            panel1.Content = new VDefStackLayout {
                Items = { btnColumnUp, btnColumnDown, null, btnDefList }
            };

            pageViewPersons         = new TabPage();
            pageViewPersons.Text    = "pageViewPersons";
            pageViewPersons.Content = TableLayout.Horizontal(10, new TableCell(lstPersonColumns, true), panel1);

            //

            radS_N_P      = new RadioButton();
            radS_N_P.Text = "radS_N_P";

            radS_NP      = new RadioButton(radS_N_P);
            radS_NP.Text = "radS_NP";

            radSNP      = new RadioButton(radS_N_P);
            radSNP.Text = "radSNP";

            rgFNPFormat         = new GroupBox();
            rgFNPFormat.Text    = "rgFNPFormat";
            rgFNPFormat.Content = new VDefStackLayout {
                Items = { radS_N_P, radS_NP, radSNP }
            };

            //

            radDMY      = new RadioButton();
            radDMY.Text = "DD.MM.YYYY";

            radYMD      = new RadioButton(radDMY);
            radYMD.Text = "YYYY.MM.DD";

            chkShowDatesSigns      = new CheckBox();
            chkShowDatesSigns.Text = "chkShowDatesSigns";

            chkShowDatesCalendar      = new CheckBox();
            chkShowDatesCalendar.Text = "chkShowDatesCalendar";

            grpDateFormat         = new GroupBox();
            grpDateFormat.Text    = "grpDateFormat";
            grpDateFormat.Content = new VDefStackLayout {
                Items = { radDMY, radYMD, null, chkShowDatesSigns, chkShowDatesCalendar }
            };

            //

            radMarried      = new RadioButton();
            radMarried.Text = "radMarried";

            radMaiden      = new RadioButton(radMarried);
            radMaiden.Text = "radMaiden";

            radMarried_Maiden      = new RadioButton(radMarried);
            radMarried_Maiden.Text = "radMarried_Maiden";

            radMaiden_Married      = new RadioButton(radMarried);
            radMaiden_Married.Text = "radMaiden_Married";

            chkExtendWomanSurnames                 = new CheckBox();
            chkExtendWomanSurnames.Text            = "ExtendWomanSurnames";
            chkExtendWomanSurnames.CheckedChanged += chkExtendWomanSurnames_CheckedChanged;

            grpAdvancedNames         = new GroupBox();
            grpAdvancedNames.Text    = "AdvancedNames";
            grpAdvancedNames.Content = new VDefStackLayout {
                Items = { chkExtendWomanSurnames, radMaiden_Married, radMarried_Maiden, radMaiden, radMarried }
            };

            //

            chkPlacesWithAddress      = new CheckBox();
            chkPlacesWithAddress.Text = "chkPlacesWithAddress";

            chkHighlightUnparented      = new CheckBox();
            chkHighlightUnparented.Text = "chkHighlightUnparented";

            chkHighlightUnmarried      = new CheckBox();
            chkHighlightUnmarried.Text = "chkHighlightUnmarried";

            //

            pageViewCommon         = new TabPage();
            pageViewCommon.Text    = "pageViewCommon";
            pageViewCommon.Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        Cells =  { rgFNPFormat,          grpDateFormat         }
                    },
                    new TableRow {
                        Cells =  { grpAdvancedNames, new VDefStackLayout     {
                                       Items = { chkPlacesWithAddress, chkHighlightUnparented, chkHighlightUnmarried }
                                   } }
                    },
                    null
                }
            };

            //

            PageControl2 = new TabControl();
            PageControl2.Pages.Add(pageViewCommon);
            PageControl2.Pages.Add(pageViewPersons);

            pageUIView         = new TabPage();
            pageUIView.Content = PageControl2;
            pageUIView.Text    = "pageUIView";

            //

            radExcess      = new RadioButton();
            radExcess.Text = "radExcess";

            radCompact      = new RadioButton(radExcess);
            radCompact.Text = "radCompact";

            grpPedigreeFormat         = new GroupBox();
            grpPedigreeFormat.Text    = "grpPedigreeFormat";
            grpPedigreeFormat.Content = new VDefStackLayout {
                Items = { radExcess, radCompact }
            };

            //

            chkAttributes      = new CheckBox();
            chkAttributes.Text = "chkAttributes";

            chkNotes      = new CheckBox();
            chkNotes.Text = "chkNotes";

            chkGenerations      = new CheckBox();
            chkGenerations.Text = "chkGenerations";

            chkSources      = new CheckBox();
            chkSources.Text = "chkSources";

            grpPedigree         = new GroupBox();
            grpPedigree.Text    = "grpPedigree";
            grpPedigree.Content = new VDefStackLayout {
                Items = { chkAttributes, chkNotes, chkSources, chkGenerations, grpPedigreeFormat }
            };

            pagePedigree         = new TabPage();
            pagePedigree.Content = grpPedigree;
            pagePedigree.Text    = "pagePedigree";

            //

            lvPlugins = new GKListView();

            pagePlugins         = new TabPage();
            pagePlugins.Content = lvPlugins;
            pagePlugins.Text    = "pagePlugins";

            //

            PageControl1 = new TabControl();
            PageControl1.Pages.Add(pageCommon);
            PageControl1.Pages.Add(pageMultimedia);
            PageControl1.Pages.Add(pageCharts);
            PageControl1.Pages.Add(pageUIView);
            PageControl1.Pages.Add(pagePedigree);
            PageControl1.Pages.Add(pagePlugins);

            btnAccept = new Button();
            btnAccept.ImagePosition = ButtonImagePosition.Left;
            btnAccept.Size          = new Size(130, 26);
            btnAccept.Text          = "btnAccept";
            btnAccept.Click        += btnAccept_Click;

            btnCancel = new Button();
            btnCancel.ImagePosition = ButtonImagePosition.Left;
            btnCancel.Size          = new Size(130, 26);
            btnCancel.Text          = "btnCancel";
            btnCancel.Click        += CancelClickHandler;

            Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        ScaleHeight = true,
                        Cells       = { PageControl1 }
                    },
                    UIHelper.MakeDialogFooter(null, btnAccept, btnCancel)
                }
            };

            DefaultButton = btnAccept;
            AbortButton   = btnCancel;
            Title         = "OptionsDlg";

            SetPredefProperties(740, 560);
            ResumeLayout();
        }
Beispiel #7
0
        private void InitializeComponent()
        {
            SuspendLayout();

            radMatchInternal                 = new RadioButton();
            radMatchInternal.Checked         = true;
            radMatchInternal.Text            = "radMatchInternal";
            radMatchInternal.CheckedChanged += rbtnMatch_CheckedChanged;

            radMathExternal                 = new RadioButton(radMatchInternal);
            radMathExternal.Text            = "radMathExternal";
            radMathExternal.CheckedChanged += rbtnMatch_CheckedChanged;

            radAnalysis                 = new RadioButton(radMatchInternal);
            radAnalysis.Text            = "radAnalysis";
            radAnalysis.CheckedChanged += rbtnMatch_CheckedChanged;

            lblFile         = new Label();
            lblFile.Enabled = false;
            lblFile.Text    = "lblFile";

            txtCompareFile          = new TextBox();
            txtCompareFile.Enabled  = false;
            txtCompareFile.ReadOnly = true;
            txtCompareFile.Width    = 500;

            btnFileChoose         = new Button();
            btnFileChoose.Enabled = false;
            btnFileChoose.Size    = new Size(130, 26);
            btnFileChoose.Text    = "btnFileChoose";
            btnFileChoose.Click  += btnFileChoose_Click;

            btnMatch        = new Button();
            btnMatch.Size   = new Size(130, 26);
            btnMatch.Text   = "btnMatch";
            btnMatch.Click += btnMatch_Click;

            grpMatchType         = new GroupBox();
            grpMatchType.Text    = "grpMatchType";
            grpMatchType.Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        Cells =  { radMatchInternal}
                    },
                    new TableRow {
                        ScaleHeight = true,
                        Cells       = { TableLayout.Horizontal(10, radMathExternal, txtCompareFile, null, btnFileChoose) }
                    },
                    new TableRow {
                        Cells =  { TableLayout.Horizontal(10, radAnalysis, null, btnMatch)}
                    }
                }
            };

            ListCompare          = new GKUI.Components.TextBoxEx();
            ListCompare.ReadOnly = true;

            pageTreeCompare         = new TabPage();
            pageTreeCompare.Text    = "pageTreeCompare";
            pageTreeCompare.Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        Cells =  { grpMatchType}
                    },
                    new TableRow {
                        ScaleHeight = true,
                        Cells       = { ListCompare }
                    }
                }
            };

            //

            lblMasterBase = new Label();
            //lblMasterBase.Size = new Size(88, 17);
            lblMasterBase.Text = "lblMasterBase";

            lblOtherBase = new Label();
            //lblOtherBase.Size = new Size(122, 17);
            lblOtherBase.Text = "lblOtherBase";

            edMasterBase = new TextBox();
            edMasterBase.BackgroundColor = SystemColors.Control;
            edMasterBase.ReadOnly        = true;
            //edMasterBase.Size = new Size(853, 24);
            edMasterBase.Text = "edMasterBase";

            edUpdateBase          = new TextBox();
            edUpdateBase.ReadOnly = true;
            edUpdateBase.Width    = 600;

            btnTreeMerge        = new Button();
            btnTreeMerge.Size   = new Size(130, 26);
            btnTreeMerge.Text   = "btnTreeMerge";
            btnTreeMerge.Click += btnTreeMerge_Click;

            mSyncRes          = new GKUI.Components.TextBoxEx();
            mSyncRes.ReadOnly = true;

            pageTreeMerge         = new TabPage();
            pageTreeMerge.Text    = "pageTreeMerge";
            pageTreeMerge.Content = new DefTableLayout {
                Rows =
                {
                    new DefTableLayout   {
                        Rows =
                        {
                            new TableRow {
                                Cells =  { lblMasterBase, edMasterBase }
                            },
                            new TableRow {
                                Cells =  { lblOtherBase,  TableLayout.Horizontal(10, edUpdateBase, btnTreeMerge)}
                            }
                        }
                    },
                    mSyncRes
                }
            };

            //

            ListSelected = new ListBox();

            ListSkipped = new ListBox();

            btnSelectAll        = new Button();
            btnSelectAll.Size   = new Size(130, 26);
            btnSelectAll.Text   = "btnSelectAll";
            btnSelectAll.Click += btnSelectAll_Click;

            btnSelectFamily        = new Button();
            btnSelectFamily.Size   = new Size(130, 26);
            btnSelectFamily.Text   = "btnSelectFamily";
            btnSelectFamily.Click += btnSelectFamily_Click;

            btnSelectAncestors        = new Button();
            btnSelectAncestors.Size   = new Size(130, 26);
            btnSelectAncestors.Text   = "btnSelectAncestors";
            btnSelectAncestors.Click += btnSelectAncestors_Click;

            btnSelectDescendants        = new Button();
            btnSelectDescendants.Size   = new Size(130, 26);
            btnSelectDescendants.Text   = "btnSelectDescendants";
            btnSelectDescendants.Click += btnSelectDescendants_Click;

            btnDelete        = new Button();
            btnDelete.Size   = new Size(130, 26);
            btnDelete.Text   = "btnDelete";
            btnDelete.Click += btnDelete_Click;

            btnSave        = new Button();
            btnSave.Size   = new Size(130, 26);
            btnSave.Text   = "btnSave";
            btnSave.Click += btnSave_Click;

            pageTreeSplit         = new TabPage();
            pageTreeSplit.Text    = "pageTreeSplit";
            pageTreeSplit.Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        ScaleHeight = true,
                        Cells       = { TableLayout.HorizontalScaled(10, ListSelected, ListSkipped) }
                    },
                    UIHelper.MakeDialogFooter(btnSelectAll, btnSelectFamily, btnSelectAncestors, btnSelectDescendants, null, btnSave, btnDelete)
                }
            };

            //

            MergeCtl           = new GKUI.Components.GKMergeControl();
            MergeCtl.Base      = null;
            MergeCtl.Bookmark  = false;
            MergeCtl.MergeMode = GKCommon.GEDCOM.GEDCOMRecordType.rtNone;

            btnAutoSearch        = new Button();
            btnAutoSearch.Size   = new Size(130, 26);
            btnAutoSearch.Text   = "btnAutoSearch";
            btnAutoSearch.Click += btnSearch_Click;

            btnSkip        = new Button();
            btnSkip.Size   = new Size(130, 26);
            btnSkip.Text   = "btnSkip";
            btnSkip.Click += btnSkip_Click;

            ProgressBar1      = new ProgressBar();
            ProgressBar1.Size = new Size(700, 26);

            pageMerge         = new TabPage();
            pageMerge.Text    = "pageMerge";
            pageMerge.Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        ScaleHeight = true,
                        Cells       = { MergeCtl }
                    },
                    UIHelper.MakeDialogFooter(btnAutoSearch, btnSkip, null, ProgressBar1)
                }
            };

            //

            radPersons         = new RadioButton();
            radPersons.Checked = true;
            radPersons.Text    = "radPersons";
            radPersons.Click  += radMergeMode_Click;

            radFamilies        = new RadioButton(radPersons);
            radFamilies.Text   = "radFamilies";
            radFamilies.Click += radMergeMode_Click;

            radNotes        = new RadioButton(radPersons);
            radNotes.Text   = "radNotes";
            radNotes.Click += radMergeMode_Click;

            radSources        = new RadioButton(radPersons);
            radSources.Text   = "radSources";
            radSources.Click += radMergeMode_Click;

            rgMode         = new GroupBox();
            rgMode.Text    = "rgMode";
            rgMode.Content = new VDefStackLayout {
                Items = { radPersons, radFamilies, radNotes, radSources }
            };

            lblNameAccuracy = new Label();
            //lblNameAccuracy.Size = new Size(152, 15);
            lblNameAccuracy.Text = "lblNameAccuracy";

            lblYearInaccuracy = new Label();
            //lblYearInaccuracy.Size = new Size(152, 16);
            lblYearInaccuracy.Text = "lblYearInaccuracy";

            chkIndistinctMatching = new CheckBox();
            //chkIndistinctMatching.Size = new Size(371, 21);
            chkIndistinctMatching.Text = "chkIndistinctMatching";

            edNameAccuracy = new NumericUpDown();
            //edNameAccuracy.Size = new Size(152, 24);
            edNameAccuracy.Value = 90;

            edYearInaccuracy = new NumericUpDown();
            //edYearInaccuracy.Size = new Size(152, 24);
            edYearInaccuracy.Value = 3;

            chkBirthYear = new CheckBox();
            //chkBirthYear.Size = new Size(371, 21);
            chkBirthYear.Text = "chkBirthYear";

            grpSearchPersons         = new GroupBox();
            grpSearchPersons.Text    = "grpSearchPersons";
            grpSearchPersons.Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        Cells =  { chkIndistinctMatching,null             }
                    },
                    new TableRow {
                        Cells =  { lblNameAccuracy,      edNameAccuracy   }
                    },
                    new TableRow {
                        Cells =  { chkBirthYear,         null             }
                    },
                    new TableRow {
                        Cells =  { lblYearInaccuracy,    edYearInaccuracy }
                    }
                }
            };

            chkBookmarkMerged = new CheckBox();
            //chkBookmarkMerged.Size = new Size(319, 24);
            chkBookmarkMerged.Text            = "chkBookmarkMerged";
            chkBookmarkMerged.CheckedChanged += chkBookmarkMerged_CheckedChanged;

            grpMergeOther         = new GroupBox();
            grpMergeOther.Text    = "grpMergeOther";
            grpMergeOther.Content = chkBookmarkMerged;

            pageMergeOptions         = new TabPage();
            pageMergeOptions.Text    = "pageMergeOptions";
            pageMergeOptions.Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        Cells =  { rgMode,        grpSearchPersons }
                    },
                    new TableRow {
                        Cells =  { grpMergeOther, null             }
                    },
                    null
                }
            };

            PageControl1 = new TabControl();
            PageControl1.Pages.Add(pageMerge);
            PageControl1.Pages.Add(pageMergeOptions);

            pageRecMerge         = new TabPage();
            pageRecMerge.Content = PageControl1;
            pageRecMerge.Text    = "pageRecMerge";

            //

            gkLogChart1                = new GKUI.Components.LogChart();
            gkLogChart1.Height         = 34;
            gkLogChart1.OnHintRequest += HintRequestEventHandler;

            tvGroups                   = new TreeView();
            tvGroups.LabelEdit         = false;
            tvGroups.MouseDoubleClick += tvGroups_DoubleClick;

            btnAnalyseGroups        = new Button();
            btnAnalyseGroups.Size   = new Size(130, 26);
            btnAnalyseGroups.Text   = "btnSkip";
            btnAnalyseGroups.Click += btnAnalyseGroups_Click;

            pageFamilyGroups         = new TabPage();
            pageFamilyGroups.Text    = "pageFamilyGroups";
            pageFamilyGroups.Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        ScaleHeight = true,
                        Cells       = { tvGroups }
                    },
                    new TableRow {
                        ScaleHeight = false,
                        Cells       = { TableLayout.Horizontal(10, btnAnalyseGroups, new TableCell(gkLogChart1, true)) }
                    }
                }
            };

            //

            btnCheckBase        = new Button();
            btnCheckBase.Size   = new Size(130, 26);
            btnCheckBase.Text   = "btnSkip";
            btnCheckBase.Click += btnCheckBase_Click;

            btnBaseRepair        = new Button();
            btnBaseRepair.Size   = new Size(130, 26);
            btnBaseRepair.Text   = "btnBaseRepair";
            btnBaseRepair.Click += btnBaseRepair_Click;

            panProblemsContainer = new Panel();

            pageTreeCheck         = new TabPage();
            pageTreeCheck.Text    = "pageTreeCheck";
            pageTreeCheck.Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        ScaleHeight = true,
                        Cells       = { panProblemsContainer }
                    },
                    UIHelper.MakeDialogFooter(btnCheckBase, null, btnBaseRepair)
                }
            };

            //

            btnPatriarchsDiagram        = new Button();
            btnPatriarchsDiagram.Size   = new Size(130, 26);
            btnPatriarchsDiagram.Text   = "btnPatriarchsDiagram";
            btnPatriarchsDiagram.Click += btnPatriarchsDiagram_Click;

            chkWithoutDates      = new CheckBox();
            chkWithoutDates.Text = "chkWithoutDates";

            lblMinGenerations      = new Label();
            lblMinGenerations.Text = "lblMinGenerations";

            btnPatSearch        = new Button();
            btnPatSearch.Size   = new Size(130, 26);
            btnPatSearch.Text   = "btnPatSearch";
            btnPatSearch.Click += btnPatSearch_Click;

            panPatriarchsContainer = new Panel();

            edMinGens       = new NumericUpDown();
            edMinGens.Value = 2;

            btnSetPatriarch        = new Button();
            btnSetPatriarch.Size   = new Size(130, 26);
            btnSetPatriarch.Text   = "btnSetPatriarch";
            btnSetPatriarch.Click += btnSetPatriarch_Click;

            pagePatSearch         = new TabPage();
            pagePatSearch.Text    = "pagePatSearch";
            pagePatSearch.Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        ScaleHeight = true,
                        Cells       = { panPatriarchsContainer }
                    },
                    UIHelper.MakeDialogFooter(lblMinGenerations, edMinGens, chkWithoutDates, null, btnSetPatriarch, btnPatSearch, btnPatriarchsDiagram)
                }
            };

            //

            panPlacesContainer = new Panel();

            btnAnalysePlaces        = new Button();
            btnAnalysePlaces.Size   = new Size(130, 26);
            btnAnalysePlaces.Text   = "btnSkip";
            btnAnalysePlaces.Click += btnAnalysePlaces_Click;

            btnIntoList        = new Button();
            btnIntoList.Size   = new Size(160, 26);
            btnIntoList.Text   = "btnIntoList";
            btnIntoList.Click += btnIntoList_Click;

            pagePlaceManage         = new TabPage();
            pagePlaceManage.Text    = "pagePlaceManage";
            pagePlaceManage.Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        ScaleHeight = true,
                        Cells       = { panPlacesContainer }
                    },
                    UIHelper.MakeDialogFooter(btnAnalysePlaces, null, btnIntoList)
                }
            };

            //

            tabsTools = new TabControl();
            tabsTools.Pages.Add(pageTreeCompare);
            tabsTools.Pages.Add(pageTreeMerge);
            tabsTools.Pages.Add(pageTreeSplit);
            tabsTools.Pages.Add(pageRecMerge);
            tabsTools.Pages.Add(pageFamilyGroups);
            tabsTools.Pages.Add(pageTreeCheck);
            tabsTools.Pages.Add(pagePatSearch);
            tabsTools.Pages.Add(pagePlaceManage);
            tabsTools.SelectedIndex = 0;

            btnClose = new Button();
            btnClose.ImagePosition = ButtonImagePosition.Left;
            btnClose.Size          = new Size(130, 26);
            btnClose.Text          = "btnClose";
            btnClose.Click        += (sender, e) => { Close(); };

            Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        ScaleHeight = true,
                        Cells       = { tabsTools }
                    },
                    UIHelper.MakeDialogFooter(null, btnClose)
                }
            };

            AbortButton   = btnClose;
            Maximizable   = false;
            Minimizable   = false;
            ShowInTaskbar = false;
            Title         = "TreeToolsWin";

            UIHelper.SetPredefProperties(this, 1030, 620);
            ResumeLayout();
        }
Beispiel #8
0
 Control Transparent()
 {
     //NOTE: do not try to remove those `Size = new Size(10, 10)`
     //..... it would really kill the app in WinForms
     return(new Drawable
     {
         BackgroundColor = Colors.White,
         Padding = 10,
         Content = new TableLayout(
             true,
             TableLayout.HorizontalScaled
             (
                 new Drawable
         {
             BackgroundColor = Color.FromArgb(255, 0, 0, 128),
             Content = new TableLayout(
                 true,
                 null,
                 TableLayout.HorizontalScaled(
                     null,
                     new Panel
             {
                 BackgroundColor = Color.FromArgb(255, 0, 0),
                 Size = new Size(10, 10)
             }
                     )
                 )
         },
                 new Drawable
         {
             BackgroundColor = Color.FromArgb(0, 255, 0, 128),
             Content = new TableLayout(
                 true,
                 null,
                 TableLayout.HorizontalScaled(
                     new Panel
             {
                 BackgroundColor = Color.FromArgb(0, 255, 0),
                 Size = new Size(10, 10)
             },
                     null
                     )
                 )
         }
             ),
             TableLayout.HorizontalScaled
             (
                 new Drawable
         {
             BackgroundColor = Color.FromArgb(0, 0, 255, 128),
             Content = new TableLayout(
                 true,
                 TableLayout.HorizontalScaled(
                     null,
                     new Panel
             {
                 BackgroundColor = Color.FromArgb(0, 0, 255),
                 Size = new Size(10, 10)
             }
                     ),
                 null
                 )
         },
                 new Drawable
         {
             BackgroundColor = Color.FromArgb(0, 0, 0, 128),
             Content = new TableLayout(
                 true,
                 TableLayout.HorizontalScaled(
                     new Panel
             {
                 BackgroundColor = Color.FromArgb(0, 0, 0),
                 Size = new Size(10, 10)
             },
                     null
                     ),
                 null
                 ),
         }
             )
             )
     }.With(it => it.Paint += (s, pe) =>
     {
         using (var p = new Pen(Colors.Black, 3f))
         {
             for (int i = 4, n = Math.Max(it.Width, it.Height); i < n; i += 8)
             {
                 pe.Graphics.DrawLine(p, i, 0, i + n, n);
                 pe.Graphics.DrawLine(p, 0, i, n, i + n);
             }
         }
     }));
 }
Beispiel #9
0
        public Editor(Application application, string baseDirectory, string codeFilename)
        {
            systemPath  = baseDirectory + "/System.txt";
            programPath = baseDirectory + "/Program.txt";
            WindowState = WindowState.Maximized;
            Title       = TitleText;
            Menu        = new MenuBar {
                IncludeSystemItems = MenuBarSystemItems.Quit
            };
            runCommand      = new Command(OnRun);
            continueCommand = new Command(OnContinue);
            stepCommand     = new Command(OnStep)
            {
                Shortcut = Keys.F10
            };
            Button runButton = new Button {
                Command = runCommand, Text = RunText
            };
            Button continueButton = new Button {
                Command = continueCommand, Text = ContinueText
            };
            Button stepButton = new Button {
                Command = stepCommand, Text = StepText
            };

            systemEdit = new RichTextArea()
            {
                TextReplacements = TextReplacements.None
            };
            systemEdit.Text = File.ReadAllText(systemPath);
            programEdit     = new RichTextArea()
            {
                TextReplacements = TextReplacements.None
            };
            programEdit.Text = File.ReadAllText(programPath);
            codeTree         = new TreeGridView()
            {
                ShowHeader = false
            };
            codeTree.Border = BorderType.Line;
            codeTree.Columns.Add(new GridColumn {
                Editable = false, DataCell = new TextBoxCell(0), Resizable = false
            });
            codeTree.Columns.Add(new GridColumn {
                Editable = false, DataCell = new TextBoxCell(1), Resizable = false
            });
            codeTree.SelectedItemChanged += OnCodeTreeViewSelectedItemChanged;
            frameStack = new ListBox {
                Style = "ListNative"
            };
            frameStack.SelectedIndexChanged += OnCallStackListBoxSelectedIndexChanged;
            valueStack = new ListBox {
                Style = "ListNative"
            };
            outputArea        = new RichTextArea();
            documentationView = new WebView();
            Scrollable documentationwindow = new Scrollable();

            documentationwindow.Content = documentationView;
            TableLayout  buttons    = TableLayout.Horizontal(runButton, continueButton, stepButton, new Panel());
            DocumentPage systemPage = new DocumentPage(systemEdit)
            {
                Closable = false, Text = "System"
            };
            DocumentPage programPage = new DocumentPage(programEdit)
            {
                Closable = false, Text = "Program"
            };
            DocumentControl editsDocument = new DocumentControl()
            {
                AllowReordering = false
            };

            editsDocument.Pages.Add(systemPage);
            editsDocument.Pages.Add(programPage);
            TableLayout outputControls = TableLayout.HorizontalScaled(outputArea, documentationwindow);

            outputControls.Height = StandardDimensionHeight;
            TableLayout codeOutputControls = new TableLayout(editsDocument, outputControls);

            codeOutputControls.SetRowScale(0);
            TableLayout stacks = new TableLayout(codeTree, frameStack, valueStack);

            stacks.SetRowScale(0);
            stacks.SetRowScale(1);
            stacks.SetRowScale(2);
            stacks.Width = StandardDimensionWidth;
            TableLayout codeControls = TableLayout.Horizontal(codeOutputControls, stacks);

            codeControls.SetColumnScale(0);
            Content = codeControls;
            TableLayout mainControls = new TableLayout(buttons, codeControls);

            mainControls.SetRowScale(1);
            Content              = mainControls;
            runtime              = new Mira(application, baseDirectory);
            runtime.Breaking    += UpdateUI;
            runtime.Outputting  += OnOutputting;
            runtime.Stepping    += UpdateUI;
            runtime.Terminating += OnTerminating;
            runtime.Code         = codeFilename;
            timer.Interval       = 0.33;
            timer.Elapsed       += OnElapsed;
            timer.Start();
            LoadComplete += OnLoadComplete;
        }
        private void InitializeComponent()
        {
            SuspendLayout();

            ListSelected        = new GKListView();
            ListSelected.Height = 200;

            ListSkipped        = new GKListView();
            ListSkipped.Height = 200;

            btnSelectAll        = new Button();
            btnSelectAll.Size   = new Size(130, 26);
            btnSelectAll.Text   = "btnSelectAll";
            btnSelectAll.Click += btnSelectAll_Click;

            btnSelectFamily        = new Button();
            btnSelectFamily.Size   = new Size(130, 26);
            btnSelectFamily.Text   = "btnSelectFamily";
            btnSelectFamily.Click += btnSelectFamily_Click;

            btnSelectAncestors        = new Button();
            btnSelectAncestors.Size   = new Size(130, 26);
            btnSelectAncestors.Text   = "btnSelectAncestors";
            btnSelectAncestors.Click += btnSelectAncestors_Click;

            btnSelectDescendants        = new Button();
            btnSelectDescendants.Size   = new Size(130, 26);
            btnSelectDescendants.Text   = "btnSelectDescendants";
            btnSelectDescendants.Click += btnSelectDescendants_Click;

            btnDelete        = new Button();
            btnDelete.Size   = new Size(130, 26);
            btnDelete.Text   = "btnDelete";
            btnDelete.Click += btnDelete_Click;

            btnSave        = new Button();
            btnSave.Size   = new Size(130, 26);
            btnSave.Text   = "btnSave";
            btnSave.Click += btnSave_Click;

            pageTreeSplit         = new TabPage();
            pageTreeSplit.Text    = "pageTreeSplit";
            pageTreeSplit.Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        ScaleHeight = true,
                        Cells       = { TableLayout.HorizontalScaled(10, ListSelected, ListSkipped) }
                    },
                    UIHelper.MakeDialogFooter(btnSelectAll, btnSelectFamily, btnSelectAncestors, btnSelectDescendants, null, btnSave, btnDelete)
                }
            };

            //

            tabsTools = new TabControl();
            tabsTools.Pages.Add(pageTreeSplit);
            tabsTools.SelectedIndex = 0;

            btnClose = new Button();
            btnClose.ImagePosition = ButtonImagePosition.Left;
            btnClose.Size          = new Size(130, 26);
            btnClose.Text          = "btnClose";
            btnClose.Click        += (sender, e) => { Close(); };

            Content = new DefTableLayout {
                Rows =
                {
                    new TableRow {
                        ScaleHeight = true,
                        Cells       = { tabsTools }
                    },
                    UIHelper.MakeDialogFooter(null, btnClose)
                }
            };

            AbortButton   = btnClose;
            Maximizable   = false;
            Minimizable   = false;
            ShowInTaskbar = false;
            Title         = "TreeToolsWin";

            UIHelper.SetPredefProperties(this, 1030, 620);
            ResumeLayout();
        }