Пример #1
0
 private void Names_TextChanged(object sender, EventArgs e)
 {
     Text = string.Format("{0} \"{1} {2} {3}\" [{4}]", LangMan.LS(LSID.LSID_Person), txtSurname.Text, txtName.Text,
                          cmbPatronymic.Text, fController.Person.GetXRefNum());
 }
Пример #2
0
        public override void Modify(object sender, ModifyEventArgs eArgs)
        {
            var dataOwner = fDataOwner as IGDMStructWithNotes;

            if (fBaseWin == null || fSheetList == null || dataOwner == null)
            {
                return;
            }

            GDMNotes notes = eArgs.ItemData as GDMNotes;

            bool result = false;

            GDMNoteRecord noteRec;

            switch (eArgs.Action)
            {
            case RecordAction.raAdd:
                noteRec = fBaseWin.Context.SelectRecord(GDMRecordType.rtNote, null) as GDMNoteRecord;
                if (noteRec != null)
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otRecordNoteAdd, (GDMObject)dataOwner, noteRec);
                }
                break;

            case RecordAction.raEdit:
                if (notes != null)
                {
                    noteRec = fBaseContext.Tree.GetPtrValue <GDMNoteRecord>(notes);
                    result  = BaseController.ModifyNote(fBaseWin, ref noteRec);
                }
                break;

            case RecordAction.raDelete:
                if (AppHost.StdDialogs.ShowQuestionYN(LangMan.LS(LSID.LSID_DetachNoteQuery)))
                {
                    result = fUndoman.DoOrdinaryOperation(OperationType.otRecordNoteRemove, (GDMObject)dataOwner, notes);
                }
                break;

            case RecordAction.raMoveUp:
            case RecordAction.raMoveDown:
            {
                int idx = dataOwner.Notes.IndexOf(notes);
                switch (eArgs.Action)
                {
                case RecordAction.raMoveUp:
                    dataOwner.Notes.Exchange(idx - 1, idx);
                    break;

                case RecordAction.raMoveDown:
                    dataOwner.Notes.Exchange(idx, idx + 1);
                    break;
                }
                result = true;
            }
            break;
            }

            if (result)
            {
                fBaseWin.Context.Modified = true;
                eArgs.IsChanged           = true;
            }
        }
Пример #3
0
        public void SetLocale()
        {
            btnAccept.Text = LangMan.LS(LSID.LSID_DlgAccept);
            btnCancel.Text = LangMan.LS(LSID.LSID_DlgCancel);
            Title          = LangMan.LS(LSID.LSID_MIOptions);

            // Common
            pageCommon.Text = LangMan.LS(LSID.LSID_Common);

            grpInternet.Text      = LangMan.LS(LSID.LSID_Internet);
            chkUseProxy.Text      = LangMan.LS(LSID.LSID_ProxyUse);
            lblProxyServer.Text   = LangMan.LS(LSID.LSID_ProxyServer);
            lblProxyPort.Text     = LangMan.LS(LSID.LSID_ProxyPort);
            lblProxyLogin.Text    = LangMan.LS(LSID.LSID_ProxyLogin);
            lblProxyPassword.Text = LangMan.LS(LSID.LSID_Password);

            grpFileBackup.Text     = LangMan.LS(LSID.LSID_FileBackup);
            radFBNone.Text         = LangMan.LS(LSID.LSID_Not);
            radFBOnlyPrev.Text     = LangMan.LS(LSID.LSID_BackupOnlyPrev);
            radFBEachRevision.Text = LangMan.LS(LSID.LSID_BackupEachRevision);

            chkAutosave.Text = LangMan.LS(LSID.LSID_Autosave);
            lblMinutes.Text  = LangMan.LS(LSID.LSID_Minutes);
            lblBackupRevisionsMaxCount.Text = LangMan.LS(LSID.LSID_BackupRevisionsMaxCount);

            grpOther.Text             = LangMan.LS(LSID.LSID_Other);
            chkShowOnStart.Text       = LangMan.LS(LSID.LSID_StartupTips);
            chkLoadRecentFiles.Text   = LangMan.LS(LSID.LSID_LoadRecentFiles);
            chkAutoCheckUpdates.Text  = LangMan.LS(LSID.LSID_AutoCheckUpdates);
            chkCharsetDetection.Text  = LangMan.LS(LSID.LSID_CharsetDetection);
            chkDialogClosingWarn.Text = LangMan.LS(LSID.LSID_WarnForClosingDialog);

            lblLanguage.Text         = LangMan.LS(LSID.LSID_Language);
            lblGeocoder.Text         = LangMan.LS(LSID.LSID_Geocoder);
            lblGeoSearchCountry.Text = LangMan.LS(LSID.LSID_GeoSearchCountryRestriction);

            // Multimedia
            pageMultimedia.Text = LangMan.LS(LSID.LSID_RPMultimedia);

            chkRemovableMediaWarning.Text = LangMan.LS(LSID.LSID_RemovableMediaWarningOption);
            chkEmbeddedMediaPlayer.Text   = LangMan.LS(LSID.LSID_EmbeddedMediaPlayer);

            chkAllowMediaDirectRefs.Text = LangMan.LS(LSID.LSID_AllowMediaDirectReferences);
            chkAllowMediaStoreRelativeReferences.Text = LangMan.LS(LSID.LSID_AllowMediaRelativeReferences);

            lblMediaStoreDefault.Text = LangMan.LS(LSID.LSID_MediaStoreDefault);
            cmbMediaStoreDefault.Items.Clear();
            for (MediaStoreType mst = MediaStoreType.mstReference; mst <= MediaStoreType.mstURL; mst++)
            {
                cmbMediaStoreDefault.Items.Add(new GKComboItem <MediaStoreType>(LangMan.LS(GKData.GKStoreTypes[(int)mst].Name), mst));
            }

            chkAllowDeleteMediaFileFromStgArc.Text = LangMan.LS(LSID.LSID_AllowDeleteMediaFileFromStgArc);
            chkAllowDeleteMediaFileFromRefs.Text   = LangMan.LS(LSID.LSID_AllowDeleteMediaFileFromRefs);
            chkDeleteMediaFileWithoutConfirm.Text  = LangMan.LS(LSID.LSID_DeleteMediaFileWithoutConfirm);

            // Charts
            pageCharts.Text = LangMan.LS(LSID.LSID_Charts);

            pageTreeChart.Text  = LangMan.LS(LSID.LSID_Trees);
            grpTreePersons.Text = LangMan.LS(LSID.LSID_ViewTree);

            chkSurname.Text                      = LangMan.LS(LSID.LSID_Surname);
            chkName.Text                         = LangMan.LS(LSID.LSID_Name);
            chkPatronymic.Text                   = LangMan.LS(LSID.LSID_Patronymic);
            chkDiffLines.Text                    = LangMan.LS(LSID.LSID_DiffLines);
            chkBirthDate.Text                    = LangMan.LS(LSID.LSID_BirthDate);
            chkDeathDate.Text                    = LangMan.LS(LSID.LSID_DeathDate);
            chkOnlyYears.Text                    = LangMan.LS(LSID.LSID_OnlyYears);
            chkMarriagesDates.Text               = LangMan.LS(LSID.LSID_MarriagesDates);
            chkKinship.Text                      = LangMan.LS(LSID.LSID_Kinship);
            chkSignsVisible.Text                 = LangMan.LS(LSID.LSID_SignsVisible);
            chkTreeDecorative.Text               = LangMan.LS(LSID.LSID_TreeDecorative);
            chkPortraitsVisible.Text             = LangMan.LS(LSID.LSID_PortraitsVisible);
            chkDefaultPortraits.Text             = LangMan.LS(LSID.LSID_DefaultPortraits);
            chkInvertedTree.Text                 = LangMan.LS(LSID.LSID_InvertedTree);
            chkChildlessExclude.Text             = LangMan.LS(LSID.LSID_ChildlessExclude);
            chkShowPlaces.Text                   = LangMan.LS(LSID.LSID_ShowPlaces);
            chkSeparateDAPLines.Text             = LangMan.LS(LSID.LSID_SeparateDatesAndPlacesLines);
            chkHideUnknownSpouses.Text           = LangMan.LS(LSID.LSID_HideUnknownSpouses);
            chkCheckTreeSize.Text                = LangMan.LS(LSID.LSID_CheckTreeSize);
            chkDottedLinesOfAdoptedChildren.Text = LangMan.LS(LSID.LSID_DottedLinesOfAdoptedChildren);
            chkBoldNames.Text                    = LangMan.LS(LSID.LSID_BoldNames);

            grpTreeDecor.Text      = LangMan.LS(LSID.LSID_Decor);
            lblMaleColor.Text      = LangMan.LS(LSID.LSID_Man);
            lblFemaleColor.Text    = LangMan.LS(LSID.LSID_Woman);
            lblUnkSexColor.Text    = LangMan.LS(LSID.LSID_UnkSex);
            lblUnHusbandColor.Text = LangMan.LS(LSID.LSID_UnHusband);
            lblUnWifeColor.Text    = LangMan.LS(LSID.LSID_UnWife);
            lblFont.Text           = LangMan.LS(LSID.LSID_Font);

            grpSpacings.Text   = LangMan.LS(LSID.LSID_Spacings);
            lblMargins.Text    = LangMan.LS(LSID.LSID_Margins);
            lblBranchDist.Text = LangMan.LS(LSID.LSID_BranchDist);
            lblGenDist.Text    = LangMan.LS(LSID.LSID_GenDist);
            lblSpouseDist.Text = LangMan.LS(LSID.LSID_SpouseDist);

            chkSeparateDepth.Text           = LangMan.LS(LSID.LSID_SeparateDepth);
            lblDefaultDepth.Text            = LangMan.LS(LSID.LSID_DefaultDepth);
            lblDefaultDepthAncestors.Text   = LangMan.LS(LSID.LSID_DefaultDepth) + ": " + LangMan.LS(LSID.LSID_Ancestors);
            lblDefaultDepthDescendants.Text = LangMan.LS(LSID.LSID_DefaultDepth) + ": " + LangMan.LS(LSID.LSID_Descendants);

            pageAncCircle.Text = LangMan.LS(LSID.LSID_AncestorsCircle);

            // UIView
            pageUIView.Text = LangMan.LS(LSID.LSID_Interface);

            pageViewCommon.Text = LangMan.LS(LSID.LSID_ListsAll);

            rgFNPFormat.Text = LangMan.LS(LSID.LSID_NamesFormat);
            radSNP.Text      = LangMan.LS(LSID.LSID_NF1);
            radS_NP.Text     = LangMan.LS(LSID.LSID_NF2);
            radS_N_P.Text    = LangMan.LS(LSID.LSID_NF3);

            chkPlacesWithAddress.Text   = LangMan.LS(LSID.LSID_PlacesWithAddress);
            chkHighlightUnparented.Text = LangMan.LS(LSID.LSID_HighlightUnparented);
            chkHighlightUnmarried.Text  = LangMan.LS(LSID.LSID_HighlightUnmarried);

            chkAutoSortChildren.Text          = LangMan.LS(LSID.LSID_AutoSortChildren);
            chkAutoSortSpouses.Text           = LangMan.LS(LSID.LSID_AutoSortSpouses);
            chkFirstCapitalLetterInNames.Text = LangMan.LS(LSID.LSID_FirstCapitalLetterInNames);
            chkShortKinshipForm.Text          = LangMan.LS(LSID.LSID_ShortKinshipForm);
            chkSurnameFirstInOrder.Text       = LangMan.LS(LSID.LSID_SurnameFirstInOrder);

            grpDateFormat.Text        = LangMan.LS(LSID.LSID_DateFormat);
            chkShowDatesCalendar.Text = LangMan.LS(LSID.LSID_ShowDatesCalendar);
            chkShowDatesSigns.Text    = LangMan.LS(LSID.LSID_ShowDatesSigns);

            grpAdvancedNames.Text       = LangMan.LS(LSID.LSID_AdditionalNames);
            chkExtendWomanSurnames.Text = LangMan.LS(LSID.LSID_ExtendedWomanSurnames);
            radMaiden_Married.Text      = LangMan.LS(LSID.LSID_WSF_Maiden_Married);
            radMarried_Maiden.Text      = LangMan.LS(LSID.LSID_WSF_Married_Maiden);
            radMaiden.Text  = LangMan.LS(LSID.LSID_WSF_Maiden);
            radMarried.Text = LangMan.LS(LSID.LSID_WSF_Married);

            pageViewPersons.Text = LangMan.LS(LSID.LSID_ListPersons);
            btnDefList.Text      = LangMan.LS(LSID.LSID_DefList);

            // Pedigree
            pagePedigree.Text = LangMan.LS(LSID.LSID_Pedigrees);

            grpPedigree.Text    = LangMan.LS(LSID.LSID_PedigreeGen);
            chkAttributes.Text  = LangMan.LS(LSID.LSID_IncludeAttributes);
            chkNotes.Text       = LangMan.LS(LSID.LSID_IncludeNotes);
            chkSources.Text     = LangMan.LS(LSID.LSID_IncludeSources);
            chkGenerations.Text = LangMan.LS(LSID.LSID_IncludeGenerations);

            grpPedigreeFormat.Text = LangMan.LS(LSID.LSID_PedigreeFormat);
            radExcess.Text         = LangMan.LS(LSID.LSID_PF1);
            radCompact.Text        = LangMan.LS(LSID.LSID_PF2);

            // Plugins
            pagePlugins.Text = LangMan.LS(LSID.LSID_Plugins);
        }
