Exemplo n.º 1
0
        void Init(object key)
        {
            ZedGraphDemo demo = (ZedGraphDemo)this.demos[key];

            if (demo == null)
            {
                return;
            }

            m_ZedGraphPanel.DeleteAllChildren(false);

            demo.Initialize(m_ZedGraphPanel);

            demo.ZedGraphControl.Parent = null;
            demo.ZedGraphControl.Parent = m_ZedGraphPanel;

            demo.ZedGraphControl.Size = m_ZedGraphPanel.InnerBounds.Size;
            demo.ZedGraphControl.Dock = Pos.Fill;

            m_Caption.Text = TitlePrefix + demo.Title;

            m_InfoBox.Text     = demo.Description;
            m_InfoBox.IsHidden = string.IsNullOrEmpty(m_InfoBox.Text);

            // tell the control to rescale itself
            demo.ZedGraphControl.AxisChange();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Loads a demo into the frame
        /// </summary>
        /// <param name="key">The key the demo is stored in demos under</param>
        private void Init(object key)
        {
            ZedGraphDemo demo = (ZedGraphDemo)this.demos[key];

            if (demo == null)
            {
                return;
            }

            this.tabDemo.Controls.Clear();
            this.tabDemo.Controls.Add(demo.ZedGraphControl);

            demo.ZedGraphControl.Width  = tabDemo.Width;
            demo.ZedGraphControl.Height = tabDemo.Height;

            demo.ZedGraphControl.Anchor = AnchorStyles.Left | AnchorStyles.Top
                                          | AnchorStyles.Right | AnchorStyles.Bottom;

            this.Text = TitlePrefix + demo.Title;

            descriptionBox.Text = demo.Description;

            // tell the control to rescale itself
            demo.ZedGraphControl.AxisChange();

            // redraw the entire form
            this.Invalidate();
        }
Exemplo n.º 3
0
 void LoadDemo(ZedGraphDemo demo)
 {
     foreach (DemoType type in demo.Types)
     {
         Alt.GUI.Temporary.Gwen.Control.TreeNode typeNode = (Alt.GUI.Temporary.Gwen.Control.TreeNode)typeToNodeTable[type];
         if (typeNode == null)
         {
             // error, this shouldn't be reached
             // TODO: do something about this
         }
         else
         {
             Alt.GUI.Temporary.Gwen.Control.TreeNode node = typeNode.AddNode(demo.Title);
             node.NormalTextColor   = NormalColor;
             node.SelectedTextColor = SelectedColor;
             node.HoverTextColor    = HoverColor;
         }
     }
     // store the demo based on it's title
     demos[demo.Title] = demo;
 }
Exemplo n.º 4
0
        /// <summary>
        /// Loads a demo into the correct place in the tree.
        /// </summary>
        /// <param name="demo">The demo to load.</param>
        protected void loadDemo(ZedGraphDemo demo)
        {
            foreach (DemoType type in demo.Types)
            {
                TreeNode demosNode;

                TreeNode typeNode = (TreeNode)typeToNodeTable[type];
                if (typeNode == null)
                {
                    // error, this shouldn't be reached
                    // TODO: do something about this
                }
                else
                {
                    demosNode = new TreeNode(demo.Title);

                    typeNode.Nodes.Add(demosNode);
                }
            }
            // store the demo based on it's title
            demos[demo.Title] = demo;
        }
Exemplo n.º 5
0
        /// <summary>
        /// Loads a demo into the correct place in the tree.
        /// </summary>
        /// <param name="demo">The demo to load.</param>
        protected void loadDemo( ZedGraphDemo demo )
        {
            foreach ( DemoType type in demo.Types )
            {
                TreeNode demosNode;

                TreeNode typeNode = (TreeNode)typeToNodeTable[type];
                if ( typeNode == null )
                {
                    // error, this shouldn't be reached
                    // TODO: do something about this
                }
                else
                {
                    demosNode = new TreeNode( demo.Title );

                    typeNode.Nodes.Add( demosNode );
                }
            }
            // store the demo based on it's title
            demos[demo.Title] = demo;
        }