Exemple #1
0
        internal void InitNodes()
        {
            NTreeListNode node;
            NTreeListNodeStringSubItem item;

            int nodeCount = 1;

            NFillInfo customFill1 = new NFillInfo();

            customFill1.Gradient1     = NUIManager.Palette.ControlLight;
            customFill1.Gradient2     = NUIManager.Palette.ControlDark;
            customFill1.GradientStyle = Nevron.UI.WinForm.Controls.GradientStyle.Vista;

            NFillInfo customTextFill1 = new NFillInfo();

            customTextFill1.Gradient1     = Color.Orange;
            customTextFill1.Gradient2     = Color.Black;
            customTextFill1.GradientAngle = 0F;

            Font customFont = new Font("Trebuchet MS", 9, FontStyle.Bold);

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

                if (i % 2 == 0)
                {
                    node.NotesFillInfo     = customFill1;
                    node.NotesTextFillInfo = customTextFill1;
                    node.NotesFont         = customFont;
                    node.NotesFormat       = new NGdiPlusTextFormat(StringAlignment.Near, StringAlignment.Center, HotkeyPrefix.Hide, StringTrimming.EllipsisCharacter, StringFormatFlags.NoWrap);
                    node.Notes             = "Customized node's notes. You may specify custom back fill, text fill and font for a note.\nYou may also control the text formatting of the notes using the 'NotesFormat' property - the notes of this node do not wrap.";
                }
                else
                {
                    node.Notes = "Each NTreeListNode may be assigned notes. Notes are treated as a 'non-client' area and do not participate in the node's layout logic.";
                }

                for (int j = 1; j < 6; j++)
                {
                    item        = new NTreeListNodeStringSubItem();
                    item.Text   = "SubItem; Col: " + j + ", Row: " + nodeCount;
                    item.Column = m_List.Columns["Col" + j];

                    node.SubItems.Add(item);
                }

                nodeCount++;
                m_List.Nodes.Add(node);
            }
        }
Exemple #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);
            }
        }