Пример #4
0
        private void ListModify(object sender, ModifyEventArgs eArgs)
        {
            GEDCOMTag itemTag = eArgs.ItemData as GEDCOMTag;

            if ((eArgs.Action == RecordAction.raEdit || eArgs.Action == RecordAction.raDelete) && (itemTag == null))
            {
                return;
            }

            string val;

            if (sender == fPhonesList)
            {
                switch (eArgs.Action)
                {
                case RecordAction.raAdd:
                    val = "";
                    if (AppHost.StdDialogs.GetInput(LangMan.LS(LSID.LSID_Telephone), ref val))
                    {
                        fAddress.AddPhoneNumber(val);
                    }
                    break;

                case RecordAction.raEdit:
                    val = itemTag.StringValue;
                    if (AppHost.StdDialogs.GetInput(LangMan.LS(LSID.LSID_Telephone), ref val))
                    {
                        itemTag.StringValue = val;
                    }
                    break;

                case RecordAction.raDelete:
                    fAddress.PhoneNumbers.Delete(itemTag);
                    break;
                }
            }
            else if (sender == fMailsList)
            {
                switch (eArgs.Action)
                {
                case RecordAction.raAdd:
                    val = "";
                    if (AppHost.StdDialogs.GetInput(LangMan.LS(LSID.LSID_Mail), ref val))
                    {
                        fAddress.AddEmailAddress(val);
                    }
                    break;

                case RecordAction.raEdit:
                    val = itemTag.StringValue;
                    if (AppHost.StdDialogs.GetInput(LangMan.LS(LSID.LSID_Mail), ref val))
                    {
                        itemTag.StringValue = val;
                    }
                    break;

                case RecordAction.raDelete:
                    fAddress.EmailAddresses.Delete(itemTag);
                    break;
                }
            }
            else if (sender == fWebsList)
            {
                switch (eArgs.Action)
                {
                case RecordAction.raAdd:
                    val = "";
                    if (AppHost.StdDialogs.GetInput(LangMan.LS(LSID.LSID_WebSite), ref val))
                    {
                        fAddress.AddWebPage(val);
                    }
                    break;

                case RecordAction.raEdit:
                    val = itemTag.StringValue;
                    if (AppHost.StdDialogs.GetInput(LangMan.LS(LSID.LSID_WebSite), ref val))
                    {
                        itemTag.StringValue = val;
                    }
                    break;

                case RecordAction.raDelete:
                    fAddress.WebPages.Delete(itemTag);
                    break;
                }
            }

            UpdateLists();
        }
Пример #5
0
        private void InfoForm_Load(object sender, EventArgs e)
        {
            SetDarkMode(DarkMode);
            InitLanguage();

            if (directoryName != null)
            {
                string path = Path.Combine(directoryName, fileName);

                fileNameTextBox.Text = fileName;
                folderTextBox.Text   = directoryName;
                fullPathTextBox.Text = path;

                diskSizeTextBox.Text  = Converter.PathToSize(path);
                extensionTextBox.Text = Path.GetExtension(path).Substring(1, Path.GetExtension(path).Length - 1).ToUpper();

                createdTextBox.Text  = File.GetCreationTime(path).ToShortDateString() + " - " + File.GetCreationTime(path).ToLongTimeString();
                modifiedTextBox.Text = File.GetLastWriteTime(path).ToShortDateString() + " - " + File.GetLastWriteTime(path).ToLongTimeString();

                propertiesButton.Visible = true;
            }

            double inchesWidth  = bitmap.Width / bitmap.HorizontalResolution;
            double inchesHeight = bitmap.Height / bitmap.VerticalResolution;
            double cmWidth      = inchesWidth * 2.54;
            double cmHeight     = inchesHeight * 2.54;

            compressionTextBox.Text = getImageCompression(bitmap);

            sizeTextBox.Text       = bitmap.Width + " x " + bitmap.Height + " " + LangMan.Get("pixels");
            megapixelsTextBox.Text = ((((float)bitmap.Height * bitmap.Width) / 1000000)).ToString("0.##") + " " + LangMan.Get("megapixels");
            resolutionTextBox.Text = Math.Round(bitmap.HorizontalResolution) + " x " + Math.Round(bitmap.VerticalResolution) + " DPI";
            inchesTextBox.Text     = inchesWidth.ToString("0.##") + " x " + inchesHeight.ToString("0.##") + " " + LangMan.Get("inches");
            cmTextBox.Text         = cmWidth.ToString("0.##") + " x " + cmHeight.ToString("0.##") + " " + LangMan.Get("centimeters");

            int firstRatio  = bitmap.Width / GCD(bitmap.Width, bitmap.Height);
            int secondRatio = bitmap.Height / GCD(bitmap.Width, bitmap.Height);

            ratioTextBox.Text = string.Format("{0} : {1} (", firstRatio, secondRatio);
            if (firstRatio == secondRatio)
            {
                ratioTextBox.Text += LangMan.Get("square");
            }
            else if (firstRatio > secondRatio)
            {
                ratioTextBox.Text += LangMan.Get("landscape");
            }
            else
            {
                ratioTextBox.Text += LangMan.Get("portrait");
            }
            ratioTextBox.Text += ")";

            fileNameTextBox.Focus();
        }
Пример #6
0
        public override void SetLang()
        {
            miFile.Text     = LangMan.LS(LSID.LSID_MIFile);
            miEdit.Text     = LangMan.LS(LSID.LSID_MIEdit);
            miPedigree.Text = LangMan.LS(LSID.LSID_MIPedigree);
            miService.Text  = LangMan.LS(LSID.LSID_MIService);
            //miWindow.Text = LangMan.LS(LSID.LSID_MIWindow);
            miHelp.Text = LangMan.LS(LSID.LSID_MIHelp);

            miFileNew.Text            = LangMan.LS(LSID.LSID_MIFileNew);
            miFileLoad.Text           = LangMan.LS(LSID.LSID_MIFileLoad);
            miMRUFiles.Text           = LangMan.LS(LSID.LSID_MIMRUFiles);
            miFileSave.Text           = LangMan.LS(LSID.LSID_MIFileSave);
            miFileSaveAs.Text         = LangMan.LS(LSID.LSID_MIFileSaveAs);
            miFileClose.Text          = LangMan.LS(LSID.LSID_MIFileClose);
            miFileProperties.Text     = LangMan.LS(LSID.LSID_MIFileProperties) + @"...";
            miExport.Text             = LangMan.LS(LSID.LSID_MIExport);
            miExportToFamilyBook.Text = LangMan.LS(LSID.LSID_MIExportToFamilyBook);
            miExportToTreesAlbum.Text = LangMan.LS(LSID.LSID_TreesAlbum);
            miExportToExcelFile.Text  = LangMan.LS(LSID.LSID_MIExportToExcelFile);
            miExit.Text = LangMan.LS(LSID.LSID_MIExit);

            miRecordAdd.Text    = LangMan.LS(LSID.LSID_MIRecordAdd);
            miRecordEdit.Text   = LangMan.LS(LSID.LSID_MIRecordEdit);
            miRecordDelete.Text = LangMan.LS(LSID.LSID_MIRecordDelete);

            miTreeAncestors.Text      = LangMan.LS(LSID.LSID_MITreeAncestors);
            miTreeDescendants.Text    = LangMan.LS(LSID.LSID_MITreeDescendants);
            miTreeBoth.Text           = LangMan.LS(LSID.LSID_MITreeBoth);
            miPedigreeAscend.Text     = LangMan.LS(LSID.LSID_MIPedigreeAscend);
            miPedigree_dAboville.Text = LangMan.LS(LSID.LSID_MIPedigree_dAboville);
            miPedigree_Konovalov.Text = LangMan.LS(LSID.LSID_MIPedigree_Konovalov);

            miMap.Text                    = LangMan.LS(LSID.LSID_MIMap) + @"...";
            miStats.Text                  = LangMan.LS(LSID.LSID_MIStats) + @"...";
            miSearch.Text                 = LangMan.LS(LSID.LSID_Search);
            miAncestorsCircle.Text        = LangMan.LS(LSID.LSID_AncestorsCircle);
            miDescendantsCircle.Text      = LangMan.LS(LSID.LSID_DescendantsCircle);
            miRelationshipCalculator.Text = LangMan.LS(LSID.LSID_RelationshipCalculator);

            miOrganizer.Text = LangMan.LS(LSID.LSID_MIOrganizer) + @"...";
            miSlideshow.Text = LangMan.LS(LSID.LSID_Slideshow) + @"...";
            miScripts.Text   = LangMan.LS(LSID.LSID_MIScripts);
            miTreeTools.Text = LangMan.LS(LSID.LSID_MITreeTools);
            miFilter.Text    = LangMan.LS(LSID.LSID_MIFilter) + @"...";
            miOptions.Text   = LangMan.LS(LSID.LSID_MIOptions) + @"...";

            //miWinCascade.Text = LangMan.LS(LSID.LSID_MIWinCascade);
            //miWinHTile.Text = LangMan.LS(LSID.LSID_MIWinHTile);
            //miWinVTile.Text = LangMan.LS(LSID.LSID_MIWinVTile);
            //miWinMinimize.Text = LangMan.LS(LSID.LSID_MIWinMinimize);
            //miWinArrange.Text = LangMan.LS(LSID.LSID_MIWinArrange);

            miContext.Text = LangMan.LS(LSID.LSID_MIContext);
            miAbout.Text   = LangMan.LS(LSID.LSID_MIAbout) + @"...";
            miLogSend.Text = LangMan.LS(LSID.LSID_LogSend);
            miLogView.Text = LangMan.LS(LSID.LSID_LogView);
            miPlugins.Text = LangMan.LS(LSID.LSID_Plugins);
            miReports.Text = LangMan.LS(LSID.LSID_Reports);

            SetToolTip(tbFileNew, LangMan.LS(LSID.LSID_FileNewTip));
            SetToolTip(tbFileLoad, LangMan.LS(LSID.LSID_FileLoadTip));
            SetToolTip(tbFileSave, LangMan.LS(LSID.LSID_FileSaveTip));
            SetToolTip(tbRecordAdd, LangMan.LS(LSID.LSID_RecordAddTip));
            SetToolTip(tbRecordEdit, LangMan.LS(LSID.LSID_RecordEditTip));
            SetToolTip(tbRecordDelete, LangMan.LS(LSID.LSID_RecordDeleteTip));
            SetToolTip(tbFilter, LangMan.LS(LSID.LSID_FilterTip));
            SetToolTip(tbTreeAncestors, LangMan.LS(LSID.LSID_TreeAncestorsTip));
            SetToolTip(tbTreeDescendants, LangMan.LS(LSID.LSID_TreeDescendantsTip));
            SetToolTip(tbTreeBoth, LangMan.LS(LSID.LSID_TreeBothTip));
            SetToolTip(tbPedigree, LangMan.LS(LSID.LSID_PedigreeTip));
            miPedigree_dAboville2.Text = LangMan.LS(LSID.LSID_Pedigree_dAbovilleTip);
            miPedigree_Konovalov2.Text = LangMan.LS(LSID.LSID_Pedigree_KonovalovTip);
            SetToolTip(tbStats, LangMan.LS(LSID.LSID_StatsTip));

            SetToolTip(tbDocPrint, LangMan.LS(LSID.LSID_DocPrint));
            SetToolTip(tbDocPreview, LangMan.LS(LSID.LSID_DocPreview));

            SetToolTip(tbPrev, LangMan.LS(LSID.LSID_PrevRec));
            SetToolTip(tbNext, LangMan.LS(LSID.LSID_NextRec));

            int num = miPlugins.DropDownItems.Count;

            for (int i = 0; i < num; i++)
            {
                ToolStripItem mi     = miPlugins.DropDownItems[i];
                IPlugin       plugin = (IPlugin)mi.Tag;
                mi.Text = plugin.DisplayName;
            }

            tabsRecords.TabPages[0].Text  = LangMan.LS(LSID.LSID_RPIndividuals);
            tabsRecords.TabPages[1].Text  = LangMan.LS(LSID.LSID_RPFamilies);
            tabsRecords.TabPages[2].Text  = LangMan.LS(LSID.LSID_RPNotes);
            tabsRecords.TabPages[3].Text  = LangMan.LS(LSID.LSID_RPMultimedia);
            tabsRecords.TabPages[4].Text  = LangMan.LS(LSID.LSID_RPSources);
            tabsRecords.TabPages[5].Text  = LangMan.LS(LSID.LSID_RPRepositories);
            tabsRecords.TabPages[6].Text  = LangMan.LS(LSID.LSID_RPGroups);
            tabsRecords.TabPages[7].Text  = LangMan.LS(LSID.LSID_RPResearches);
            tabsRecords.TabPages[8].Text  = LangMan.LS(LSID.LSID_RPTasks);
            tabsRecords.TabPages[9].Text  = LangMan.LS(LSID.LSID_RPCommunications);
            tabsRecords.TabPages[10].Text = LangMan.LS(LSID.LSID_RPLocations);

            miContRecordAdd.Text    = LangMan.LS(LSID.LSID_MIRecordAdd);
            miContRecordEdit.Text   = LangMan.LS(LSID.LSID_MIRecordEdit);
            miContRecordDelete.Text = LangMan.LS(LSID.LSID_MIRecordDelete);
            miRecordDuplicate.Text  = LangMan.LS(LSID.LSID_RecordDuplicate);

            miTreeCompare.Text   = LangMan.LS(LSID.LSID_ToolOp_1);
            miTreeMerge.Text     = LangMan.LS(LSID.LSID_ToolOp_2);
            miTreeSplit.Text     = LangMan.LS(LSID.LSID_ToolOp_3);
            miRecMerge.Text      = LangMan.LS(LSID.LSID_ToolOp_4);
            miFamilyGroups.Text  = LangMan.LS(LSID.LSID_ToolOp_6);
            miTreeCheck.Text     = LangMan.LS(LSID.LSID_ToolOp_7);
            miPatSearch.Text     = LangMan.LS(LSID.LSID_ToolOp_8);
            miPlacesManager.Text = LangMan.LS(LSID.LSID_ToolOp_9);
        }
