Exemplo n.º 1
0
        public override void DoLayout(LayoutVariables vars)
        {
            _lineCIO.GetControl().Size     = new System.Drawing.Size(1, _bounds.Height);
            _lineCIO.GetControl().Location = new System.Drawing.Point(_lineLoc, 0);

            int[] minimum   = new int[_panels.Count];
            int[] preferred = new int[_panels.Count];

            for (int i = 0; i < _panels.Count; i++)
            {
                minimum[i]   = ((InterfaceNode)_panels[i]).MinimumSize.Width;
                preferred[i] = ((InterfaceNode)_panels[i]).PreferredSize.Width;
            }

            int[] widths = LayoutAlgorithms.AllocateSizeValues(_bounds.Width, minimum, preferred, vars.RowPadding);

            int width = 0;

            for (int i = 0; i < _panels.Count; i++)
            {
                InterfaceNode node = (InterfaceNode)_panels[i];

                node.SetLocation(_bounds.X + width, _bounds.Y);
                node.SetSize(widths[i], _bounds.Height);
                width += widths[i];

                if ((i == (_panels.Count - 1)) &&
                    (width < _bounds.Width))
                {
                    node.SetSize(widths[i] + (_bounds.Width - width), _bounds.Height);
                }

                node.DoLayout(vars);
            }
        }
        public override void DoLayout(LayoutVariables vars)
        {
            int[] minimum   = new int[_panels.Count];
            int[] preferred = new int[_panels.Count];

            for (int i = 0; i < _panels.Count; i++)
            {
                minimum[i]   = ((InterfaceNode)_panels[i]).MinimumSize.Height;
                preferred[i] = ((InterfaceNode)_panels[i]).PreferredSize.Height;
            }

            int[] heights = LayoutAlgorithms.AllocateSizeValues(_bounds.Height, minimum, preferred, vars.RowPadding);

            int height = 0;

            for (int i = 0; i < _panels.Count; i++)
            {
                InterfaceNode node = (InterfaceNode)_panels[i];

                node.SetLocation(_bounds.X, _bounds.Y + height);
                node.SetSize(_bounds.Width, heights[i]);
                height += heights[i];

                if ((i == (_panels.Count - 1)) &&
                    (height < _bounds.Height))
                {
                    node.SetSize(_bounds.Width, heights[i] + (_bounds.Height - height));
                }

                node.DoLayout(vars);
            }
        }
Exemplo n.º 3
0
        public void GenerateUI(Appliance a)
        {
            _interfaceRoot = new PanelNode(a.GetRoot());

            this.Controls.Add(_core.Panel.GetControl());

            _core.GenerateUI(a);
        }
Exemplo n.º 4
0
        /*
         * Constructor
         */

        public HorizontallyNonOverlappingPanelsNode(PanelNode vertPanel,
                                                    InterfaceNode horizPanel)
            : base()
        {
            vertPanel.InsertAsParent(this);
            AddPanel(horizPanel);

            vertPanel.SetVertical(true);
        }
Exemplo n.º 5
0
        public override void DoLayout(LayoutVariables vars)
        {
            InterfaceNode node = (InterfaceNode)_panels[0];

            // set bounds to the control bounds, which are automattically set by
            // the TabControl
            Control c = _panel.GetControl();

            node.SetSize(c.Bounds.Width, c.Bounds.Height);
            node.SetLocation(0, 0);

            ((InterfaceNode)_panels[0]).DoLayout(vars);
        }
Exemplo n.º 6
0
        public override void DoLayout(LayoutVariables vars)
        {
            IEnumerator e = _panels.GetEnumerator();

            while (e.MoveNext())
            {
                InterfaceNode node = (InterfaceNode)e.Current;

                node.SetSize(_bounds.Width, _bounds.Height);
                node.SetLocation(_bounds.X, _bounds.Y);

                node.DoLayout(vars);
            }
        }
