Exemple #1
0
        public void LoadFromFile(IniFile iniFile)
        {
            if (iniFile == null)
            {
                throw new ArgumentNullException("iniFile");
            }

            FamilyVisible     = iniFile.ReadBool("Chart", "FamilyVisible", true);
            NameVisible       = iniFile.ReadBool("Chart", "NameVisible", true);
            PatronymicVisible = iniFile.ReadBool("Chart", "PatronymicVisible", true);
            NickVisible       = iniFile.ReadBool("Chart", "NickVisible", true);
            DiffLines         = iniFile.ReadBool("Chart", "DiffLines", true);

            BirthDateVisible = iniFile.ReadBool("Chart", "BirthDateVisible", true);
            DeathDateVisible = iniFile.ReadBool("Chart", "DeathDateVisible", true);
            OnlyYears        = iniFile.ReadBool("Chart", "OnlyYears", true);

            Kinship               = iniFile.ReadBool("Chart", "Kinship", false);
            SignsVisible          = iniFile.ReadBool("Chart", "SignsVisible", false);
            PortraitsVisible      = iniFile.ReadBool("Chart", "PortraitsVisible", true);
            DefaultPortraits      = iniFile.ReadBool("Chart", "DefaultPortraits", false);
            CertaintyIndexVisible = iniFile.ReadBool("Chart", "CertaintyIndexVisible", false);
            TraceSelected         = iniFile.ReadBool("Chart", "TraceSelected", true);
            ChildlessExclude      = iniFile.ReadBool("Chart", "ChildlessExclude", false);
            Decorative            = iniFile.ReadBool("Chart", "Decorative", true);
            //DeepMode = (DeepMode)iniFile.ReadInteger("Chart", "DeepMode", 0);
            InvertedTree                 = iniFile.ReadBool("Chart", "InvertedTree", false);
            MarriagesDates               = iniFile.ReadBool("Chart", "MarriagesDates", false);
            ShowPlaces                   = iniFile.ReadBool("Chart", "ShowPlaces", false);
            HideUnknownSpouses           = iniFile.ReadBool("Chart", "HideUnknownSpouses", false);
            DottedLinesOfAdoptedChildren = iniFile.ReadBool("Chart", "DottedLinesOfAdoptedChildren", false);
            SeparateDatesAndPlacesLines  = iniFile.ReadBool("Chart", "SeparateDatesAndPlacesLines", false);
            BoldNames   = iniFile.ReadBool("Chart", "BoldNames", false);
            BorderStyle = (GfxBorderStyle)iniFile.ReadInteger("Chart", "BorderStyle", 0);

            MaleColor      = ChartRenderer.GetColor(iniFile.ReadInteger("Chart", "MaleColor", MALE_COLOR));
            FemaleColor    = ChartRenderer.GetColor(iniFile.ReadInteger("Chart", "FemaleColor", FEMALE_COLOR));
            UnkSexColor    = ChartRenderer.GetColor(iniFile.ReadInteger("Chart", "UnkSexColor", UNK_SEX_COLOR));
            UnHusbandColor = ChartRenderer.GetColor(iniFile.ReadInteger("Chart", "UnHusbandColor", UN_HUSBAND_COLOR));
            UnWifeColor    = ChartRenderer.GetColor(iniFile.ReadInteger("Chart", "UnWifeColor", UN_WIFE_COLOR));

            DefFontName  = iniFile.ReadString("Chart", "FontName", AppHost.GfxProvider.GetDefaultFontName());
            DefFontSize  = iniFile.ReadInteger("Chart", "FontSize", 8);
            DefFontColor = ChartRenderer.GetColor(iniFile.ReadInteger("Chart", "FontColor", BSDColors.Black));
            DefFontStyle = (BSDTypes.FontStyle)iniFile.ReadInteger("Chart", "FontStyle", 0);

            BranchDistance = iniFile.ReadInteger("Chart", "BranchDistance", TreeChartModel.DEF_BRANCH_DISTANCE);
            LevelDistance  = iniFile.ReadInteger("Chart", "LevelDistance", TreeChartModel.DEF_LEVEL_DISTANCE);
            Margins        = iniFile.ReadInteger("Chart", "Margins", TreeChartModel.DEF_MARGINS);
            SpouseDistance = iniFile.ReadInteger("Chart", "SpouseDistance", TreeChartModel.DEF_SPOUSE_DISTANCE);

            SeparateDepth         = iniFile.ReadBool("Chart", "SeparateDepth", false);
            DepthLimit            = iniFile.ReadInteger("Chart", "DepthLimit", -1);
            DepthLimitAncestors   = iniFile.ReadInteger("Chart", "DepthLimitAncestors", -1);
            DepthLimitDescendants = iniFile.ReadInteger("Chart", "DepthLimitDescendants", -1);
        }