Пример #7
0
 private void edName_TextChanged(object sender, EventArgs e)
 {
     Text = string.Format("{0} \"{1}\"", LangMan.LS(LSID.LSID_RPMultimedia), txtName.Text);
 }
Пример #8
0
        public void BuildBy(GDMIndividualRecord iRec)
        {
            try {
                fRec = iRec;

                if (iRec != null)
                {
                    if (fModel.PreparedIndividuals.IndexOf(iRec.XRef) < 0)
                    {
                        fModel.PreparedIndividuals.Add(iRec.XRef);
                    }

                    var parts = GKUtils.GetNameParts(iRec);
                    fSurname    = parts.Surname;
                    fName       = parts.Name;
                    fPatronymic = parts.Patronymic;
                    fNick       = GKUtils.GetNickString(iRec);
                    fSex        = iRec.Sex;

                    TreeChartOptions options = fModel.Options;

                    var        lifeDates  = iRec.GetLifeDates();
                    DateFormat dateFormat = (options.OnlyYears) ? DateFormat.dfYYYY : DateFormat.dfDD_MM_YYYY;

                    IsDead     = (lifeDates.DeathEvent != null);
                    fBirthDate = GKUtils.GEDCOMEventToDateStr(lifeDates.BirthEvent, dateFormat, false);
                    fDeathDate = GKUtils.GEDCOMEventToDateStr(lifeDates.DeathEvent, dateFormat, false);

                    if (!options.OnlyYears)
                    {
                        if (options.ShowPlaces)
                        {
                            string birthPlace = GKUtils.GetPlaceStr(lifeDates.BirthEvent, false);
                            if (!string.IsNullOrEmpty(birthPlace))
                            {
                                if (!string.IsNullOrEmpty(fBirthDate))
                                {
                                    fBirthDate += ", ";
                                }
                                fBirthDate += birthPlace;
                            }

                            string deathPlace = GKUtils.GetPlaceStr(lifeDates.DeathEvent, false);
                            if (!string.IsNullOrEmpty(deathPlace))
                            {
                                if (!string.IsNullOrEmpty(fDeathDate))
                                {
                                    fDeathDate += ", ";
                                }
                                fDeathDate += deathPlace;
                            }
                        }

                        if (!string.IsNullOrEmpty(fBirthDate))
                        {
                            fBirthDate = ImportUtils.STD_BIRTH_SIGN + " " + fBirthDate;
                        }
                        if (!string.IsNullOrEmpty(fDeathDate))
                        {
                            fDeathDate = ImportUtils.STD_DEATH_SIGN + " " + fDeathDate;
                        }
                    }

                    if (options.SignsVisible)
                    {
                        EnumSet <SpecialUserRef> signs = EnumSet <SpecialUserRef> .Create();

                        int num = fRec.UserReferences.Count;
                        for (int i = 0; i < num; i++)
                        {
                            string rs = fRec.UserReferences[i].StringValue;

                            for (var cps = SpecialUserRef.urRI_StGeorgeCross; cps <= SpecialUserRef.urLast; cps++)
                            {
                                string sur = LangMan.LS(GKData.SpecialUserRefs[(int)cps].Title);
                                if (rs == sur)
                                {
                                    signs.Include(cps);
                                }
                            }
                        }

                        fSigns = signs;
                    }
                    else
                    {
                        fSigns = EnumSet <SpecialUserRef> .Create();
                    }

                    if (options.PortraitsVisible)
                    {
                        try {
                            fPortrait = PortraitsCache.Instance.GetImage(fModel.Base.Context, iRec);

                            if (fPortrait == null && options.DefaultPortraits)
                            {
                                string resName = (fSex == GDMSex.svFemale) ? "pi_female_140.png" : "pi_male_140.png";
                                fPortrait = AppHost.GfxProvider.LoadResourceImage(resName, false);
                            }
                        } catch (MediaFileNotFoundException) {
                            if (!fModel.HasMediaFail)
                            {
                                AppHost.StdDialogs.ShowError(LangMan.LS(LSID.LSID_ArcNotFound));
                                fModel.HasMediaFail = true;
                            }
                        }
                    }

                    CertaintyAssessment = iRec.GetCertaintyAssessment();
                }
                else
                {
                    fSurname    = "";
                    fName       = "< ? >";
                    fPatronymic = "";
                    fNick       = "";
                    fBirthDate  = "";
                    fDeathDate  = "";
                    IsDead      = false;
                    fSex        = GDMSex.svUnknown;
                    fSigns      = EnumSet <SpecialUserRef> .Create();

                    CertaintyAssessment = 0.0f;
                }
            } catch (Exception ex) {
                Logger.LogWrite("TreeChartPerson.BuildBy(): " + ex.Message);
                throw;
            }
        }
Пример #9
0
        public override void Generate(bool show)
        {
#if !NETSTANDARD
            fPath = AppHost.StdDialogs.GetSaveFile("Excel files (*.xls)|*.xls");
            if (string.IsNullOrEmpty(fPath))
            {
                return;
            }

            Workbook  workbook  = new Workbook();
            Worksheet worksheet = new Worksheet("First Sheet");

            IProgressController progress = AppHost.Progress;
            progress.ProgressInit(LangMan.LS(LSID.LSID_MIExport) + "...", fTree.RecordsCount);

            try
            {
                worksheet.Cells[1, 1]  = new Cell("№");
                worksheet.Cells[1, 2]  = new Cell(LangMan.LS(LSID.LSID_Surname));
                worksheet.Cells[1, 3]  = new Cell(LangMan.LS(LSID.LSID_Name));
                worksheet.Cells[1, 4]  = new Cell(LangMan.LS(LSID.LSID_Patronymic));
                worksheet.Cells[1, 5]  = new Cell(LangMan.LS(LSID.LSID_Sex));
                worksheet.Cells[1, 6]  = new Cell(LangMan.LS(LSID.LSID_BirthDate));
                worksheet.Cells[1, 7]  = new Cell(LangMan.LS(LSID.LSID_DeathDate));
                worksheet.Cells[1, 8]  = new Cell(LangMan.LS(LSID.LSID_BirthPlace));
                worksheet.Cells[1, 9]  = new Cell(LangMan.LS(LSID.LSID_DeathPlace));
                worksheet.Cells[1, 10] = new Cell(LangMan.LS(LSID.LSID_Residence));
                worksheet.Cells[1, 11] = new Cell(LangMan.LS(LSID.LSID_Age));
                worksheet.Cells[1, 12] = new Cell(LangMan.LS(LSID.LSID_LifeExpectancy));

                ushort row = 1;
                int    num = fTree.RecordsCount;
                for (int i = 0; i < num; i++)
                {
                    GDMRecord rec = fTree[i];
                    if (rec.RecordType == GDMRecordType.rtIndividual)
                    {
                        GDMIndividualRecord ind = (GDMIndividualRecord)rec;

                        if (fSelectedRecords == null || fSelectedRecords.IndexOf(rec) >= 0)
                        {
                            var parts = GKUtils.GetNameParts(ind);

                            string sx = "" + GKUtils.SexStr(ind.Sex)[0];
                            row++;

                            worksheet.Cells[row, 1]  = new Cell(ind.GetXRefNum());
                            worksheet.Cells[row, 2]  = new Cell(parts.Surname);
                            worksheet.Cells[row, 3]  = new Cell(parts.Name);
                            worksheet.Cells[row, 4]  = new Cell(parts.Patronymic);
                            worksheet.Cells[row, 5]  = new Cell(sx);
                            worksheet.Cells[row, 6]  = new Cell(GKUtils.GetBirthDate(ind, DateFormat.dfDD_MM_YYYY, false));
                            worksheet.Cells[row, 7]  = new Cell(GKUtils.GetDeathDate(ind, DateFormat.dfDD_MM_YYYY, false));
                            worksheet.Cells[row, 8]  = new Cell(GKUtils.GetBirthPlace(ind));
                            worksheet.Cells[row, 9]  = new Cell(GKUtils.GetDeathPlace(ind));
                            worksheet.Cells[row, 10] = new Cell(GKUtils.GetResidencePlace(ind, fOptions.PlacesWithAddress));
                            worksheet.Cells[row, 11] = new Cell(GKUtils.GetAge(ind, -1));
                            worksheet.Cells[row, 12] = new Cell(GKUtils.GetLifeExpectancy(ind));
                        }
                    }

                    progress.ProgressStep();
                }

                workbook.Worksheets.Add(worksheet);
                workbook.Save(fPath);

                #if !CI_MODE
                if (show)
                {
                    ShowResult();
                }
                #endif
            }
            finally
            {
                progress.ProgressDone();
            }
#endif
        }
