コード例 #1
0
        private PictureBox addLevelToPanel(Level level)
        {
            PictureBox levelCell;

            levelCell        = new PictureBox();
            levelCell.Click += new EventHandler(levelCell_Click);
            levelCell.Tag    = level;

            if (version.CPU == CPUVersion.ZX)
            {
                updateTiles(level);
            }

            viewer.ImageList = imageList;

            if (level.Equals(selectedLevel))
            {
                levelCell.BorderStyle = BorderStyle.Fixed3D;
            }
            else
            {
                levelCell.BorderStyle = BorderStyle.None;
            }
            int cellWidth = this.ClientRectangle.Width - layoutPanel.Padding.Left - layoutPanel.Padding.Right - 4 - SystemInformation.VerticalScrollBarWidth;

            levelCell.Size     = new Size(cellWidth, cellWidth);
            levelCell.SizeMode = PictureBoxSizeMode.StretchImage;
            viewer.Level       = level;
            levelCell.Image    = viewer.GetPreview();
            levelCell.Visible  = true;
            layoutPanel.Controls.Add(levelCell);

            return(levelCell);
        }
コード例 #2
0
        private void removeLevelFromPanel(Level selectedLevel)
        {
            PictureBox pBoxToRemove = null;

            foreach (PictureBox pBox in layoutPanel.Controls)
            {
                if (selectedLevel.Equals(pBox.Tag))
                {
                    pBoxToRemove = pBox;
                    break;
                }
            }
            if (pBoxToRemove != null)
            {
                layoutPanel.Controls.Remove(pBoxToRemove);
            }
        }
コード例 #3
0
ファイル: LevelSelector.cs プロジェクト: AugustoRuiz/UWOL
 private void removeLevelFromPanel(Level selectedLevel)
 {
     PictureBox pBoxToRemove = null;
     foreach (PictureBox pBox in layoutPanel.Controls)
     {
         if (selectedLevel.Equals(pBox.Tag))
         {
             pBoxToRemove = pBox;
             break;
         }
     }
     if (pBoxToRemove != null)
     {
         layoutPanel.Controls.Remove(pBoxToRemove);
     }
 }
コード例 #4
0
ファイル: LevelSelector.cs プロジェクト: AugustoRuiz/UWOL
        private PictureBox addLevelToPanel(Level level)
        {
            PictureBox levelCell;

            levelCell = new PictureBox();
            levelCell.Click += new EventHandler(levelCell_Click);
            levelCell.Tag = level;

            if (version.CPU == CPUVersion.ZX)
            {
                updateTiles(level);
            }

            viewer.ImageList = imageList;

            if (level.Equals(selectedLevel))
            {
                levelCell.BorderStyle = BorderStyle.Fixed3D;
            }
            else
            {
                levelCell.BorderStyle = BorderStyle.None;
            }
            int cellWidth = this.ClientRectangle.Width - layoutPanel.Padding.Left - layoutPanel.Padding.Right - 4 - SystemInformation.VerticalScrollBarWidth;
            levelCell.Size = new Size(cellWidth, cellWidth);
            levelCell.SizeMode = PictureBoxSizeMode.StretchImage;
            viewer.Level = level;
            levelCell.Image = viewer.GetPreview();
            levelCell.Visible = true;
            layoutPanel.Controls.Add(levelCell);

            return levelCell;
        }