Beispiel #1
0
        internal static void InitDefaultNodes(NTreeList list, int nodeCount)
        {
            NTreeListNode node;

            long ticks = DateTime.Now.Ticks;

            for (int i = 1; i < nodeCount; i++)
            {
                node = new NTreeListNode();

                //text sub-item
                NTreeListNodeStringSubItem stringItem = new NTreeListNodeStringSubItem();
                stringItem.Text   = "String SubItem " + i;
                stringItem.Column = list.Columns[0];
                node.SubItems.Add(stringItem);

                //image sub-item
                NTreeListNodeImageSubItem imageItem = new NTreeListNodeImageSubItem();
                imageItem.Image  = NSystemImages.Information;
                imageItem.Column = list.Columns[1];
                node.SubItems.Add(imageItem);

                //numeric sub-item
                NTreeListNodeNumericSubItem numItem = new NTreeListNodeNumericSubItem();
                numItem.Value        = i * 10;
                numItem.FormatString = "$#,###0.00";
                numItem.Column       = list.Columns[2];
                node.SubItems.Add(numItem);

                //date sub-item
                NTreeListNodeDateTimeSubItem dateItem = new NTreeListNodeDateTimeSubItem();
                dateItem.Value        = new DateTime(ticks + i * 10000000);
                dateItem.FormatString = "F";
                dateItem.Column       = list.Columns[3];
                node.SubItems.Add(dateItem);

                //bool sub-item
                NTreeListNodeBooleanSubItem boolItem = new NTreeListNodeBooleanSubItem();
                boolItem.Value  = (i % 2) == 0;
                boolItem.Column = list.Columns[4];
                node.SubItems.Add(boolItem);

                list.Nodes.Add(node);
            }
        }