Пример #10
0
        protected override void InternalGenerate()
        {
            bool isRtf = false;

#if !NETSTANDARD
            isRtf = (fWriter is RTFWriter);
#endif

            IColor clrBlack = AppHost.GfxProvider.CreateColor(0x000000);
            IColor clrBlue  = AppHost.GfxProvider.CreateColor(0x0000FF);

            fTitleFont  = fWriter.CreateFont("", 16f /*20f*/, true, false, clrBlack);
            fChapFont   = fWriter.CreateFont("", 14f /*16f*/, true, false, clrBlack);
            fPersonFont = fWriter.CreateFont("", 12f /*10f*/, true, false, clrBlack);
            fLinkFont   = fWriter.CreateFont("", 10f /*8f*/, false, true, clrBlue);
            fTextFont   = fWriter.CreateFont("", 10f /*8f*/, false, false, clrBlack);
            fSupText    = fWriter.CreateFont("", (isRtf ? 12f : 5f) /*5f*/, false, false, clrBlue);

            fFormat = fOptions.PedigreeOptions.Format;

            bool includeGens = fOptions.PedigreeOptions.IncludeGenerations;

            fWriter.AddParagraph(fTitle, fTitleFont, TextAlignment.taCenter);

            fPersonList = new ExtList <PedigreePerson>(true);
            fSourceList = new StringList();
            try
            {
                GenStep(null, fRoot, 1, 1);
                ReIndex();

                int curLevel = 0;
                int num      = fPersonList.Count;
                for (int i = 0; i < num; i++)
                {
                    PedigreePerson person = fPersonList[i];

                    if (includeGens && curLevel != person.Level)
                    {
                        curLevel = person.Level;
                        string genTitle = LangMan.LS(LSID.LSID_Generation) + " " + ConvertHelper.GetRome(curLevel);

                        fWriter.BeginParagraph(TextAlignment.taLeft, 12f, 6f);
                        fWriter.AddParagraphChunk(genTitle, fChapFont);
                        fWriter.EndParagraph();
                    }

                    WritePerson(person);
                }

                if (fSourceList.Count > 0)
                {
                    fWriter.BeginParagraph(TextAlignment.taCenter, 12f, 6f);
                    fWriter.AddParagraphChunk(LangMan.LS(LSID.LSID_RPSources), fChapFont);
                    fWriter.EndParagraph();

                    int num2 = fSourceList.Count;
                    for (int j = 0; j < num2; j++)
                    {
                        string sn   = (j + 1).ToString();
                        string sst  = sn + ". " + fSourceList[j];
                        string sanc = "src_" + sn;

                        fWriter.AddParagraphAnchor(sst, fTextFont, sanc);
                    }
                }
            }
            finally
            {
                fSourceList.Dispose();
                fPersonList.Dispose();
            }
        }
Пример #11
0
 public void SetLang()
 {
     btnSizeToFit.ToolTip = LangMan.LS(LSID.LSID_SizeToFit);
     btnZoomIn.ToolTip    = LangMan.LS(LSID.LSID_ZoomIn);
     btnZoomOut.ToolTip   = LangMan.LS(LSID.LSID_ZoomOut);
 }
Пример #12
0
        private void WriteEventList(PedigreePerson person, ExtList <PedigreeEvent> evList)
        {
            evList.QuickSort(EventsCompare);

            int evtNum = evList.Count;

            for (int i = 0; i < evtNum; i++)
            {
                GDMCustomEvent evt = evList[i].Event;
                if (evt != null && Equals(evList[i].IRec, person.IRec))
                {
                    var evtType = evt.GetTagType();

                    if (evtType == GEDCOMTagType.BIRT)
                    {
                        evList.Exchange(i, 0);
                    }
                    else if (evtType == GEDCOMTagType.DEAT)
                    {
                        evList.Exchange(i, evtNum - 1);
                    }
                }
            }

            fWriter.BeginList();

            for (int i = 0; i < evtNum; i++)
            {
                PedigreeEvent  evObj = evList[i];
                GDMCustomEvent evt   = evObj.Event;
                string         li;

                if (evObj.IRec == person.IRec)
                {
                    var    evtName = evt.GetTagName();
                    int    ev      = GKUtils.GetPersonEventIndex(evtName);
                    string st;
                    if (ev == 0)
                    {
                        st = evt.Classification;
                    }
                    else
                    {
                        st = (ev > 0) ? LangMan.LS(GKData.PersonEvents[ev].Name) : evtName;
                    }

                    string dt = GKUtils.GEDCOMEventToDateStr(evt, DateFormat.dfDD_MM_YYYY, false);
                    li = dt + ": " + st + ".";
                    if (evt.Place.StringValue != "")
                    {
                        li = li + " " + LangMan.LS(LSID.LSID_Place) + ": " + evt.Place.StringValue;
                    }

                    fWriter.AddListItem(" " + li, fTextFont);
                }
                else
                {
                    string dt = (evt == null) ? "?" : GKUtils.GEDCOMEventToDateStr(evt, DateFormat.dfDD_MM_YYYY, false);

                    string st = (evObj.IRec.Sex == GDMSex.svMale) ? LangMan.LS(LSID.LSID_HeWasBorn) : LangMan.LS(LSID.LSID_SheWasBorn);

                    li = string.Format("{0}: {1} {2}", dt, st, GKUtils.GetNameString(evObj.IRec, true, false));
                    PedigreePerson prs = FindPerson(evObj.IRec);
                    string         id  = (prs != null) ? prs.Id : "";

                    fWriter.AddListItemLink(" " + li + " ", fTextFont, id, fLinkFont);
                }
            }

            fWriter.EndList();
        }
Пример #13
0
        private void WriteExcessFmt(PedigreePerson person)
        {
            fWriter.AddParagraph(LangMan.LS(LSID.LSID_Sex) + ": " + GKUtils.SexStr(person.IRec.Sex), fTextFont);

            string st = GKUtils.GetLifeExpectancyStr(person.IRec);

            if (st != "?" && st != "")
            {
                fWriter.AddParagraph(LangMan.LS(LSID.LSID_LifeExpectancy) + ": " + st, fTextFont);
            }

            GDMFamilyRecord fam = person.IRec.GetParentsFamily();

            if (fam != null)
            {
                GDMIndividualRecord father = fam.Husband.Individual;
                if (father != null)
                {
                    fWriter.AddParagraphLink(LangMan.LS(LSID.LSID_Father) + ": " + GKUtils.GetNameString(father, true, false) + " ", fTextFont, idLink(father), fLinkFont);
                }

                GDMIndividualRecord mother = fam.Wife.Individual;
                if (mother != null)
                {
                    fWriter.AddParagraphLink(LangMan.LS(LSID.LSID_Mother) + ": " + GKUtils.GetNameString(mother, true, false) + " ", fTextFont, idLink(mother), fLinkFont);
                }
            }

            ExtList <PedigreeEvent> evList = new ExtList <PedigreeEvent>(true);

            try
            {
                int i;
                if (person.IRec.Events.Count > 0)
                {
                    fWriter.AddParagraph(LangMan.LS(LSID.LSID_Events) + ":", fTextFont);

                    int num = person.IRec.Events.Count;
                    for (i = 0; i < num; i++)
                    {
                        GDMCustomEvent evt = person.IRec.Events[i];
                        if (!(evt is GDMIndividualAttribute) || fOptions.PedigreeOptions.IncludeAttributes)
                        {
                            evList.Add(new PedigreeEvent(person.IRec, evt));
                        }
                    }
                    WriteEventList(person, evList);
                }

                int num2 = person.IRec.SpouseToFamilyLinks.Count;
                for (i = 0; i < num2; i++)
                {
                    GDMFamilyRecord family = person.IRec.SpouseToFamilyLinks[i].Family;
                    if (!fBase.Context.IsRecordAccess(family.Restriction))
                    {
                        continue;
                    }

                    GDMIndividualRecord spRec;
                    string unk;
                    if (person.IRec.Sex == GDMSex.svMale)
                    {
                        spRec = family.Wife.Individual;
                        st    = LangMan.LS(LSID.LSID_Wife) + ": ";
                        unk   = LangMan.LS(LSID.LSID_UnkFemale);
                    }
                    else
                    {
                        spRec = family.Husband.Individual;
                        st    = LangMan.LS(LSID.LSID_Husband) + ": ";
                        unk   = LangMan.LS(LSID.LSID_UnkMale);
                    }

                    string sps;
                    if (spRec != null)
                    {
                        sps = st + GKUtils.GetNameString(spRec, true, false) + GKUtils.GetPedigreeLifeStr(spRec, fOptions.PedigreeOptions.Format) /* + this.idLink(this.FindPerson(irec))*/;
                    }
                    else
                    {
                        sps = st + unk;
                    }

                    fWriter.AddParagraph(sps, fTextFont);

                    evList.Clear();
                    int childrenCount = family.Children.Count;
                    for (int j = 0; j < childrenCount; j++)
                    {
                        GDMIndividualRecord child = family.Children[j].Individual;
                        evList.Add(new PedigreeEvent(child, child.FindEvent(GEDCOMTagType.BIRT)));
                    }
                    WriteEventList(person, evList);
                }
            }
            finally
            {
                evList.Dispose();
            }

            if (fOptions.PedigreeOptions.IncludeNotes && person.IRec.Notes.Count != 0)
            {
                fWriter.AddParagraph(LangMan.LS(LSID.LSID_RPNotes) + ":", fTextFont);

                fWriter.BeginList();

                int notesCount = person.IRec.Notes.Count;
                for (int i = 0; i < notesCount; i++)
                {
                    GDMNotes note = person.IRec.Notes[i];
                    fWriter.AddListItem(" " + GKUtils.MergeStrings(note.Lines), fTextFont);
                }

                fWriter.EndList();
            }
        }