Exemple #2
0
        public static void DrawBorder(ChartRenderer renderer, ExtRect rect, GfxBorderStyle borderStyle)
        {
            int rL = rect.Left;
            int rT = rect.Top;
            int rR = rect.Right;
            int rB = rect.Bottom;

            switch (borderStyle)
            {
            case GfxBorderStyle.Single:
                DrawSingleRect(renderer, rL, rT, rect.GetWidth(), rect.GetHeight(), DefaultPenWidth);
                break;

            case GfxBorderStyle.Double:
                DrawDoubleRect(renderer, rL, rT, rect.GetWidth(), rect.GetHeight(), DefaultStreak, DefaultPenWidth);
                break;

            case GfxBorderStyle.Triple:
                DrawTripleRect(renderer, rL, rT, rect.GetWidth(), rect.GetHeight(), DefaultStreak, DefaultPenWidth);
                break;

            case GfxBorderStyle.Sunken3D:
            case GfxBorderStyle.Raised3D:
                Draw3D(renderer, rL, rT, rR, rB, borderStyle, DefaultPenWidth);
                break;

            case GfxBorderStyle.SingleSquareCuts:
                DrawSingleSquareCuts(renderer, rL, rT, rR, rB, DefaultAngleOffset, DefaultPenWidth);
                break;

            case GfxBorderStyle.DoubleSquareCuts:
                DrawDoubleSquareCuts(renderer, rL, rT, rR, rB, DefaultAngleOffset, DefaultStreak, DefaultPenWidth);
                break;

            case GfxBorderStyle.SingleRoundCuts:
                DrawSingleRoundCuts(renderer, rL, rT, rR, rB, DefaultAngleOffset, DefaultPenWidth);
                break;

            case GfxBorderStyle.DoubleRoundCuts:
                DrawDoubleRoundCuts(renderer, rL, rT, rR, rB, DefaultAngleOffset, DefaultStreak, DefaultPenWidth);
                break;

            case GfxBorderStyle.SingleBevels:
                DrawSingleBevels(renderer, rL, rT, rR, rB, DefaultAngleOffset, DefaultPenWidth);
                break;

            case GfxBorderStyle.DoubleBevels:
                DrawDoubleBevels(renderer, rL, rT, rR, rB, DefaultAngleOffset, DefaultStreak, DefaultPenWidth);
                break;

            case GfxBorderStyle.CrossCorners:
                DrawCrossCorners(renderer, rL, rT, rR, rB, DefaultAngleOffset, DefaultPenWidth);
                break;
            }
        }
Exemple #3
0
        public void Assign(IOptions source)
        {
            TreeChartOptions srcOptions = source as TreeChartOptions;

            if (srcOptions == null)
            {
                return;
            }

            FamilyVisible                = srcOptions.FamilyVisible;
            NameVisible                  = srcOptions.NameVisible;
            PatronymicVisible            = srcOptions.PatronymicVisible;
            NickVisible                  = srcOptions.NickVisible;
            DiffLines                    = srcOptions.DiffLines;
            BirthDateVisible             = srcOptions.BirthDateVisible;
            DeathDateVisible             = srcOptions.DeathDateVisible;
            OnlyYears                    = srcOptions.OnlyYears;
            Kinship                      = srcOptions.Kinship;
            PortraitsVisible             = srcOptions.PortraitsVisible;
            DefaultPortraits             = srcOptions.DefaultPortraits;
            SignsVisible                 = srcOptions.SignsVisible;
            CertaintyIndexVisible        = srcOptions.CertaintyIndexVisible;
            TraceSelected                = srcOptions.TraceSelected;
            ChildlessExclude             = srcOptions.ChildlessExclude;
            Decorative                   = srcOptions.Decorative;
            MaleColor                    = srcOptions.MaleColor;
            FemaleColor                  = srcOptions.FemaleColor;
            UnkSexColor                  = srcOptions.UnkSexColor;
            UnHusbandColor               = srcOptions.UnHusbandColor;
            UnWifeColor                  = srcOptions.UnWifeColor;
            DefFontName                  = srcOptions.DefFontName;
            DefFontSize                  = srcOptions.DefFontSize;
            DefFontColor                 = srcOptions.DefFontColor;
            DefFontStyle                 = srcOptions.DefFontStyle;
            InvertedTree                 = srcOptions.InvertedTree;
            MarriagesDates               = srcOptions.MarriagesDates;
            ShowPlaces                   = srcOptions.ShowPlaces;
            HideUnknownSpouses           = srcOptions.HideUnknownSpouses;
            DottedLinesOfAdoptedChildren = srcOptions.DottedLinesOfAdoptedChildren;
            SeparateDatesAndPlacesLines  = srcOptions.SeparateDatesAndPlacesLines;
            BoldNames                    = srcOptions.BoldNames;
            SeparateDepth                = srcOptions.SeparateDepth;
            BorderStyle                  = srcOptions.BorderStyle;

            BranchDistance = srcOptions.BranchDistance;
            LevelDistance  = srcOptions.LevelDistance;
            Margins        = srcOptions.Margins;
            SpouseDistance = srcOptions.SpouseDistance;
        }
