示例#1
0
        private BBTextChunk SetChunkFontStyle(int tokenLine, BBTextChunk chunk, ExtFontStyle style, bool active)
        {
            float        fntSize;
            ExtFontStyle fntStyle;

            if (chunk != null)
            {
                fntSize  = chunk.Size;
                fntStyle = chunk.Style;
            }
            else
            {
                fntSize  = fDefaultFontSize;
                fntStyle = ExtFontStyle.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);
        }
示例#2
0
        public BBTextChunk(int tokenLine, float fontSize, ExtFontStyle fontStyle, IColor color)
        {
            Line = tokenLine - 1;
            Text = string.Empty;
            URL  = string.Empty;

            Color = color;
            Size  = fontSize;
            Style = fontStyle;
        }
示例#3
0
        private BBTextChunk SetChunkFontSize(int tokenLine, BBTextChunk chunk, float newSize)
        {
            ExtFontStyle fntStyle = (chunk != null) ? chunk.Style : ExtFontStyle.None;

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

            chunk.Size = newSize;

            return(chunk);
        }
示例#4
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);

            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", ChartRenderer.Black));
            DefFontStyle = (ExtFontStyle)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);
        }
示例#5
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;

            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(ChartRenderer.Black);
            DefFontStyle = ExtFontStyle.None;

            BranchDistance = TreeChartModel.DEF_BRANCH_DISTANCE;
            LevelDistance  = TreeChartModel.DEF_LEVEL_DISTANCE;
            Margins        = TreeChartModel.DEF_MARGINS;
            SpouseDistance = TreeChartModel.DEF_SPOUSE_DISTANCE;
        }
示例#6
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;

            BranchDistance = srcOptions.BranchDistance;
            LevelDistance  = srcOptions.LevelDistance;
            Margins        = srcOptions.Margins;
            SpouseDistance = srcOptions.SpouseDistance;
        }