Пример #14
0
        public static bool DeleteRecord(IBaseWindow baseWin, GDMRecord record, bool confirm)
        {
            bool result = false;

            if (record != null)
            {
                string msg = "";
                switch (record.RecordType)
                {
                case GDMRecordType.rtIndividual:
                    msg = string.Format(LangMan.LS(LSID.LSID_PersonDeleteQuery), GKUtils.GetNameString(((GDMIndividualRecord)record), true, false));
                    break;

                case GDMRecordType.rtFamily:
                    msg = string.Format(LangMan.LS(LSID.LSID_FamilyDeleteQuery), GKUtils.GetFamilyString(baseWin.Context.Tree, (GDMFamilyRecord)record));
                    break;

                case GDMRecordType.rtNote:
                {
                    string value = GKUtils.TruncateStrings(((GDMNoteRecord)(record)).Lines, GKData.NOTE_NAME_MAX_LENGTH);
                    if (string.IsNullOrEmpty(value))
                    {
                        value = string.Format("#{0}", record.GetId().ToString());
                    }
                    msg = string.Format(LangMan.LS(LSID.LSID_NoteDeleteQuery), value);
                    break;
                }

                case GDMRecordType.rtMultimedia:
                    msg = string.Format(LangMan.LS(LSID.LSID_MediaDeleteQuery), ((GDMMultimediaRecord)record).GetFileTitle());
                    break;

                case GDMRecordType.rtSource:
                    msg = string.Format(LangMan.LS(LSID.LSID_SourceDeleteQuery), ((GDMSourceRecord)record).ShortTitle);
                    break;

                case GDMRecordType.rtRepository:
                    msg = string.Format(LangMan.LS(LSID.LSID_RepositoryDeleteQuery), ((GDMRepositoryRecord)record).RepositoryName);
                    break;

                case GDMRecordType.rtGroup:
                    msg = string.Format(LangMan.LS(LSID.LSID_GroupDeleteQuery), ((GDMGroupRecord)record).GroupName);
                    break;

                case GDMRecordType.rtResearch:
                    msg = string.Format(LangMan.LS(LSID.LSID_ResearchDeleteQuery), ((GDMResearchRecord)record).ResearchName);
                    break;

                case GDMRecordType.rtTask:
                    msg = string.Format(LangMan.LS(LSID.LSID_TaskDeleteQuery),
                                        GKUtils.GetTaskGoalStr(baseWin.Context.Tree, (GDMTaskRecord)record));
                    break;

                case GDMRecordType.rtCommunication:
                    msg = string.Format(LangMan.LS(LSID.LSID_CommunicationDeleteQuery), ((GDMCommunicationRecord)record).CommName);
                    break;

                case GDMRecordType.rtLocation:
                    msg = string.Format(LangMan.LS(LSID.LSID_LocationDeleteQuery), ((GDMLocationRecord)record).LocationName);
                    break;
                }

                if (confirm && AppHost.StdDialogs.ShowQuestionYN(msg))
                {
                    result = baseWin.Context.DeleteRecord(record);
                }
            }

            return(result);
        }
Пример #15
0
        private void SetEvent(GEDCOMCustomEvent value)
        {
            fEvent = value;

            if (fEvent is GEDCOMFamilyEvent)
            {
                int num = GKData.FamilyEvents.Length;
                for (int i = 0; i < num; i++)
                {
                    cmbEventType.Items.Add(LangMan.LS(GKData.FamilyEvents[i].Name));
                }

                int idx = GKUtils.GetFamilyEventIndex(fEvent.Name);
                if (idx < 0)
                {
                    idx = 0;
                }
                cmbEventType.SelectedIndex = idx;
            }
            else
            {
                int num = GKData.PersonEvents.Length;
                for (int i = 0; i < num; i++)
                {
                    cmbEventType.Items.Add(LangMan.LS(GKData.PersonEvents[i].Name));
                }

                int idx = GKUtils.GetPersonEventIndex(fEvent.Name);
                if (idx < 0)
                {
                    idx = 0;
                }
                cmbEventType.SelectedIndex = idx;

                if (idx >= 0 && GKData.PersonEvents[idx].Kind == PersonEventKind.ekFact)
                {
                    txtAttribute.Text = fEvent.StringValue;
                }
            }

            EditEventType_SelectedIndexChanged(null, null);

            GEDCOMCustomDate date = fEvent.Date.Value;

            if (date is GEDCOMDateRange)
            {
                GEDCOMDateRange dtRange = date as GEDCOMDateRange;

                if (dtRange.After.StringValue == "" && dtRange.Before.StringValue != "")
                {
                    cmbEventDateType.SelectedIndex = 1;
                }
                else if (dtRange.After.StringValue != "" && dtRange.Before.StringValue == "")
                {
                    cmbEventDateType.SelectedIndex = 2;
                }
                else if (dtRange.After.StringValue != "" && dtRange.Before.StringValue != "")
                {
                    cmbEventDateType.SelectedIndex = 3;
                }

                txtEventDate1.Text = dtRange.After.GetDisplayString(DateFormat.dfDD_MM_YYYY);
                txtEventDate2.Text = dtRange.Before.GetDisplayString(DateFormat.dfDD_MM_YYYY);
                SetComboCalendar(cmbDate1Calendar, dtRange.After.DateCalendar);
                SetComboCalendar(cmbDate2Calendar, dtRange.Before.DateCalendar);
                btnBC1.Checked = dtRange.After.YearBC;
                btnBC2.Checked = dtRange.Before.YearBC;
            }
            else if (date is GEDCOMDatePeriod)
            {
                GEDCOMDatePeriod dtPeriod = date as GEDCOMDatePeriod;

                if (dtPeriod.DateFrom.StringValue != "" && dtPeriod.DateTo.StringValue == "")
                {
                    cmbEventDateType.SelectedIndex = 4;
                }
                else if (dtPeriod.DateFrom.StringValue == "" && dtPeriod.DateTo.StringValue != "")
                {
                    cmbEventDateType.SelectedIndex = 5;
                }
                else if (dtPeriod.DateFrom.StringValue != "" && dtPeriod.DateTo.StringValue != "")
                {
                    cmbEventDateType.SelectedIndex = 6;
                }

                txtEventDate1.Text = dtPeriod.DateFrom.GetDisplayString(DateFormat.dfDD_MM_YYYY);
                txtEventDate2.Text = dtPeriod.DateTo.GetDisplayString(DateFormat.dfDD_MM_YYYY);
                SetComboCalendar(cmbDate1Calendar, dtPeriod.DateFrom.DateCalendar);
                SetComboCalendar(cmbDate2Calendar, dtPeriod.DateTo.DateCalendar);
                btnBC1.Checked = dtPeriod.DateFrom.YearBC;
                btnBC2.Checked = dtPeriod.DateTo.YearBC;
            }
            else if (date is GEDCOMDate)
            {
                GEDCOMApproximated approximated = (date as GEDCOMDate).Approximated;

                switch (approximated)
                {
                case GEDCOMApproximated.daExact:
                    cmbEventDateType.SelectedIndex = 0;
                    break;

                case GEDCOMApproximated.daAbout:
                    cmbEventDateType.SelectedIndex = 7;
                    break;

                case GEDCOMApproximated.daCalculated:
                    cmbEventDateType.SelectedIndex = 8;
                    break;

                case GEDCOMApproximated.daEstimated:
                    cmbEventDateType.SelectedIndex = 9;
                    break;
                }

                txtEventDate1.Text = (date as GEDCOMDate).GetDisplayString(DateFormat.dfDD_MM_YYYY);
                SetComboCalendar(cmbDate1Calendar, (date as GEDCOMDate).DateCalendar);
                btnBC1.Checked = (date as GEDCOMDate).YearBC;
            }
            else
            {
                cmbEventDateType.SelectedIndex = 0;
                txtEventDate1.Text             = "";
                cmbDate1Calendar.SelectedIndex = 0;
                btnBC1.Checked = false;
            }

            EditEventDateType_SelectedIndexChanged(null, null);
            txtEventName.Text  = fEvent.Classification;
            txtEventCause.Text = fEvent.Cause;
            txtEventOrg.Text   = fEvent.Agency;
            fLocation          = (fEvent.Place.Location.Value as GEDCOMLocationRecord);

            fNotesList.ListModel.DataOwner   = fEvent;
            fMediaList.ListModel.DataOwner   = fEvent;
            fSourcesList.ListModel.DataOwner = fEvent;

            ControlsRefresh();

            //ActiveControl = cmbEventType;
            cmbEventType.Focus();
        }
Пример #16
0
        protected override void InternalGenerate()
        {
            try {
                PrepareData();

                IColor clrBlack = AppHost.GfxProvider.CreateColor(0x000000);
                IColor clrBlue  = AppHost.GfxProvider.CreateColor(0x0000FF);

                fTitleFont   = fWriter.CreateFont("", 30f, true, false, clrBlack);
                fChapFont    = fWriter.CreateFont("", 16f, true, false, clrBlack);
                fSubchapFont = fWriter.CreateFont("", 14f, true, false, clrBlack);
                fLinkFont    = fWriter.CreateFont("", 8f, false, true, clrBlue);
                fTextFont    = fWriter.CreateFont("", 8f, false, false, clrBlack);
                fBoldFont    = fWriter.CreateFont("", 8f, true, false, clrBlack);
                fSymFont     = fWriter.CreateFont("", 12f, true, false, clrBlack);

                fWriter.EnablePageNumbers();

                var   pageSize = fWriter.GetPageSize();
                float halfpage = (pageSize.GetHeight() - (fTitleFont.Size * 4)) / 2f;
                fWriter.NewLine(0.0f, halfpage);
                fWriter.AddParagraph(fTitle, fTitleFont, TextAlignment.taCenter);
                fWriter.NewPage();

                fWriter.AddParagraph(LangMan.LS(LSID.LSID_TableOfContents), fChapFont);
                fWriter.NewLine();
                fWriter.AddParagraphLink("1. " + LangMan.LS(LSID.LSID_PersonalRecords), fLinkFont, "IndividualRecords");
                fWriter.AddParagraphLink("2. " + LangMan.LS(LSID.LSID_Indexes), fLinkFont, "Catalogs");

                int catNum = 0;
                for (BookCatalog cat = BookCatalog.Catalog_First; cat <= BookCatalog.Catalog_Last; cat++)
                {
                    CatalogProps catProps = BookCatalogs[(int)cat];

                    if (!SkipEmptyCatalogs || catProps.Index.Count > 0)
                    {
                        catNum++;
                        string title = "2." + catNum.ToString() + ". " + catProps.Title;

                        fWriter.BeginParagraph(TextAlignment.taLeft, 0.0f, 0.0f, 1f);
                        fWriter.AddParagraphChunkLink(title, fLinkFont, catProps.Sign);
                        fWriter.EndParagraph();
                    }
                }

                fWriter.NewPage();

                fWriter.BeginParagraph(TextAlignment.taCenter, 0, 20f);
                fWriter.AddParagraphChunkAnchor(LangMan.LS(LSID.LSID_PersonalRecords), fChapFont, "IndividualRecords");
                fWriter.EndParagraph();
                fWriter.NewLine();

                fWriter.BeginMulticolumns(3, 10f);
                char sym = '!';
                int  num = mainIndex.Count;
                for (int i = 0; i < num; i++)
                {
                    string text = mainIndex[i];
                    GDMIndividualRecord iRec = mainIndex.GetObject(i) as GDMIndividualRecord;

                    char isym = (string.IsNullOrEmpty(text)) ? '?' : text[0];
                    if ((isym >= 'A' && isym <= 'Z') || (isym >= 'А' && isym <= 'Я'))
                    {
                        if (sym != isym)
                        {
                            fWriter.AddParagraph("" + isym, fSymFont, TextAlignment.taCenter);
                            fWriter.NewLine();
                            sym = isym;
                        }
                    }

                    ExposePerson(iRec, text);

                    fWriter.NewLine();
                }
                fWriter.EndMulticolumns();

                fWriter.NewPage();

                fWriter.BeginParagraph(TextAlignment.taCenter, 0, 20f);
                fWriter.AddParagraphChunkAnchor(LangMan.LS(LSID.LSID_Indexes), fChapFont, "Catalogs");
                fWriter.EndParagraph();
                fWriter.NewLine();

                fWriter.BeginMulticolumns(3, 10f);
                for (BookCatalog cat = BookCatalog.Catalog_First; cat <= BookCatalog.Catalog_Last; cat++)
                {
                    CatalogProps catProps = BookCatalogs[(int)cat];

                    if (!SkipEmptyCatalogs || catProps.Index.Count > 0)
                    {
                        if (CatalogNewPages)
                        {
                            fWriter.NewPage();
                            fWriter.BeginMulticolumns(3, 10f);
                        }

                        ExposeCatalog(catProps);
                    }
                }

                fWriter.EndMulticolumns();
            } catch (Exception ex) {
                Logger.WriteError("FamilyBookExporter.InternalGenerate()", ex);
                throw;
            }
        }
