Ejemplo n.º 1
0
        public PickColorButton(Color i_Color, Point i_Location, BoardButton i_BoardButton, ColorsForm i_ColorsForm)
        {
            m_ColorsForm  = i_ColorsForm;
            m_BoardButton = i_BoardButton;

            ClientSize = new Size(k_Size, k_Size);
            BackColor  = i_Color;
            Location   = i_Location;
            Click     += m_Color_Button_Click;
        }
Ejemplo n.º 2
0
        public ColorsForm(BoardButton i_BoardButton)
        {
            ClientSize      = new Size(k_Width, (int)k_Width / 2 + 5);
            Text            = "Pick A Color:";
            MinimizeBox     = false;
            MaximizeBox     = false;
            FormBorderStyle = FormBorderStyle.FixedSingle;

            Controls.Add(new PickColorButton(Color.Purple, new Point(k_Padding, k_Padding), i_BoardButton, this));
            Controls.Add(new PickColorButton(Color.Red, new Point(2 * k_Padding + PickColorButton.k_Size, k_Padding), i_BoardButton, this));
            Controls.Add(new PickColorButton(Color.LightGreen, new Point(3 * k_Padding + 2 * PickColorButton.k_Size, k_Padding), i_BoardButton, this));
            Controls.Add(new PickColorButton(Color.Aqua, new Point(4 * k_Padding + 3 * PickColorButton.k_Size, k_Padding), i_BoardButton, this));
            Controls.Add(new PickColorButton(Color.Blue, new Point(k_Padding, 2 * k_Padding + PickColorButton.k_Size), i_BoardButton, this));
            Controls.Add(new PickColorButton(Color.Yellow, new Point(2 * k_Padding + PickColorButton.k_Size, 2 * k_Padding + PickColorButton.k_Size), i_BoardButton, this));
            Controls.Add(new PickColorButton(Color.Brown, new Point(3 * k_Padding + 2 * PickColorButton.k_Size, 2 * k_Padding + PickColorButton.k_Size), i_BoardButton, this));
            Controls.Add(new PickColorButton(Color.White, new Point(4 * k_Padding + 3 * PickColorButton.k_Size, 2 * k_Padding + PickColorButton.k_Size), i_BoardButton, this));
        }
Ejemplo n.º 3
0
        public Guess(Point i_Location, Board i_Board)
        {
            m_Buttons  = new List <BoardButton>();
            m_Location = i_Location;
            m_Board    = i_Board;

            BoardButton first  = new BoardButton(new Point(i_Location.X + k_Padding, i_Location.Y + k_Padding), i_Board);
            BoardButton second = new BoardButton(new Point(i_Location.X + 2 * k_Padding + BoardButton.k_Size, i_Location.Y + k_Padding), i_Board);
            BoardButton third  = new BoardButton(new Point(i_Location.X + 3 * k_Padding + 2 * BoardButton.k_Size, i_Location.Y + k_Padding), i_Board);
            BoardButton fourth = new BoardButton(new Point(i_Location.X + 4 * k_Padding + 3 * BoardButton.k_Size, i_Location.Y + k_Padding), i_Board);

            i_Board.Controls.Add(first);
            i_Board.Controls.Add(second);
            i_Board.Controls.Add(third);
            i_Board.Controls.Add(fourth);

            m_Buttons.Add(first);
            m_Buttons.Add(second);
            m_Buttons.Add(third);
            m_Buttons.Add(fourth);
        }