Example #1
0
        public Main()
        {
            InitializeComponent();

            //Source panel.
            Point pt = new Point(tbcMain.Location.X + 15, tbcMain.Location.Y + 32);

            pnlTileSource.Parent   = this;
            pnlTileSource.Location = pt;
            pnlTileSource.BringToFront();
            pnlTileSource.Hide();

            //Selected tiles panel.
            pt = new Point(tbcMain.Width - 25 - pnlSelectedTiles.Width, tbcMain.Location.Y + 32);
            pnlSelectedTiles.Parent   = this;
            pnlSelectedTiles.Location = pt;
            pnlSelectedTiles.BringToFront();
            pnlSelectedTiles.Hide();
            pnlSelectedTiles.Anchor = AnchorStyles.Top | AnchorStyles.Right;

            TileHandler.Initialize();

            //Add the columns.
            lstvTileSource.Columns.Add("Path", -2, HorizontalAlignment.Left);
            lstvTileAttributes.Columns.Add("Attribute", -2, HorizontalAlignment.Left);
            ReloadSourcePanel();

            var img = TileHandler.GetTileImage(TileTab.Source).Image;

            pctbMain.Image  = img;
            pctbMain.Width  = img.Width;
            pctbMain.Height = img.Height;

            pctbTileTest.Image     = TileHandler.GetTileImage(TileTab.Randomized).Image;
            pctbSelectedTile.Image = TileHandler.GetTileImage(TileTab.RuleTest).Image;

            _PictureBoxes    = new PictureBox[3];
            _PictureBoxes[0] = pctbMain;
            _PictureBoxes[1] = pctbTileTest;
            _PictureBoxes[2] = pctbSelectedTile;
        }