public OneGridPanel(LocIdx locIdx, AllBoxesManager ptrToAllBoxesManager, int maxColRowIdx)
 {
     this.LocIdx          = locIdx;
     PtrToAllBoxesManager = ptrToAllBoxesManager;
     this.maxColRowIdx    = maxColRowIdx;
     BuildOneGridPanelControls();
 }
Exemplo n.º 2
0
        private void buildAllBoxes()
        {
            MasterPanel = new Panel
            {
                Dock        = DockStyle.Fill,
                BorderStyle = BorderStyle.FixedSingle
                              //  BackColor = Color.LightBlue
            };

            for (int colIdx = 0; colIdx < MaxColAndRowIdx; colIdx++)
            {
                for (int rowIdx = 0; rowIdx < MaxColAndRowIdx; rowIdx++)
                {
                    LocIdx       locIdx       = new LocIdx(colIdx, rowIdx);
                    OneGridPanel oneGridPanel = new OneGridPanel(locIdx, this, MaxColAndRowIdx);

                    AllBoxList.Add(oneGridPanel);

                    int coordX = colIdx * Params.SpacingHorizontal;
                    int coordY = rowIdx * Params.SpacingVertical;

                    Point point = new Point(coordX, coordY);

                    oneGridPanel.ControlAssociatedGridPanel.BringToFront();
                    oneGridPanel.ControlAssociatedGridPanel.Location = point;
                    MasterPanel.Controls.Add(oneGridPanel.ControlAssociatedGridPanel);


                    MasterPanel.Controls.Add(new Label()
                    {
                        Text     = coordX + "," + coordY + "{" + MaxColAndRowIdx + "}",
                        Location = point,
                        Width    = 20,
                        Height   = 20,

                        // BackColor = Color.Pink
                    });
                }
            }
        }