Exemple #1
0
        public virtual void UpdateItem(int itemIndex, IListItem item, object rowData)
        {
            GDMRecord rec = rowData as GDMRecord;

            if (item == null || rec == null)
            {
                return;
            }

            Fetch(rec);

            int num = fColumnsMap.Count;

            for (int i = 1; i < num; i++)
            {
                MapColumnRec colrec = fColumnsMap[i];

                // aColIndex - from 1
                ListColumn cs  = fListColumns[colrec.ColType];
                object     val = GetColumnValueEx(colrec.ColType, colrec.ColSubtype, true);
                string     res = ConvertColumnValue(val, cs);

                item.AddSubItem(res);
            }

            if (GlobalOptions.Instance.ReadabilityHighlightRows && MathHelper.IsOdd(itemIndex))
            {
                item.SetBackColor(ChartRenderer.GetColor(ChartRenderer.LightGray));
            }
        }
Exemple #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);
        }
Exemple #3
0
        public AncestorsCircleOptions()
        {
            for (int i = 0; i < MAX_BRUSHES; i++)
            {
                BrushColor[i] = ChartRenderer.GetColor(DefBrushColor[i]);
            }

            ArcText           = true;
            HideEmptySegments = false;
        }
Exemple #4
0
        public bool LTRCorrection; // text correction from left to right [experimental]

        public CircleChartOptions()
        {
            for (int i = 0; i < MAX_BRUSHES; i++)
            {
                BrushColor[i] = ChartRenderer.GetColor(DefBrushColor[i]);
            }

            ArcText           = true;
            HideEmptySegments = false;
            LTRCorrection     = false;
        }
Exemple #5
0
        public override void UpdateItemProps(IListItem item, object rowData)
        {
            GlobalOptions gOptions = GlobalOptions.Instance;

            if ((fRec.ChildToFamilyLinks.Count == 0) && (gOptions.ListHighlightUnparentedPersons))
            {
                item.SetBackColor(ChartRenderer.GetColor(GKData.HighlightUnparentedColor));
            }
            else if ((fRec.SpouseToFamilyLinks.Count == 0) && (gOptions.ListHighlightUnmarriedPersons))
            {
                item.SetBackColor(ChartRenderer.GetColor(GKData.HighlightUnmarriedColor));
            }
        }
Exemple #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;
        }
Exemple #7
0
        private void DrawDeep(DeepMode mode, int spx, int spy)
        {
            try {
                using (var deepModel = new TreeChartModel()) {
                    deepModel.Assign(fModel);
                    deepModel.SetRenderer(fRenderer);
                    deepModel.DepthLimitAncestors   = 2;
                    deepModel.DepthLimitDescendants = 2;
                    deepModel.GenChart(fSelected.Rec, TreeChartKind.ckBoth, true);
                    deepModel.RecalcChart(true);

                    var pers = deepModel.FindPersonByRec(fSelected.Rec);
                    if (pers == null)
                    {
                        Logger.WriteError("TreeChartBox.DrawDeep(): unexpected failure");
                        return;
                    }

                    int dmX = (spx + (fSelected.PtX - pers.PtX));
                    int dmY = (spy + (fSelected.PtY - pers.PtY));
                    deepModel.SetOffsets(dmX, dmY);
                    deepModel.VisibleArea = ExtRect.CreateBounds(0, 0, deepModel.ImageWidth, deepModel.ImageHeight);

                    switch (mode)
                    {
                    case DeepMode.Background:
                        fRenderer.SetTranslucent(0.75f);
                        break;

                    case DeepMode.Foreground:
                        fRenderer.SetTranslucent(0.25f);
                        IPen   xpen   = fRenderer.CreatePen(ChartRenderer.GetColor(BSDColors.Black), 2.0f);
                        IColor bColor = ChartRenderer.GetColor(BSDColors.White);
                        fRenderer.DrawRoundedRectangle(xpen, bColor, dmX, dmY, deepModel.ImageWidth, deepModel.ImageHeight, 6);
                        fRenderer.SetTranslucent(0.00f);
                        break;
                    }

                    deepModel.Draw(ChartDrawMode.dmStatic);
                }
            } catch (Exception ex) {
                Logger.WriteError("TreeChartBox.DrawDeep()", ex);
            }
        }