Пример #17
0
 public override void EnablePageNumbers()
 {
     fPdfWriter.PageEvent = new PDFWriterEvents(fBaseFont, LangMan.LS(LSID.LSID_Page) + ": ");
 }
Пример #18
0
        private void ExposePerson(GDMIndividualRecord iRec, string iName)
        {
            fWriter.BeginParagraph(TextAlignment.taLeft, 0, 0, 0, true);
            fWriter.AddParagraphChunkAnchor(iName, fBoldFont, iRec.XRef);
            fWriter.AddParagraphChunk(GKUtils.GetPedigreeLifeStr(iRec, PedigreeFormat.Compact), fTextFont);
            fWriter.EndParagraph();

            IImage image = fBase.Context.GetPrimaryBitmap(iRec, 0, 0, false);

            fWriter.AddImage(image);

            GDMIndividualRecord father, mother;

            fBase.Context.Tree.GetParents(iRec, out father, out mother);

            if (father != null)
            {
                fWriter.BeginParagraph(TextAlignment.taLeft, 0, 0, 0);
                fWriter.AddParagraphChunk(LangMan.LS(LSID.LSID_Father) + ": ", fTextFont);
                fWriter.AddParagraphChunkLink(GKUtils.GetNameString(father, true, false), fLinkFont, father.XRef);
                fWriter.EndParagraph();
            }

            if (mother != null)
            {
                fWriter.BeginParagraph(TextAlignment.taLeft, 0, 0, 0);
                fWriter.AddParagraphChunk(LangMan.LS(LSID.LSID_Mother) + ": ", fTextFont);
                fWriter.AddParagraphChunkLink(GKUtils.GetNameString(mother, true, false), fLinkFont, mother.XRef);
                fWriter.EndParagraph();
            }

            if (IncludeEvents && iRec.Events.Count != 0)
            {
                int num = iRec.Events.Count;
                for (int i = 0; i < num; i++)
                {
                    GDMCustomEvent evt     = iRec.Events[i];
                    var            evtType = evt.GetTagType();
                    if (evtType == GEDCOMTagType.BIRT || evtType == GEDCOMTagType.DEAT)
                    {
                        continue;
                    }

                    string evtName = GKUtils.GetEventName(evt);
                    string evtVal  = evt.StringValue;
                    string evtDesc = GKUtils.GetEventDesc(fBase.Context.Tree, evt, false);

                    string tmp = evtName + ": " + evtVal;
                    if (evtVal != "")
                    {
                        tmp += ", ";
                    }
                    tmp += evtDesc;

                    fWriter.AddParagraph(tmp, fTextFont);
                }
            }

            if (IncludeNotes && iRec.Notes.Count != 0)
            {
                int num = iRec.Notes.Count;
                for (int i = 0; i < num; i++)
                {
                    GDMLines noteLines = fTree.GetNoteLines(iRec.Notes[i]);
                    fWriter.AddParagraph(GKUtils.MergeStrings(noteLines), fTextFont);
                }
            }
        }
Пример #19
0
        public GKSheetList(Control owner)
        {
            if (owner == null)
            {
                throw new ArgumentNullException("owner");
            }

            fBtnMoveDown             = new ToolStripButton();
            fBtnMoveDown.Image       = UIHelper.LoadResourceImage("Resources.btn_down.gif");
            fBtnMoveDown.ToolTipText = LangMan.LS(LSID.LSID_RecordMoveDown);
            fBtnMoveDown.Click      += ItemMoveDown;

            fBtnMoveUp             = new ToolStripButton();
            fBtnMoveUp.Image       = UIHelper.LoadResourceImage("Resources.btn_up.gif");
            fBtnMoveUp.ToolTipText = LangMan.LS(LSID.LSID_RecordMoveUp);
            fBtnMoveUp.Click      += ItemMoveUp;

            fBtnLinkJump             = new ToolStripButton();
            fBtnLinkJump.Image       = UIHelper.LoadResourceImage("Resources.btn_jump.gif");
            fBtnLinkJump.ToolTipText = LangMan.LS(LSID.LSID_RecordGoto);
            fBtnLinkJump.Click      += ItemJump;

            fBtnDelete             = new ToolStripButton();
            fBtnDelete.Name        = "btnDelete";
            fBtnDelete.Image       = UIHelper.LoadResourceImage("Resources.btn_rec_delete.gif");
            fBtnDelete.ToolTipText = LangMan.LS(LSID.LSID_MIRecordDelete);
            fBtnDelete.Click      += ItemDelete;

            fBtnEdit             = new ToolStripButton();
            fBtnEdit.Name        = "btnEdit";
            fBtnEdit.Image       = UIHelper.LoadResourceImage("Resources.btn_rec_edit.gif");
            fBtnEdit.ToolTipText = LangMan.LS(LSID.LSID_MIRecordEdit);
            fBtnEdit.Click      += ItemEdit;

            fBtnAdd             = new ToolStripButton();
            fBtnAdd.Name        = "btnAdd";
            fBtnAdd.Image       = UIHelper.LoadResourceImage("Resources.btn_rec_new.gif");
            fBtnAdd.ToolTipText = LangMan.LS(LSID.LSID_MIRecordAdd);
            fBtnAdd.Click      += ItemAdd;

            fToolBar      = new ToolStrip();
            fToolBar.Name = "ToolBar";
            fToolBar.Dock = DockStyle.Right;
            fToolBar.Items.AddRange(new ToolStripItem[] {
                fBtnAdd,
                fBtnEdit,
                fBtnDelete,
                fBtnLinkJump,
                fBtnMoveUp,
                fBtnMoveDown
            });
            fToolBar.GripStyle        = ToolStripGripStyle.Hidden;
            fToolBar.ImageScalingSize = new Size(24, 20);
            fToolBar.AutoSize         = true;
            fToolBar.ShowItemToolTips = true;

            fList               = new GKListView();
            fList.Dock          = DockStyle.Fill;
            fList.Location      = new Point(0, 0);
            fList.Size          = new Size(500, 290);
            fList.HideSelection = false;
            fList.LabelEdit     = false;
            fList.FullRowSelect = true;
            fList.View          = View.Details;
            fList.DoubleClick  += List_DoubleClick;
            fList.KeyDown      += List_KeyDown;

            SuspendLayout();
            Controls.Add(fList);
            Controls.Add(fToolBar);
            ResumeLayout(false);

            Dock = DockStyle.Fill;

            owner.SuspendLayout();
            owner.Controls.Add(this);
            owner.ResumeLayout(false);

            fButtons = EnumSet <SheetButton> .Create(SheetButton.lbAdd, SheetButton.lbEdit, SheetButton.lbDelete);

            fListModel = null;
        }
Пример #20
0
 public FamilyBookExporter(IBaseWindow baseWin)
     : base(baseWin, true)
 {
     fTitle = LangMan.LS(LSID.LSID_FamilyBook);
 }
Пример #21
0
 private void EditName_TextChanged(object sender, EventArgs e)
 {
     Text = string.Format("{0} \"{1}\"", LangMan.LS(LSID.LSID_Location), txtName.Text);
 }
Пример #22
0
        protected override void InternalGenerate()
        {
            IColor clrBlack = AppHost.GfxProvider.CreateColor(0x000000);
            IColor clrBlue  = AppHost.GfxProvider.CreateColor(0x0000FF);

            fTitleFont = fWriter.CreateFont("", 14f, true, false, clrBlack);
            fChapFont  = fWriter.CreateFont("", 12f, true, false, clrBlack);
            fTextFont  = fWriter.CreateFont("", 10f, false, false, clrBlack);

            //fWriter.AddParagraph(fTitle, fTitleFont, TextAlignment.taLeft);
            fWriter.AddParagraph(GKUtils.GetNameString(fPerson, true, false), fTitleFont, TextAlignment.taLeft);
            fWriter.NewLine();

            var evList = new List <PersonalEvent>();

            GDMIndividualRecord father = null, mother = null;

            if (fPerson.ChildToFamilyLinks.Count > 0)
            {
                GDMFamilyRecord family = fPerson.ChildToFamilyLinks[0].Family;
                if (fBase.Context.IsRecordAccess(family.Restriction))
                {
                    father = family.Husband.Individual;
                    mother = family.Wife.Individual;
                }
            }

            ExtractEvents(EventType.Personal, evList, fPerson);

            int num2 = fPerson.SpouseToFamilyLinks.Count;

            for (int j = 0; j < num2; j++)
            {
                GDMFamilyRecord family = fPerson.SpouseToFamilyLinks[j].Family;
                if (!fBase.Context.IsRecordAccess(family.Restriction))
                {
                    continue;
                }

                ExtractEvents(EventType.Spouse, evList, family);

                int num3 = family.Children.Count;
                for (int i = 0; i < num3; i++)
                {
                    GDMIndividualRecord child = family.Children[i].Individual;
                    GDMCustomEvent      evt   = child.FindEvent(GEDCOMTagType.BIRT);
                    if (evt != null && evt.GetChronologicalYear() != 0)
                    {
                        evList.Add(new PersonalEvent(EventType.Child, child, evt));
                    }
                }
            }

            SortHelper.QuickSort(evList, EventsCompare);
            fWriter.BeginList();

            int num4 = evList.Count;

            for (int i = 0; i < num4; i++)
            {
                PersonalEvent evObj = evList[i];
                if (!evObj.Date.HasKnownYear())
                {
                    continue;
                }

                GDMCustomEvent evt = evObj.Event;
                string         st  = GKUtils.GetEventName(evt);
                string         dt  = GKUtils.GEDCOMEventToDateStr(evt, GlobalOptions.Instance.DefDateFormat, false);

                if (ShowAges)
                {
                    int year = evt.GetChronologicalYear();
                    int age  = (evObj.Rec == fPerson) ? GKUtils.GetAge(fPerson, year) : -1;
                    if (age >= 0)
                    {
                        dt += string.Format(" ({0})", age);
                    }
                }

                string li = dt + ": " + st + ".";
                if (evt.Place.StringValue != "")
                {
                    li = li + " " + LangMan.LS(LSID.LSID_Place) + ": " + evt.Place.StringValue;
                }
                fWriter.AddListItem("   " + li, fTextFont);

                if (evObj.Rec is GDMIndividualRecord)
                {
                    GDMIndividualRecord iRec = evObj.Rec as GDMIndividualRecord;

                    if (evt.GetTagType() == GEDCOMTagType.BIRT)
                    {
                        if (evObj.Type == EventType.Personal)
                        {
                            if (father != null)
                            {
                                fWriter.AddListItem("   " + "   " + LangMan.LS(LSID.LSID_Father) + ": " + GKUtils.GetNameString(father, true, false) + " ", fTextFont);
                            }
                            if (mother != null)
                            {
                                fWriter.AddListItem("   " + "   " + LangMan.LS(LSID.LSID_Mother) + ": " + GKUtils.GetNameString(mother, true, false) + " ", fTextFont);
                            }
                        }
                        else if (evObj.Type == EventType.Child)
                        {
                            if (iRec.Sex == GDMSex.svMale)
                            {
                                st = LangMan.LS(LSID.LSID_RK_Son) + ": ";
                            }
                            else
                            {
                                st = LangMan.LS(LSID.LSID_RK_Daughter) + ": ";
                            }
                            st = ConvertHelper.UniformName(st) + GKUtils.GetNameString(iRec, true, false);
                            fWriter.AddListItem("   " + "   " + st, fTextFont);
                        }
                    }
                }
                else if (evObj.Rec is GDMFamilyRecord)
                {
                    GDMFamilyRecord famRec = evObj.Rec as GDMFamilyRecord;

                    GDMIndividualRecord sp;
                    string unk;
                    if (fPerson.Sex == GDMSex.svMale)
                    {
                        sp  = famRec.Wife.Individual;
                        st  = LangMan.LS(LSID.LSID_Wife) + ": ";
                        unk = LangMan.LS(LSID.LSID_UnkFemale);
                    }
                    else
                    {
                        sp  = famRec.Husband.Individual;
                        st  = LangMan.LS(LSID.LSID_Husband) + ": ";
                        unk = LangMan.LS(LSID.LSID_UnkMale);
                    }

                    string sps;
                    if (sp != null)
                    {
                        sps = st + GKUtils.GetNameString(sp, true, false) /* + GKUtils.GetPedigreeLifeStr(sp, fOptions.PedigreeOptions.Format)*/;
                    }
                    else
                    {
                        sps = st + unk;
                    }
                    fWriter.AddListItem("   " + "   " + sps, fTextFont);
                }
            }

            fWriter.EndList();
        }
