Exemple #1
0
        private void initializeComponent()
        {
            Point prevLocation = new Point(this.Location.X + k_Space, this.Location.Y + k_Space);

            this.Text          = "Bulls And Cows!";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Font          = new Font("David", 12, FontStyle.Bold);
            this.MaximizeBox   = false;
            this.MinimizeBox   = false;

            m_SecretSequence          = new GridSquares(1, LogicManagement <Color> .k_LengthOfTheCombination, m_GuessButtonSize, k_Space, Color.Black, false);
            m_SecretSequence.Location = new Point(prevLocation.X, prevLocation.Y);
            m_SecretSequence.Size     = new Size(LogicManagement <Color> .k_LengthOfTheCombination * (m_GuessButtonSize.Width + k_Space), m_GuessButtonSize.Height);
            this.Controls.Add(m_SecretSequence);

            prevLocation.Y += m_SecretSequence.Height + (k_Space * 2);

            for (int i = 0; i < m_ArrayOfLevels.Length; i++)
            {
                m_ArrayOfLevels[i]          = new BoardLine(m_GuessButtonSize, m_DefaultColor, k_Space, closeLevel);
                m_ArrayOfLevels[i].Location = new Point(prevLocation.X, prevLocation.Y);
                prevLocation.Y += m_ArrayOfLevels[i].Height + k_Space;
                this.Controls.Add(m_ArrayOfLevels[i]);
            }

            this.Size = new Size(m_ArrayOfLevels[0].Width + (3 * k_Space), prevLocation.Y + (4 * k_Space));
        }
Exemple #2
0
        private void initializeComponent()
        {
            Point startLocation = new Point(this.Location.X, this.Location.Y);

            m_GuessesButtons          = new GridSquares(1, LogicManagement <Color> .k_LengthOfTheCombination, m_BaseSize, r_Space, m_DefaultColor, false);
            m_GuessesButtons.Location = startLocation;
            m_GuessesButtons.Size     = new Size(LogicManagement <Color> .k_LengthOfTheCombination * (m_BaseSize.Width + r_Space), m_BaseSize.Height);
            this.Controls.Add(m_GuessesButtons);

            startLocation.X += m_GuessesButtons.Width + (r_Space / 7);

            m_Submit          = new Button();
            m_Submit.Text     = "==>>";
            m_Submit.Size     = new Size(m_BaseSize.Width, m_BaseSize.Height / 2);
            m_Submit.Location = new Point(startLocation.X, startLocation.Y + (m_BaseSize.Height / 3));
            m_Submit.Enabled  = false;
            this.Controls.Add(m_Submit);

            startLocation.X += m_Submit.Width + (r_Space * 2);

            m_Result          = new GridSquares(2, LogicManagement <Color> .k_LengthOfTheCombination / 2, new Size(m_BaseSize.Width / 3, m_BaseSize.Height / 4), r_Space, m_DefaultColor, false);
            m_Result.Location = new Point(startLocation.X, startLocation.Y + r_Space);
            m_Result.Size     = new Size((LogicManagement <Color> .k_LengthOfTheCombination / 2) * ((m_BaseSize.Width / 3) + r_Space), m_BaseSize.Height);
            this.Controls.Add(m_Result);
            this.Size = new Size(startLocation.X + m_Result.Size.Width, m_BaseSize.Height);
        }
        private void initializeComponent()
        {
            int i = 0;

            m_UserSelctionColorKit          = new GridSquares(2, k_TotalColors / 2, m_ButtonSize, m_Space, default(Color), true);
            m_UserSelctionColorKit.Location = new Point(this.Location.X + m_Space, this.Location.Y + m_Space);
            this.Size = new Size(m_UserSelctionColorKit.Size.Width + (m_Space * 3), m_UserSelctionColorKit.Size.Height + (m_Space * 3));
            this.Controls.Add(m_UserSelctionColorKit);

            foreach (Button button in m_UserSelctionColorKit.MatrixOfButtons)
            {
                button.Click    += new EventHandler(CloseDialog);
                button.BackColor = s_ColorKit[i];
                i++;
            }
        }