Beispiel #1
0
        private BBTextChunk SetChunkFontStyle(int tokenLine, BBTextChunk chunk, BSDTypes.FontStyle style, bool active)
        {
            float fntSize;

            BSDTypes.FontStyle fntStyle;
            if (chunk != null)
            {
                fntSize  = chunk.Size;
                fntStyle = chunk.Style;
            }
            else
            {
                fntSize  = fDefaultFontSize;
                fntStyle = BSDTypes.FontStyle.None;
            }

            if (active)
            {
                fntStyle |= style;
            }
            else
            {
                fntStyle &= ~style;
            }

            if (chunk == null || chunk.Text.Length != 0)
            {
                chunk = new BBTextChunk(tokenLine, fntSize, fntStyle, fTextColor);
                fChunks.Add(chunk);
            }

            chunk.Style = fntStyle;

            return(chunk);
        }
Beispiel #2
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);
        }
Beispiel #3
0
        public BBTextChunk(int tokenLine, float fontSize, BSDTypes.FontStyle fontStyle, IColor color)
        {
            Line  = tokenLine - 1;
            Size  = fontSize;
            Style = fontStyle;
            Color = color;

            Text = string.Empty;
            URL  = string.Empty;
        }
Beispiel #4
0
        private BBTextChunk SetChunkFontSize(int tokenLine, BBTextChunk chunk, float newSize)
        {
            BSDTypes.FontStyle fntStyle = (chunk != null) ? chunk.Style : BSDTypes.FontStyle.None;

            if (chunk == null || chunk.Text.Length != 0)
            {
                chunk = new BBTextChunk(tokenLine, newSize, fntStyle, fTextColor);
                fChunks.Add(chunk);
            }

            chunk.Size = newSize;

            return(chunk);
        }
Beispiel #5
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;
        }
Beispiel #6
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;
        }