示例#1
0
 /// <summary>
 /// Override to build elements that render the data by adding drawable elements to the chart 
 /// </summary>
 public abstract void BuildElements(Chart chart, PlotPane pane, Series series);
示例#2
0
文件: SeriesView.cs 项目: rioka/nfx
 /// <summary>
 /// Override to build elements that render the data by adding drawable elements to the chart
 /// </summary>
 public abstract void BuildElements(Chart chart, PlotPane pane, Series series);
示例#3
0
文件: Chart.cs 项目: vlapchenko/nfx
       private void buildPanes()
       {
         if (m_Series==null)
         {
           foreach(var ctl in m_Panes) ctl.Dispose();
           m_Panes.Clear();
           //todo ubit shkalu X vnizy
           return;
         }

         var paneNames = m_Series.GetPaneNames().ToArray();

         //1. Delete panes that are no longer in series
         var toDelete = m_Panes.Select(p => p.Name).Except(paneNames);
         foreach(var pn in toDelete) 
         {
           var ctl = m_Panes[pn];
           if (ctl!=null)
           {
             m_Panes.Unregister(ctl);
             ctl.Dispose();
           }
         }

         //2. Add panes
         foreach(var pn in paneNames)
         {
           var ctl = m_Panes[pn];
           if (ctl!=null)
           {
             ctl.DeleteAllElements();//Clear the pane
             continue;//pane already exists
           }
           //Add pane
           ctl = new PlotPane(this, pn, m_Panes.Count+1);
           ctl.TabStop = false;
           ctl.Height = 100;//todo CONFIG
           ctl.Parent = this;
           ctl.Dock = DockStyle.Top;
           //ctl.BackColor = Color.HotPink;
           m_Panes.Register(ctl);
         }


         //3. Build splitters
         var ilast = m_Panes.Count()-1;
         for(var i=0; i<=ilast; i++)
         {
           var pane = m_Panes[i];
           
     //      if (i==ilast)
     //      {
     //       if (pane.m_Splitter!=null)
     //       {
     //         pane.m_Splitter.Dispose();
     //         pane.m_Splitter = null;
     //       }
     //    //   this.Controls.SetChildIndex( pane, 1000); 
     ////       pane.Dock = DockStyle.Left;
     //      }
     //      else
           {
             pane.Dock = DockStyle.Top;
             if (pane.m_Splitter==null)
             { 
               pane.m_Splitter = new Splitter();
               pane.m_Splitter.Parent = this;
               this.Controls.SetChildIndex( pane.m_Splitter, this.Controls.GetChildIndex(pane)); 
               pane.m_Splitter.Dock = DockStyle.Top;
               pane.m_Splitter.Height = 6;
               pane.m_Splitter.BackColor = Color.Silver;
               pane.m_Splitter.BorderStyle = BorderStyle.FixedSingle;
               //todo Splitter moving - suspend update?
               pane.m_Splitter.SplitterMoved += delegate(object sender, SplitterEventArgs e)
               {
                 this.NotifySeriesChange();
               };
             }
           }
         }
       }
示例#4
0
        private void buildPanes()
        {
            if (m_Series == null)
            {
                foreach (var ctl in m_Panes)
                {
                    ctl.Dispose();
                }
                m_Panes.Clear();
                //todo ubit shkalu X vnizy
                return;
            }

            var paneNames = m_Series.GetPaneNames().ToArray();

            //1. Delete panes that are no longer in series
            var toDelete = m_Panes.Select(p => p.Name).Except(paneNames);

            foreach (var pn in toDelete)
            {
                var ctl = m_Panes[pn];
                if (ctl != null)
                {
                    m_Panes.Unregister(ctl);
                    ctl.Dispose();
                }
            }

            //2. Add panes
            foreach (var pn in paneNames)
            {
                var ctl = m_Panes[pn];
                if (ctl != null)
                {
                    ctl.DeleteAllElements(); //Clear the pane
                    continue;                //pane already exists
                }
                //Add pane
                ctl         = new PlotPane(this, pn, m_Panes.Count + 1);
                ctl.TabStop = false;
                ctl.Height  = 100;//todo CONFIG
                ctl.Parent  = this;
                ctl.Dock    = DockStyle.Top;
                //ctl.BackColor = Color.HotPink;
                m_Panes.Register(ctl);
            }


            //3. Build splitters
            var ilast = m_Panes.Count() - 1;

            for (var i = 0; i <= ilast; i++)
            {
                var pane = m_Panes[i];

                //      if (i==ilast)
                //      {
                //       if (pane.m_Splitter!=null)
                //       {
                //         pane.m_Splitter.Dispose();
                //         pane.m_Splitter = null;
                //       }
                //    //   this.Controls.SetChildIndex( pane, 1000);
                ////       pane.Dock = DockStyle.Left;
                //      }
                //      else
                {
                    pane.Dock = DockStyle.Top;
                    if (pane.m_Splitter == null)
                    {
                        pane.m_Splitter        = new Splitter();
                        pane.m_Splitter.Parent = this;
                        this.Controls.SetChildIndex(pane.m_Splitter, this.Controls.GetChildIndex(pane));
                        pane.m_Splitter.Dock        = DockStyle.Top;
                        pane.m_Splitter.Height      = 6;
                        pane.m_Splitter.BackColor   = Color.Silver;
                        pane.m_Splitter.BorderStyle = BorderStyle.FixedSingle;
                        //todo Splitter moving - suspend update?
                        pane.m_Splitter.SplitterMoved += delegate(object sender, SplitterEventArgs e)
                        {
                            this.NotifySeriesChange();
                        };
                    }
                }
            }
        }