Beispiel #2
0
        internal void InitRows()
        {
            NTreeListNode node;
            DateTime      date1 = new DateTime(2007, 11, 12);
            DateTime      date2 = new DateTime(2007, 11, 13);

            Font      testFont  = new Font("Segoe UI", 9, FontStyle.Italic | FontStyle.Bold);
            Font      testFont1 = new Font("Calibri", 8, FontStyle.Italic | FontStyle.Underline);
            NFillInfo testFill  = new NFillInfo();

            testFill.Gradient1     = Color.OrangeRed;
            testFill.Gradient2     = Color.Yellow;
            testFill.GradientStyle = GradientStyle.SigmaBell;

            NFillInfo testTextFill = new NFillInfo();

            testTextFill.FillStyle = FillStyle.Solid;
            testTextFill.Color     = Color.Navy;

            for (int i = 1; i < 201; i++)
            {
                node = new NTreeListNode();

                //init items
                //importance sub-item
                NTreeListNodeImageSubItem importanceItem = new NTreeListNodeImageSubItem();
                importanceItem.Image       = (i % 2 == 0) ? m_Images.Images[6] : m_Images.Images[1];
                importanceItem.Column      = m_List.Columns["Importance"];
                importanceItem.CompareData = i % 2;
                importanceItem.GroupByData = i % 2;
                if (i % 2 == 0)
                {
                    importanceItem.GroupByTitle = "Importance: High";
                }
                else
                {
                    importanceItem.GroupByTitle = "Importance: Normal";
                }
                node.SubItems.Add(importanceItem);

                //icon sub-item
                NTreeListNodeImageSubItem iconItem = new NTreeListNodeImageSubItem();
                iconItem.Image       = m_Images.Images[3 + (i % 2)];
                iconItem.Column      = m_List.Columns["Icon"];
                iconItem.CompareData = i % 2;
                iconItem.GroupByData = i % 2;
                if (i % 2 == 0)
                {
                    iconItem.GroupByTitle = "Message class: New Message";
                }
                else
                {
                    iconItem.GroupByTitle = "Message class: Message";
                }
                node.SubItems.Add(iconItem);

                //from sub-item
                NTreeListNodeStringSubItem fromItem = new NTreeListNodeStringSubItem();
                fromItem.Text   = m_arrNames[i % 4];
                fromItem.Column = m_List.Columns["From"];
                fromItem.Font   = testFont;
                //fromItem.FillInfo = testFill;
                fromItem.TextFillInfo = testTextFill;
                node.SubItems.Add(fromItem);

                //subject sub-item
                NTreeListNodeStringSubItem subjectItem = new NTreeListNodeStringSubItem();
                subjectItem.Text   = m_arrSubjects[i % 4];
                subjectItem.Column = m_List.Columns["Subject"];
                node.SubItems.Add(subjectItem);

                //received sub-item
                NTreeListNodeDateTimeSubItem receivedItem = new NTreeListNodeDateTimeSubItem();
                if (i % 2 == 0)
                {
                    receivedItem.Value        = date1;
                    receivedItem.GroupByTitle = "Date: Yesterday";
                }
                else
                {
                    receivedItem.Value        = date2;
                    receivedItem.GroupByTitle = "Date: Today";
                }
                receivedItem.FormatString = "F";
                receivedItem.Column       = m_List.Columns["Received"];
                receivedItem.Font         = testFont1;
                node.SubItems.Add(receivedItem);

                //follow-up sub-item
                NTreeListNodeBooleanSubItem followItem = new NTreeListNodeBooleanSubItem();
                if (i % 2 == 0)
                {
                    followItem.Value        = false;
                    followItem.GroupByTitle = "Follow-up: No";
                }
                else
                {
                    followItem.Value        = true;
                    followItem.GroupByTitle = "Follow-up: Yes";
                }
                followItem.Column = m_List.Columns["FollowUp"];
                node.SubItems.Add(followItem);

                //numeric sub-item
                NTreeListNodeNumericSubItem numItem = new NTreeListNodeNumericSubItem();
                numItem.Value        = i * 10;
                numItem.FormatString = "$#,###0.00";
                numItem.Column       = m_List.Columns["PurchaseAmount"];
                node.SubItems.Add(numItem);

                m_List.Nodes.Add(node);
            }
        }
        internal void InitNodes()
        {
            NTreeListNode node;
            Font          boldFont = new Font("Trebuchet MS", 10F, FontStyle.Bold);
            Font          dateFont = new Font("Verdana", 8F, FontStyle.Underline);
            NFillInfo     textFill = new NFillInfo();

            textFill.Gradient1     = Color.WhiteSmoke;
            textFill.Gradient2     = Color.YellowGreen;
            textFill.GradientAngle = 0F;

            NFillInfo numFill = new NFillInfo();

            numFill.Gradient1     = Color.Yellow;
            numFill.Gradient2     = Color.OrangeRed;
            numFill.GradientAngle = 45F;

            NFillInfo boolFill = new NFillInfo();

            boolFill.Gradient2     = Color.Yellow;
            boolFill.Gradient1     = Color.Green;
            boolFill.GradientStyle = Nevron.UI.WinForm.Controls.GradientStyle.Vista;
            boolFill.GradientAngle = 135F;

            long ticks = DateTime.Now.Ticks;

            for (int i = 1; i < 31; i++)
            {
                node = new NTreeListNode();

                //text sub-item
                NTreeListNodeStringSubItem stringItem = new NTreeListNodeStringSubItem();
                stringItem.Text     = "String SubItem " + i;
                stringItem.Font     = boldFont;
                stringItem.FillInfo = textFill;
                stringItem.Column   = m_List.Columns[0];
                node.SubItems.Add(stringItem);

                //image sub-item
                NTreeListNodeImageSubItem imageItem = new NTreeListNodeImageSubItem();
                imageItem.Image     = NSystemImages.Information;
                imageItem.Column    = m_List.Columns[1];
                imageItem.ImageSize = new NSize(32, 32);
                node.SubItems.Add(imageItem);

                //numeric sub-item
                NTreeListNodeNumericSubItem numItem = new NTreeListNodeNumericSubItem();
                numItem.Value        = i * 10;
                numItem.FormatString = "$#,###0.00";
                numItem.Column       = m_List.Columns[2];
                numItem.FillInfo     = numFill;
                node.SubItems.Add(numItem);

                //date sub-item
                NTreeListNodeDateTimeSubItem dateItem = new NTreeListNodeDateTimeSubItem();
                dateItem.Value         = new DateTime(ticks + i * 10000000);
                dateItem.FormatString  = "F";
                dateItem.Font          = dateFont;
                dateItem.RenderingHint = TextRenderingHint.ClearTypeGridFit;
                dateItem.Column        = m_List.Columns[3];
                node.SubItems.Add(dateItem);

                //bool sub-item
                NTreeListNodeBooleanSubItem boolItem = new NTreeListNodeBooleanSubItem();
                boolItem.Value    = (i % 2) == 0;
                boolItem.Column   = m_List.Columns[4];
                boolItem.FillInfo = boolFill;
                node.SubItems.Add(boolItem);

                m_List.Nodes.Add(node);
            }
        }