Пример #23
0
        public void SetLang()
        {
            btnAccept.Text     = LangMan.LS(LSID.LSID_DlgAccept);
            btnCancel.Text     = LangMan.LS(LSID.LSID_DlgCancel);
            Text               = LangMan.LS(LSID.LSID_MIOptions);
            pageCommon.Text    = LangMan.LS(LSID.LSID_Common);
            pageUIView.Text    = LangMan.LS(LSID.LSID_Interface);
            pageTreeChart.Text = LangMan.LS(LSID.LSID_Trees);
            pagePedigree.Text  = LangMan.LS(LSID.LSID_Pedigrees);

            grpInternet.Text      = LangMan.LS(LSID.LSID_Internet);
            chkUseProxy.Text      = LangMan.LS(LSID.LSID_ProxyUse);
            lblProxyServer.Text   = LangMan.LS(LSID.LSID_ProxyServer);
            lblProxyPort.Text     = LangMan.LS(LSID.LSID_ProxyPort);
            lblProxyLogin.Text    = LangMan.LS(LSID.LSID_ProxyLogin);
            lblProxyPassword.Text = LangMan.LS(LSID.LSID_Password);

            grpOther.Text = LangMan.LS(LSID.LSID_Other);

            chkShowOnStart.Text         = LangMan.LS(LSID.LSID_StartupTips);
            lblLanguage.Text            = LangMan.LS(LSID.LSID_Language);
            pageViewCommon.Text         = LangMan.LS(LSID.LSID_ListsAll);
            pageViewPersons.Text        = LangMan.LS(LSID.LSID_ListPersons);
            rgFNPFormat.Text            = LangMan.LS(LSID.LSID_NamesFormat);
            radSNP.Text                 = LangMan.LS(LSID.LSID_NF1);
            radS_NP.Text                = LangMan.LS(LSID.LSID_NF2);
            radS_N_P.Text               = LangMan.LS(LSID.LSID_NF3);
            grpDateFormat.Text          = LangMan.LS(LSID.LSID_DateFormat);
            chkPlacesWithAddress.Text   = LangMan.LS(LSID.LSID_PlacesWithAddress);
            chkHighlightUnparented.Text = LangMan.LS(LSID.LSID_HighlightUnparented);
            chkHighlightUnmarried.Text  = LangMan.LS(LSID.LSID_HighlightUnmarried);
            btnDefList.Text             = LangMan.LS(LSID.LSID_DefList);
            grpTreePersons.Text         = LangMan.LS(LSID.LSID_ViewTree);
            chkSurname.Text             = LangMan.LS(LSID.LSID_Surname);
            chkName.Text                = LangMan.LS(LSID.LSID_Name);
            chkPatronymic.Text          = LangMan.LS(LSID.LSID_Patronymic);
            chkDiffLines.Text           = LangMan.LS(LSID.LSID_DiffLines);
            chkBirthDate.Text           = LangMan.LS(LSID.LSID_BirthDate);
            chkDeathDate.Text           = LangMan.LS(LSID.LSID_DeathDate);
            chkOnlyYears.Text           = LangMan.LS(LSID.LSID_OnlyYears);
            chkKinship.Text             = LangMan.LS(LSID.LSID_Kinship);
            chkSignsVisible.Text        = LangMan.LS(LSID.LSID_SignsVisible);
            chkTreeDecorative.Text      = LangMan.LS(LSID.LSID_TreeDecorative);
            chkPortraitsVisible.Text    = LangMan.LS(LSID.LSID_PortraitsVisible);
            chkDefaultPortraits.Text    = LangMan.LS(LSID.LSID_DefaultPortraits);
            chkChildlessExclude.Text    = LangMan.LS(LSID.LSID_ChildlessExclude);
            chkInvertedTree.Text        = LangMan.LS(LSID.LSID_InvertedTree);
            chkMarriagesDates.Text      = LangMan.LS(LSID.LSID_MarriagesDates);
            grpTreeDecor.Text           = LangMan.LS(LSID.LSID_Decor);
            lblMaleColor.Text           = LangMan.LS(LSID.LSID_Man);
            lblFemaleColor.Text         = LangMan.LS(LSID.LSID_Woman);
            lblUnkSexColor.Text         = LangMan.LS(LSID.LSID_UnkSex);
            lblUnHusbandColor.Text      = LangMan.LS(LSID.LSID_UnHusband);
            lblUnWifeColor.Text         = LangMan.LS(LSID.LSID_UnWife);
            lblFont.Text                = LangMan.LS(LSID.LSID_Font);
            grpPedigree.Text            = LangMan.LS(LSID.LSID_PedigreeGen);
            chkAttributes.Text          = LangMan.LS(LSID.LSID_IncludeAttributes);
            chkNotes.Text               = LangMan.LS(LSID.LSID_IncludeNotes);
            chkSources.Text             = LangMan.LS(LSID.LSID_IncludeSources);
            grpPedigreeFormat.Text      = LangMan.LS(LSID.LSID_PedigreeFormat);
            radExcess.Text              = LangMan.LS(LSID.LSID_PF1);
            radCompact.Text             = LangMan.LS(LSID.LSID_PF2);
            pageCharts.Text             = LangMan.LS(LSID.LSID_Charts);
            pagePlugins.Text            = LangMan.LS(LSID.LSID_Plugins);
            chkShowDatesCalendar.Text   = LangMan.LS(LSID.LSID_ShowDatesCalendar);
            chkShowDatesSigns.Text      = LangMan.LS(LSID.LSID_ShowDatesSigns);
            chkShowPlaces.Text          = LangMan.LS(LSID.LSID_ShowPlaces);
            chkHideUnknownSpouses.Text  = LangMan.LS(LSID.LSID_HideUnknownSpouses);

            grpFileBackup.Text     = LangMan.LS(LSID.LSID_FileBackup);
            radFBNone.Text         = LangMan.LS(LSID.LSID_Not);
            radFBOnlyPrev.Text     = LangMan.LS(LSID.LSID_BackupOnlyPrev);
            radFBEachRevision.Text = LangMan.LS(LSID.LSID_BackupEachRevision);

            chkAutosave.Text = LangMan.LS(LSID.LSID_Autosave);
            lblMinutes.Text  = LangMan.LS(LSID.LSID_Minutes);

            chkGenerations.Text = LangMan.LS(LSID.LSID_IncludeGenerations);
            pageAncCircle.Text  = LangMan.LS(LSID.LSID_AncestorsCircle);

            grpAdvancedNames.Text       = LangMan.LS(LSID.LSID_AdditionalNames);
            chkExtendWomanSurnames.Text = LangMan.LS(LSID.LSID_ExtendedWomanSurnames);
            radMaiden_Married.Text      = LangMan.LS(LSID.LSID_WSF_Maiden_Married);
            radMarried_Maiden.Text      = LangMan.LS(LSID.LSID_WSF_Married_Maiden);
            radMaiden.Text  = LangMan.LS(LSID.LSID_WSF_Maiden);
            radMarried.Text = LangMan.LS(LSID.LSID_WSF_Married);

            lblGeocoder.Text = LangMan.LS(LSID.LSID_Geocoder);
            chkRemovableMediaWarning.Text = LangMan.LS(LSID.LSID_RemovableMediaWarningOption);
            chkLoadRecentFiles.Text       = LangMan.LS(LSID.LSID_LoadRecentFiles);
            chkEmbeddedMediaPlayer.Text   = LangMan.LS(LSID.LSID_EmbeddedMediaPlayer);
            pageMultimedia.Text           = LangMan.LS(LSID.LSID_RPMultimedia);
            chkAllowMediaDirectRefs.Text  = LangMan.LS(LSID.LSID_AllowMediaDirectReferences);
            chkAutoCheckUpdates.Text      = LangMan.LS(LSID.LSID_AutoCheckUpdates);

            grpSpacings.Text   = LangMan.LS(LSID.LSID_Spacings);
            lblMargins.Text    = LangMan.LS(LSID.LSID_Margins);
            lblBranchDist.Text = LangMan.LS(LSID.LSID_BranchDist);
            lblGenDist.Text    = LangMan.LS(LSID.LSID_GenDist);
            lblSpouseDist.Text = LangMan.LS(LSID.LSID_SpouseDist);

            chkAutoSortChildren.Text = LangMan.LS(LSID.LSID_AutoSortChildren);
            chkAutoSortSpouses.Text  = LangMan.LS(LSID.LSID_AutoSortSpouses);
            chkCheckTreeSize.Text    = LangMan.LS(LSID.LSID_CheckTreeSize);
            chkCharsetDetection.Text = LangMan.LS(LSID.LSID_CharsetDetection);
        }
Пример #24
0
        public override void Modify(object sender, ModifyEventArgs eArgs)
        {
            var dataOwner = fDataOwner as IGEDCOMStructWithLists;

            if (fBaseWin == null || fSheetList == null || dataOwner == null)
            {
                return;
            }

            GDMCustomEvent      evt    = eArgs.ItemData as GDMCustomEvent;
            GDMRecordWithEvents record = dataOwner as GDMRecordWithEvents;

            bool result = false;

            try {
                switch (eArgs.Action)
                {
                case RecordAction.raAdd:
                case RecordAction.raEdit:
                    using (var dlgEventEdit = AppHost.ResolveDialog <IEventEditDlg>(fBaseWin)) {
                        bool exists = (evt != null);

                        GDMCustomEvent newEvent;
                        if (evt != null)
                        {
                            newEvent = evt;
                        }
                        else
                        {
                            if (record is GDMIndividualRecord)
                            {
                                newEvent = new GDMIndividualEvent(record);
                            }
                            else
                            {
                                newEvent = new GDMFamilyEvent(record);
                            }
                        }

                        dlgEventEdit.Event = newEvent;
                        result             = AppHost.Instance.ShowModalX(dlgEventEdit, true);

                        if (!result)
                        {
                            if (!exists)
                            {
                                newEvent.Dispose();
                            }
                        }
                        else
                        {
                            newEvent = dlgEventEdit.Event;

                            if (!exists)
                            {
                                result = fUndoman.DoOrdinaryOperation(OperationType.otRecordEventAdd, record, newEvent);
                            }
                            else
                            {
                                if (record is GDMIndividualRecord && newEvent != evt)
                                {
                                    fUndoman.DoOrdinaryOperation(OperationType.otRecordEventRemove, record, evt);
                                    result = fUndoman.DoOrdinaryOperation(OperationType.otRecordEventAdd, record, newEvent);
                                }
                            }

                            evt = newEvent;
                            fBaseWin.Context.CollectEventValues(evt);
                        }
                    }
                    break;

                case RecordAction.raDelete:
                    if (AppHost.StdDialogs.ShowQuestionYN(LangMan.LS(LSID.LSID_RemoveEventQuery)))
                    {
                        result = fUndoman.DoOrdinaryOperation(OperationType.otRecordEventRemove, record, evt);
                        evt    = null;
                    }
                    break;

                case RecordAction.raMoveUp:
                case RecordAction.raMoveDown:
                {
                    int idx = record.Events.IndexOf(evt);
                    switch (eArgs.Action)
                    {
                    case RecordAction.raMoveUp:
                        record.Events.Exchange(idx - 1, idx);
                        break;

                    case RecordAction.raMoveDown:
                        record.Events.Exchange(idx, idx + 1);
                        break;
                    }
                    result = true;
                }
                break;
                }
            } catch (Exception ex) {
                Logger.LogWrite("EventsListModel.Modify(): " + ex.Message);
                result = false;
            }

            if (result)
            {
                if (eArgs.Action == RecordAction.raAdd)
                {
                    eArgs.ItemData = evt;
                }

                fBaseWin.Context.Modified = true;
                eArgs.IsChanged           = true;
            }
        }
