Beispiel #1
0
        public TestHeader()
        {
            new Thread(new ThreadStart(CalculRandom)).Start();
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // TODO: Add any initialization after the InitializeComponent call
            gtv.BeginUpdate();
            try
            {
                for (int i = 0; i < 10; i++)
                {
                    INode aParent = gtv.Add(null, i.ToString(), new NodeData(i));
                    for (int j = 0; j < 10; j++)
                    {
                        int value = j < 5 ? i : i + 1;
                        gtv.Add(aParent, value.ToString(), new NodeData(value));
                    }
                }
            }
            finally
            {
                gtv.EndUpdate();
            }
            gtv.FullRowSelect = false;
            Genius.Controls.TreeView.Colors.Themes.GeniusTreeViewTheme(gtv.Colors);
            int[]           aDisplays   = new int[] { 0, 1 };
            SortDirection[] aDirections = new SortDirection[] { SortDirection.Ascending, SortDirection.Descending };
            gtv.SortTree(aDisplays, aDirections);
        }
 private void TestDrawingOptions_Load(object sender, System.EventArgs e)
 {
     /*
      * gtv.Colors.SelectedColor = new GeniusLinearGradientBrush(Color.FromArgb(204,218,241));
      * gtv.Colors.FocusedRectangleColor = new Pen(Color.FromArgb(49,106,197));
      * gtv.Colors.SelectedTextColor = new GeniusLinearGradientBrush(Color.Black);
      * gtv.Colors.UnFocusedRectangleColor = new Pen(Color.FromArgb(152,181,226));
      * gtv.Colors.SelectedUnfocusedColor = new GeniusLinearGradientBrush(Color.FromArgb(229,236,248));
      */
     Genius.Controls.TreeView.Colors.Themes.GeniusTreeViewTheme(gtv.Colors);
     gtv.BeginUpdate();
     try
     {
         for (int i = 0; i < 10; i++)
         {
             INode n = gtv.Add(null, i.ToString(), null);
             for (int j = 0; j < 10; j++)
             {
                 INode n1 = gtv.Add(n, j.ToString(), null);
                 for (int k = 0; k < 10; k++)
                 {
                     gtv.Add(n1, k.ToString(), null);
                 }
             }
         }
     }
     finally
     {
         gtv.EndUpdate();
     }
 }
Beispiel #3
0
 private void TestVisibility_Load(object sender, System.EventArgs e)
 {
     for (int i = 0; i < 10; i++)
     {
         INode parent = gtv.Add(null,
                                String.Format("Node {0}", i), i);
         for (int j = 0; j < 10; j++)
         {
             INode child = gtv.Add(parent,
                                   String.Format("Node {0}.{1}", i, j), i * j);
         }
     }
     gtv.Header.MoveColonneTo(2, 0);
 }
Beispiel #4
0
 private void button1_Click(object sender, System.EventArgs e)
 {
     geniusTreeView1.Clear();
     geniusTreeView1.BeginUpdate();
     try
     {
         INode n = geniusTreeView1.Add(null, new DataNode("c:\\"));
         n.Text   = "c:\\";
         n.State |= NodeState.HasChildren;
     }
     finally
     {
         geniusTreeView1.EndUpdate();
     }
 }
Beispiel #5
0
 private void TestEvents_Load(object sender, System.EventArgs e)
 {
     geniusTreeView1.BeginUpdate();
     try
     {
         for (int i = 0; i < 20; i++)
         {
             INode aParent = geniusTreeView1.Add(null, "Node " + i.ToString(), null);
             for (int j = 0; j < 2; j++)
             {
                 geniusTreeView1.Add(aParent, "Child " + j.ToString(), null);
             }
         }
     }
     finally
     {
         geniusTreeView1.EndUpdate();
     }
 }
Beispiel #6
0
 private void button1_Click(object sender, System.EventArgs e)
 {
     geniusTreeView1.Colors.SelectedColor           = new GeniusLinearGradientBrush(Color.FromArgb(204, 218, 241));
     geniusTreeView1.Colors.FocusedRectangleColor   = new Pen(Color.FromArgb(49, 106, 197));
     geniusTreeView1.Colors.SelectedTextColor       = new GeniusLinearGradientBrush(Color.Black);
     geniusTreeView1.Colors.UnFocusedRectangleColor = new Pen(Color.FromArgb(152, 181, 226));
     geniusTreeView1.Colors.SelectedUnfocusedColor  = new GeniusLinearGradientBrush(Color.FromArgb(229, 236, 248));
     geniusTreeView1.Clear();
     geniusTreeView1.BeginUpdate();
     try
     {
         INode n = geniusTreeView1.Add(null, new DataNode("c:\\"));
         n.Text   = "c:\\";
         n.State |= NodeState.HasChildren;
     }
     finally
     {
         geniusTreeView1.EndUpdate();
     }
 }
 private void CustomDrawDemoCtl_Load(object sender, System.EventArgs e)
 {
     geniusTreeView1.BeginUpdate();
     try
     {
         Random r = new Random();
         for (int i = 0; i < 10; i++)
         {
             INode parent = geniusTreeView1.Add(null, "Groupe " + i.ToString(), new Group());
             parent.Height *= 2;
             geniusTreeView1.ExpandCollapseNode(parent);
             double totalValue = 0;
             for (int j = 0; j < 10; j++)
             {
                 object o     = null;
                 double value = r.NextDouble() * (r.NextDouble() * 100);
                 value       = Math.Round(value, 4);
                 totalValue += value;
                 if (j < 9)
                 {
                     o = new GroupItem();
                     ((GroupItem)o).value = value;
                 }
                 else
                 {
                     o = new GroupTotal();
                     ((GroupTotal)o).value = totalValue;
                 }
                 INode n = geniusTreeView1.Add(parent, "Node " + j.ToString(), o);
             }
         }
         geniusTreeView1.DefaultDrawingOption |= DrawingOption.HideTreeLines;
         //geniusTreeView1.DefaultDrawingOption &= (~DrawingOption.ShowHorzLines);
         geniusTreeView1.FullRowSelect = true;
     }
     finally
     {
         geniusTreeView1.EndUpdate();
     }
 }
