Habanero.Faces.Base.GridLayoutManager.SetGridSize C# (CSharp) Méthode

SetGridSize() public méthode

Sets the grid size as a number of rows and columns
public SetGridSize ( int rows, int cols ) : void
rows int The number of rows
cols int The number of columns
Résultat void
        public void SetGridSize(int rows, int cols)
        {
            _columnWidths = new int[cols];
            _fixedColumnsBasedOnContents = new bool[cols];
            for (int i = 0; i < _columnWidths.Length; i++)
            {
                _columnWidths[i] = -1;
                _fixedColumnsBasedOnContents[i] = false;
            }
            _rowHeights = new int[rows];
            _fixedRowsBasedOnContents = new bool[rows];
            for (int i = 0; i < _rowHeights.Length; i++)
            {
                _rowHeights[i] = -1;
                _fixedRowsBasedOnContents[i] = false;
            }
            _positionsOccupied = new bool[rows,cols];
        }

Usage Example

        ///<summary>
        /// Constructor for the <see cref="HelpAboutBoxManager"/>
        ///</summary>
        ///<param name="controlFactory"></param>
        ///<param name="formHabanero"></param>
        ///<param name="programName"></param>
        ///<param name="producedForName"></param>
        ///<param name="producedByName"></param>
        ///<param name="versionNumber"></param>
        public HelpAboutBoxManager(IControlFactory controlFactory, IFormHabanero formHabanero, string programName, string producedForName, string producedByName, string versionNumber)
        {
            _FormHabanero = formHabanero;
            _mainPanel = controlFactory.CreatePanel();
            GridLayoutManager mainPanelManager = new GridLayoutManager(_mainPanel, controlFactory);
            mainPanelManager.SetGridSize(4, 2);
            mainPanelManager.FixAllRowsBasedOnContents();
            mainPanelManager.FixColumnBasedOnContents(0);
            mainPanelManager.FixColumnBasedOnContents(1);
            mainPanelManager.AddControl(controlFactory.CreateLabel("Programme Name:", false));
            mainPanelManager.AddControl(controlFactory.CreateLabel(programName, false));
            mainPanelManager.AddControl(controlFactory.CreateLabel("Produced For:", false));
            mainPanelManager.AddControl(controlFactory.CreateLabel(producedForName, false));
            mainPanelManager.AddControl(controlFactory.CreateLabel("Produced By:", false));
            mainPanelManager.AddControl(controlFactory.CreateLabel(producedByName, false));
            mainPanelManager.AddControl(controlFactory.CreateLabel("Version:", false));
            mainPanelManager.AddControl(controlFactory.CreateLabel(versionNumber, false));

            IButtonGroupControl buttons = controlFactory.CreateButtonGroupControl();
            buttons.AddButton("OK", new EventHandler(OKButtonClickHandler));

            BorderLayoutManager manager = controlFactory.CreateBorderLayoutManager(formHabanero);
            manager.AddControl(_mainPanel, BorderLayoutManager.Position.Centre);
            manager.AddControl(buttons, BorderLayoutManager.Position.South);
            formHabanero.Width = 300;
            formHabanero.Height = 200;
            formHabanero.Text = "About";
        }
All Usage Examples Of Habanero.Faces.Base.GridLayoutManager::SetGridSize