Пример #25
0
        /* TODO(zsv): Need to find an appropriate icon in the general style
         * for the main toolbar - screenshot capture for windows with charts. */
        public void SaveSnapshot(string fileName)
        {
            string ext = FileHelper.GetFileExtension(fileName);

            ExtSize imageSize = GetImageSize();

            if (ext == ".svg")
            {
                var prevRenderer = fRenderer;
                SetRenderer(new SVGRenderer(fileName, imageSize.Width, imageSize.Height));
                fRenderer.BeginDrawing();
                try {
                    using (var gfx = CreateGraphics()) {
                        fRenderer.SetTarget(gfx);

                        RenderImage(RenderTarget.SVG);
                    }
                } finally {
                    fRenderer.EndDrawing();
                    SetRenderer(prevRenderer);
                }

                return;
            }

            if ((ext == ".bmp" || ext == ".jpg") && imageSize.Width >= 65535)
            {
                AppHost.StdDialogs.ShowError(LangMan.LS(LSID.LSID_TooMuchWidth));
            }
            else
            {
                ImageFormat imFmt = ImageFormat.Png;
                if (ext == ".bmp")
                {
                    imFmt = ImageFormat.Bitmap;
                }
                else if (ext == ".png")
                {
                    imFmt = ImageFormat.Png;
                }
                else if (ext == ".gif")
                {
                    imFmt = ImageFormat.Gif;
                }
                else if (ext == ".jpg")
                {
                    imFmt = ImageFormat.Jpeg;
                }

                /*else
                 *  if (ext == ".emf") { imFmt = ImageFormat.Emf; }*/

                /*Image pic;
                 * if (Equals(imFmt, ImageFormat.Emf)) {
                 *  using (var gfx = CreateGraphics()) {
                 *      pic = new Metafile(fileName, gfx.GetHdc());
                 *  }
                 * } else {
                 *  pic = new Bitmap(imageSize.Width, imageSize.Height, PixelFormat.Format24bppRgb);
                 * }*/

                Bitmap pic = new Bitmap(imageSize.Width, imageSize.Height, PixelFormat.Format24bppRgb);
                try {
                    //using (Graphics gfx = Graphics.FromImage(pic)) {
                    using (Graphics gfx = new Graphics(pic)) {
                        fRenderer.SetTarget(gfx);
                        RenderImage(RenderTarget.RasterFile);
                    }

                    ((Bitmap)pic).Save(fileName, imFmt);
                } finally {
                    pic.Dispose();
                }
            }
        }
Пример #26
0
        public void LoadPlaces()
        {
            try {
                PlacesCache.Instance.Load();

                IProgressController progress = AppHost.Progress;
                GDMTree             tree     = fBase.Context.Tree;

                fView.MapBrowser.InitMap();

                fView.PersonsCombo.BeginUpdate();
                fView.PlacesTree.BeginUpdate();
                progress.ProgressInit(LangMan.LS(LSID.LSID_LoadingLocations), tree.RecordsCount);
                try {
                    fBaseRoot = fView.PlacesTree.AddNode(null, LangMan.LS(LSID.LSID_RPLocations), null);

                    fPlaces.Clear();
                    var personValues = new StringList();

                    int num = tree.RecordsCount;
                    for (int i = 0; i < num; i++)
                    {
                        GDMRecord rec = tree[i];
                        bool      res = rec is GDMIndividualRecord && IsSelected(rec);

                        if (res)
                        {
                            GDMIndividualRecord ind = rec as GDMIndividualRecord;
                            int pCnt = 0;

                            int num2 = ind.Events.Count;
                            for (int j = 0; j < num2; j++)
                            {
                                GDMCustomEvent ev = ind.Events[j];
                                if (ev.Place.StringValue != "")
                                {
                                    AddPlace(ev.Place, ev);
                                    pCnt++;
                                }
                            }

                            if (pCnt > 0)
                            {
                                personValues.AddObject(GKUtils.GetNameString(ind, true, false) + " [" + pCnt.ToString() + "]", ind);
                            }
                        }

                        progress.ProgressStep();
                    }

                    fView.PlacesTree.Expand(fBaseRoot);

                    personValues.Sort();
                    fView.PersonsCombo.Clear();
                    fView.PersonsCombo.AddItem(LangMan.LS(LSID.LSID_NotSelected), null);
                    fView.PersonsCombo.AddStrings(personValues);

                    fView.SelectPlacesBtn.Enabled = true;
                } finally {
                    progress.ProgressDone();
                    fView.PlacesTree.EndUpdate();
                    fView.PersonsCombo.EndUpdate();

                    PlacesCache.Instance.Save();
                }
            } catch (Exception ex) {
                Logger.LogWrite("MapsViewerWin.PlacesLoad(): " + ex.Message);
            }
        }
Пример #27
0
 private void EditSpouse_TextChanged(object sender, EventArgs e)
 {
     Title = string.Format("{0} \"{1} - {2}\"", LangMan.LS(LSID.LSID_Family), txtHusband.Text, txtWife.Text);
 }
Пример #28
0
        private bool CheckFormat()
        {
            bool result = false;

            try {
                int fileVer;
                // remove a deprecated features
                if (fFormat == GEDCOMFormat.gf_Native)
                {
                    GDMHeader header = fTree.Header;
                    GDMTag    tag;

                    tag = header.FindTag("_ADVANCED", 0);
                    if (tag != null)
                    {
                        header.DeleteTag("_ADVANCED");
                    }

                    tag = header.FindTag("_EXT_NAME", 0);
                    if (tag != null)
                    {
                        header.DeleteTag("_EXT_NAME");
                    }

                    fileVer = ConvertHelper.ParseInt(header.Source.Version, GKData.APP_FORMAT_DEFVER);
                }
                else
                {
                    fileVer = -1;
                }

                fProgress.ProgressInit(LangMan.LS(LSID.LSID_FormatCheck), 100);
                try {
                    bool xrefValid    = true;
                    bool isExtraneous = (fFormat != GEDCOMFormat.gf_Native);

                    int progress = 0;
                    int num      = fTree.RecordsCount;
                    for (int i = 0; i < num; i++)
                    {
                        GDMRecord rec = fTree[i];
                        CheckRecord(rec, fileVer);

                        if (isExtraneous && xrefValid && !CheckRecordXRef(rec))
                        {
                            xrefValid = false;
                        }

                        int newProgress = (int)Math.Min(100, ((i + 1) * 100.0f) / num);
                        if (progress != newProgress)
                        {
                            progress = newProgress;
                            fProgress.ProgressStep(progress);
                        }
                    }

                    // obsolete: AppHost.StdDialogs.ShowQuestionYN(LangMan.LS(LSID.LSID_IDsCorrectNeed))
                    if (!xrefValid)
                    {
                        ConvertIdentifiers();
                    }

                    fTree.TrimExcess();

                    result = true;
                } finally {
                    fProgress.ProgressDone();
                }
            } catch (Exception ex) {
                Logger.WriteError("GEDCOMChecker.CheckFormat()", ex);
                AppHost.StdDialogs.ShowError(LangMan.LS(LSID.LSID_CheckGedComFailed));
            }

            return(result);
        }
Пример #29
0
 public PedigreeExporter(IBaseWindow baseWin, GDMIndividualRecord root) : base(baseWin, false)
 {
     fRoot        = root;
     fTitle       = LangMan.LS(LSID.LSID_ExpPedigree) + ": " + GKUtils.GetNameString(fRoot, true, false);
     fShieldState = baseWin.Context.ShieldState;
 }
Пример #30
0
        public static Graph GetPatriarchsGraph(IBaseContext context, int gensMin,
                                               bool datesCheck, bool loneSuppress)
        {
            Graph graph = new Graph();

            try
            {
                using (ExtList <PatriarchObj> patList = GetPatriarchsList(context, gensMin, datesCheck))
                {
                    // init
                    GKUtils.InitExtData(context.Tree);

                    // prepare
                    int count = patList.Count;
                    for (int i = 0; i < count; i++)
                    {
                        PatriarchObj        patNode = patList[i];
                        GDMIndividualRecord iRec    = patNode.IRec;

                        int count2 = iRec.SpouseToFamilyLinks.Count;
                        for (int k = 0; k < count2; k++)
                        {
                            GDMFamilyRecord family = iRec.SpouseToFamilyLinks[k].Family;
                            family.ExtData = new PGNode(family.XRef, PGNodeType.Patriarch, patNode.DescGenerations);
                        }
                    }

                    IProgressController progress = AppHost.Progress;
                    try
                    {
                        int patCount = patList.Count;
                        progress.ProgressInit(LangMan.LS(LSID.LSID_LinksSearch), patCount);

                        for (int i = 0; i < patCount; i++)
                        {
                            PatriarchObj patr = patList[i];

                            for (int j = i + 1; j < patCount; j++)
                            {
                                PatriarchObj patr2 = patList[j];

                                GDMFamilyRecord cross = TreeTools.PL_SearchIntersection(patr.IRec, patr2.IRec);

                                if (cross != null)
                                {
                                    PGNode node = (PGNode)cross.ExtData;

                                    if (node != null && node.Type == PGNodeType.Patriarch)
                                    {
                                        // dummy
                                    }
                                    else
                                    {
                                        int size = GKUtils.GetDescGenerations(cross.Husband.Individual);
                                        if (size == 0)
                                        {
                                            size = 1;
                                        }
                                        cross.ExtData = new PGNode(cross.XRef, PGNodeType.Intersection, size);
                                    }
                                }
                            }

                            progress.ProgressStep();
                        }
                    }
                    finally
                    {
                        progress.ProgressDone();
                    }

                    // create graph
                    int count3 = patList.Count;
                    for (int i = 0; i < count3; i++)
                    {
                        PatriarchObj patNode = patList[i];
                        PL_WalkDescLinks(graph, null, patNode.IRec);
                    }

                    // clear
                    GKUtils.InitExtData(context.Tree);

                    /*if (gpl_params.aLoneSuppress) {
                     *          for (int i = aList.Count - 1; i >= 0; i--) {
                     *                  PatriarchObj patr = aList[i] as PatriarchObj;
                     *                  if (patr.ILinks.Count == 0) aList.Delete(i);
                     *          }
                     *          aList.Pack();*/
                }
            }
            catch (Exception ex)
            {
                Logger.LogWrite("PatriarchsMan.GetPatriarchsGraph(): " + ex.Message);
            }

            return(graph);
        }