Beispiel #8
0
 private void TestChapter_Load(object sender, System.EventArgs e)
 {
     //geniusTreeView1.Header.MainColumnIndex = 0;
     geniusTreeView1.BeginUpdate();
     try
     {
         geniusTreeView1.DefaultDrawingOption = DrawingOptions.HideButtons | DrawingOptions.HideTreeLines | DrawingOptions.HideSelection;
         geniusTreeView1.OnGetFontNode       += new Genius.Controls.TreeView.OnNodeFontDelegate(geniusTreeView1_OnGetFontNode);
         INode n = geniusTreeView1.Add(null, "1. GeniustreeView", null);
         n.Height = 40;
         INode child = geniusTreeView1.Add(n, "ceci est un texte", null);
         child.Height = 200;
         n            = geniusTreeView1.Add(null, "2. Exemple sous forme de chapitre", null);
         n.Height     = 40;
         child        = geniusTreeView1.Add(n, "ceci est un deuxiéme texte", null);
         child.Height = 200;
         geniusTreeView1.ExpandAll();
     }
     finally
     {
         geniusTreeView1.EndUpdate();
     }
 }
Beispiel #9
0
        private void DemoGrille_Load(object sender, System.EventArgs e)
        {
            gtv.DefaultDrawingOption = DrawingOptions.ShowVertLines | DrawingOptions.HideButtons | DrawingOptions.HideTreeLines;
            Color c      = SystemColors.Control;
            int   offset = -5;

            gtc7.BackColor  = new GeniusLinearGradientBrush(Color.FromArgb(c.R + offset, c.G + offset, c.B + offset));
            gtc9.BackColor  = gtc7.BackColor;
            gtc11.BackColor = gtc7.BackColor;

            gtv.BeginUpdate();
            try
            {
                gtv.Add(null, "VFR800", null);
                gtv.Add(null, "SV650", null);
                gtv.Add(null, "CBR900", null);
                gtv.Add(null, "Moto est la plus belle", null);
            }
            finally
            {
                gtv.EndUpdate();
            }
            lblInfo.Text = "utilisation de OnBeforeCellPainting, OnAfterCellPainting, OnCellMouseMove, OnCellMouseDown, OnCellMouseUp, OnCellMouseLeave, OnCellMouseEnter, \r\nFooterHeight = 18, OnFooterGetText";
        }
Beispiel #10
0
 private void bAdd_Click(object sender, System.EventArgs e)
 {
     geniusTreeView1.BeginUpdate();
     try
     {
         int  nb    = int.Parse(textBoxAdd.Text);
         long start = DateTime.Now.Ticks;
         for (int i = 0; i < nb; i++)
         {
             INode n = geniusTreeView1.Add(null, null);
         }
         long end = DateTime.Now.Ticks;
         lblAddResult.Text = ((double)((end - start) / 1000.0f)).ToString() + " ms";
         Debug.WriteLine(String.Format("temps : {0}", end - start));
     }
     finally
     {
         geniusTreeView1.EndUpdate();
     }
 }
Beispiel #11
0
        private void bAdd_Click(object sender, System.EventArgs e)
        {
            geniusTreeView1.BeginUpdate();
            try
            {
                Counter ctx = new Counter();
                int     nb  = int.Parse(textBoxAdd.Text);
                ctx.Start();
                for (int i = 0; i < nb; i++)
                {
                    INode n = geniusTreeView1.Add(null, "Node " + i.ToString(), null);
                }
                ctx.Stop();

                lblAddResult.Text = ctx.Elapse().ToString() + " ms";
                Debug.WriteLine(String.Format("temps : {0}", ctx.Elapse()));
            }
            finally
            {
                geniusTreeView1.EndUpdate();
            }
        }
Beispiel #12
0
 private void TestIncrementalSearch_Load(object sender, System.EventArgs e)
 {
     gtv.BeginUpdate();
     try
     {
         string location = Assembly.GetExecutingAssembly().Location;
         location = Path.GetDirectoryName(location);
         location = Path.Combine(location, "list-raw.txt");
         if (File.Exists(location))
         {
             string file = location;
             using (StreamReader sr = File.OpenText(file))
             {
                 while (!sr.EndOfStream)
                 {
                     string line = sr.ReadLine();
                     gtv.Add(null, line, null);
                 }
             }
         }
         else
         {
             for (int i = 0; i < 26; i++)
             {
                 char  c = (char)(i + 97);
                 INode n = gtv.Add(null, new string(c, 1), null);
                 Add(n, c);
             }
         }
         label1.Text = "nodes count :" + gtv.Count.ToString();
         gtv.ExpandAll();
     }
     finally
     {
         gtv.EndUpdate();
     }
 }
Beispiel #13
0
 private void TestIncrementalSearch_Load(object sender, System.EventArgs e)
 {
     gtv.BeginUpdate();
     try
     {
         for (int i = 0; i < 26; i++)
         {
             char  c = (char)(i + 97);
             INode n = gtv.Add(null, new string(c, 1), null);
             Add(n, c);
         }
         gtv.ExpandAll();
     }
     finally
     {
         gtv.EndUpdate();
     }
 }