Example #1
0
        public List <Panel> ParsePanel(form_previewForm previewForm, int xDimension, int yDimension)
        {
            Panel panel;

            tp = new TileParser();
            const int EDGE = 12;
            const int LOCATION = 2;
            int       xLocation = LOCATION, yLocation = LOCATION;

            for (int x = 0; x < xDimension; x++)
            {
                if (x > 0)
                {
                    xLocation += EDGE;
                }
                yLocation = LOCATION;
                for (int y = 0; y < yDimension; y++)
                {
                    if (y > 0)
                    {
                        yLocation += EDGE;
                    }
                    panel             = new Panel();
                    panel.Size        = new Size(EDGE, EDGE);
                    panel.Location    = new Point(xLocation, yLocation);
                    panel.BackColor   = Color.Gray;
                    panel.Name        = "panel_" + x.ToString() + "_" + y.ToString();
                    panel.BorderStyle = BorderStyle.FixedSingle;
                    previewForm.Controls.Add(panel);
                    pList.Add(panel);
                }
            }
            return(pList);
        }
Example #2
0
 private void btn_preview_Click(object sender, EventArgs e)
 {
     pF = new form_previewForm(map);
     MessageBox.Show("Map preview may take some time");
     pF.ShowDialog();
 }