Exemple #4
0
        public TreeChartOptions()
        {
            FamilyVisible     = true;
            NameVisible       = true;
            PatronymicVisible = true;
            NickVisible       = true;
            DiffLines         = true;

            BirthDateVisible = true;
            DeathDateVisible = true;
            OnlyYears        = true;

            Kinship                      = false;
            PortraitsVisible             = true;
            DefaultPortraits             = false;
            SignsVisible                 = false;
            CertaintyIndexVisible        = false;
            TraceSelected                = true;
            ChildlessExclude             = false;
            Decorative                   = true;
            InvertedTree                 = false;
            MarriagesDates               = false;
            ShowPlaces                   = false;
            HideUnknownSpouses           = false;
            DottedLinesOfAdoptedChildren = false;
            SeparateDatesAndPlacesLines  = false;
            BoldNames                    = false;
            SeparateDepth                = false;

            AutoAlign   = true;
            BorderStyle = GfxBorderStyle.None;
            DeepMode    = DeepMode.None;

            MaleColor      = ChartRenderer.GetColor(MALE_COLOR);
            FemaleColor    = ChartRenderer.GetColor(FEMALE_COLOR);
            UnkSexColor    = ChartRenderer.GetColor(UNK_SEX_COLOR);
            UnHusbandColor = ChartRenderer.GetColor(UN_HUSBAND_COLOR);
            UnWifeColor    = ChartRenderer.GetColor(UN_WIFE_COLOR);

            DefFontName  = AppHost.GfxProvider.GetDefaultFontName();
            DefFontSize  = 8;
            DefFontColor = ChartRenderer.GetColor(BSDColors.Black);
            DefFontStyle = BSDTypes.FontStyle.None;

            BranchDistance = TreeChartModel.DEF_BRANCH_DISTANCE;
            LevelDistance  = TreeChartModel.DEF_LEVEL_DISTANCE;
            Margins        = TreeChartModel.DEF_MARGINS;
            SpouseDistance = TreeChartModel.DEF_SPOUSE_DISTANCE;
        }
Exemple #5
0
        private static void Draw3D(ChartRenderer renderer, int rL, int rT, int rR, int rB, GfxBorderStyle borderStyle, float pw)
        {
            int[] colors;
            bool  sunken = (borderStyle == GfxBorderStyle.Sunken3D);

            if (sunken)
            {
                colors = new int[] {
                    BSDColors.ControlDark, BSDColors.ControlDarkDark, BSDColors.ControlLightLight, BSDColors.ControlLight
                };
            }
            else
            {
                colors = new int[] {
                    BSDColors.ControlLightLight, BSDColors.ControlLight, BSDColors.ControlDark, BSDColors.ControlDarkDark
                };
            }

            using (var p = renderer.CreatePen(colors[0], pw)) {
                renderer.DrawLine(p, rL, rB - 1, rL, rT); // L
                renderer.DrawLine(p, rL, rT, rR - 1, rT); // T
            }
            using (var p = renderer.CreatePen(colors[1], pw)) {
                renderer.DrawLine(p, rL + pw, rB - 2, rL + pw, rT + pw); // L
                renderer.DrawLine(p, rL + pw, rT + pw, rR - 2, rT + pw); // T
            }
            using (var p = renderer.CreatePen(colors[2], pw)) {
                renderer.DrawLine(p, rL, rB, rR, rB); // B
                renderer.DrawLine(p, rR, rB, rR, rT); // R
            }
            using (var p = renderer.CreatePen(colors[3], pw)) {
                renderer.DrawLine(p, rL + pw, rB - pw, rR - pw, rB - pw); // B
                renderer.DrawLine(p, rR - pw, rB - pw, rR - pw, rT + pw); // R
            }
        }