Шрифт:
//его в процессе тестирования
System.Drawing.Bitmap gameBoard;
gameBoard = new System.Drawing.Bitmap(pictureBoxGameBoard.Width, pictureBoxGameBoard.Height);
System.Drawing.Graphics gameboard_gfx;
gameboard_gfx = System.Drawing.Graphics.FromImage(gameBoard);
gameboard_gfx.Clear(System.Drawing.Color.Yellow);
System.Drawing.Pen myPen = new System.Drawing.Pen(System.Drawing.Color.Blue);
gameboard_gfx.DrawRectangle(myPen, 2, 2, gameBoard.Width-4, gameBoard.Height-6);
myPen.Dispose;
gameboard_gfx.Dispose;
pictureBoxGameBoard.Image = gameBoard;
//Разместить текстовое окно, в котором содержатся задаваемые вопросы,
//a также подробные ответы для пользователей
textBoxAskQuestion.Left = 0;
textBoxAskQuestion.Width = 240;
buttonAskQuestion.Width = 64;
buttonAskQuestion.Height = 20;
#if PLAYFIELD_ON_BOTTOM //ПОЛЕ ИГРЫ располагается под пользовательскими
//элементами управления
const int answerbuttons_beginY = 42;
const int showanswers_beginY = 77;
//--------------------------------------------------------
//Задать кнопки выбора вариантов Easy или Hard режима игры
//--------------------------------------------------------
buttonShowAnswers_AdvancedVersion.Top = showanswers_beginY;
buttonShowAnswers_SimpleVersion.Top = showanswers_beginY;
//------------------------------
//Задать набор вариантов ответов
//------------------------------
//Задать элемент управления, по которому будут выравниваться
//все остальные элементы управления
buttonAnswer0.Top = answerbuttons_beginY;
//Поместить PictureBox под элементами управления
pictureBoxGameBoard.Top = (answerButtons_dy + dy_betweenButtons) * 3 + answerbuttons beginY;
buttonAskQuestion.Top = 0;
buttonAskQuestion.Left = 174;
textBoxAskQuestion.Top = 0;
#else //ПОЛЕ ИГРЫ располагается над пользовательскими
//элементами управления
const int answerbuttons_beginY = 174;
//--------------------------------------------------------
//Задать кнопки выбора вариантов Easy или Hard режима игры
//--------------------------------------------------------
buttonShowAnswers_AdvancedVersion.Top = answerbuttons_beginY;
buttonShowAnswers_SimpleVersion.Top = answerbuttons_beginY;
//-----------------------------
//Задать набор вариантов ответа
//-----------------------------
//Задать элемент управления, по которому будут выравниваться
//все остальные элементы управления
buttonAnswer0.Top = answerbuttons_beginY;
pictureBoxGameBoard.Top = 0;
buttonAskQuestion.Top = answerbuttons_beginY;
buttonAskQuestion.Left = 174;
#endif
buttonShowAnswers_AdvancedVersion.Left = answerbuttons_beginX;
buttonShowAnswers_SimpleVersion.Left = buttonShowAnswers_AdvancedVersion.Left + answerButtons_dx + dx betweenButtons;
pictureBoxGameBoard.Left = 0;
pictureBoxGameBoard.Width = 240;
pictureBoxGameBoard.Height = 172;
buttonAnswer0.Left = answerbuttons_beginX;