Exemplo n.º 7
0
		/*
		 * Organizer Method
		 */

		public override Hashtable AddOrganization(GroupNode group, InterfaceNode currentNode)
		{
			TabbedOverlappingPanelsNode tab = new TabbedOverlappingPanelsNode( _state );
			MultiplePanelNode non = null;

			if ( _vertical )
				non = new HorizontallyNonOverlappingPanelsNode( (PanelNode)currentNode, tab );
			else
			{
				non = new VerticallyNonOverlappingPanelsNode();
				currentNode.InsertAsParent( non );
				non.AddPanel( tab );
			}

			Hashtable deps = new Hashtable( _dependencies.Count );
			Hashtable panels = new Hashtable( _dependencies.Count );

			IEnumerator e = _dependencies.Keys.GetEnumerator();
			PanelNode newP = null;
			while( e.MoveNext() )
			{
				GroupNode g = (GroupNode)e.Current;
				ArrayList aryDeps = (ArrayList)_dependencies[ g ];

				EqualsDependency eqDep = (EqualsDependency)aryDeps[ 0 ];

				try
				{
					newP = (PanelNode)tab.GetNodeByValue( (int)eqDep.Value ).GetChildNode();
					newP.Group = g;
				}
				catch( Exception ) { Globals.GetFrame( eqDep.State.Appliance ).AddLogLine( "Error in TabbedControlPanelOrganizer... Line 82" ); }

				deps[ aryDeps ] = newP;
				panels[ g ] = newP;
			}

			tab.InitGroupToTabMap();

			_activePanel = newP;

			_dependencies = deps;
			_uiValid = true;

			this.ValueChanged( _state );

			return panels;
		}
Exemplo n.º 8
0
        public override void DoLayout(LayoutVariables vars)
        {
            IEnumerator e = _panels.GetEnumerator();

            Size      minSize        = GetTabbedCIO().GetMinimumSize();
            Rectangle tabPanelBounds = new Rectangle(0, 0, _bounds.Width - minSize.Width, _bounds.Height - minSize.Height);

            while (e.MoveNext())
            {
                InterfaceNode node = (InterfaceNode)e.Current;

                node.SetSize(tabPanelBounds.Width, tabPanelBounds.Height);
                node.SetLocation(tabPanelBounds.X, tabPanelBounds.Y);

                node.DoLayout(vars);
            }
        }
Exemplo n.º 9
0
        /*
         * Organizer Method
         */

        public override Hashtable AddOrganization(GroupNode group, InterfaceNode currentNode)
        {
            VerticallyNonOverlappingPanelsNode non = new VerticallyNonOverlappingPanelsNode();
            OverlappingPanelsNode over             = new OverlappingPanelsNode();

            currentNode.InsertAsParent(non);
            non.AddPanel(over);

            Hashtable deps   = new Hashtable(_dependencies.Count);
            Hashtable panels = new Hashtable(_dependencies.Count);

            IEnumerator e    = _dependencies.Keys.GetEnumerator();
            PanelNode   newP = null;

            while (e.MoveNext())
            {
                GroupNode g       = (GroupNode)e.Current;
                ArrayList aryDeps = (ArrayList)_dependencies[g];

                newP = new PanelNode(g);

                over.AddPanel(newP);

                deps[aryDeps] = newP;
                panels[g]     = newP;
            }

            _activePanel = newP;

            _dependencies = deps;
            _uiValid      = true;

            this.ValueChanged(_state);

            return(panels);
        }
Exemplo n.º 10
0
        /*
         * Organizer Method
         */

        public abstract Hashtable AddOrganization(GroupNode group, InterfaceNode currentNode);
Exemplo n.º 11
0
        /*
         * IOrganizer Methods
         */

        public Hashtable AddOrganization(GroupNode group, InterfaceNode currentNode)
        {
            return(null);
        }
Exemplo n.º 12
0
        public void RemovePanel(InterfaceNode node)
        {
            _panels.Remove(node);

            node.SetParent(null);
        }
Exemplo n.º 13
0
        /*
         * Member Methods
         */

        public void AddPanel(InterfaceNode node)
        {
            _panels.Add(node);

            node.SetParent(this);
        }