using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using DarkWynter.Engine.Globals; using DarkWynter.App.Surveys; namespace DarkWynter.App.Surveys { public partial class SurveyForm : Form { public string fileName = ""; public GroupBox radioButtonGB; private Button startSurvey; private Button PreviousButton; private Button NextButton; private Button FinishedButton; private RichTextBox QuestionBox; private Label questionsLabel; public static int questionNumber; public SurveyForm() { // Set up components InitializeComponent(); // Hide all components radioButtonGB.Hide(); PreviousButton.Hide(); NextButton.Hide(); FinishedButton.Hide(); questionsLabel.Hide(); QuestionBox.Hide(); } private void startSurvey_Click(object sender, EventArgs e) { // Hide Intro Panel startSurvey.Hide(); // Init first problem questionNumber = 0; LoadQuestion(); QuestionBox.Show(); questionsLabel.Show(); // Survey display radioButtonGB.Show(); // Iterators PreviousButton.Show(); NextButton.Show(); // Save and exit survey FinishedButton.Show(); } private void LoadQuestion() { int labelNumber = questionNumber + 1; // Label for the answer box radioButtonGB.Text = "Question " + labelNumber + " Answers"; // Label for the question box questionsLabel.Text = "Question " + labelNumber; // Question Text QuestionBox.Text = Survey.questionList[questionNumber].problem; Survey.questionList[questionNumber].Load(this); } private void NextButton_Click(object sender, EventArgs e) { // looping back to begining when finished if (++questionNumber == Survey.questionList.Count) { questionNumber = 0; } LoadQuestion(); } private void PreviousButton_Click(object sender, EventArgs e) { // Go back a question, looping back to end when finished if (--questionNumber == -1) { questionNumber = Survey.questionList.Count - 1; } LoadQuestion(); } private void FinishedButton_Click(object sender, EventArgs e) { // Save file App.GameForm.surveyList[0].Save(); // Exit this.Hide(); } private void InitializeComponent() { this.radioButtonGB = new System.Windows.Forms.GroupBox(); this.startSurvey = new System.Windows.Forms.Button(); this.PreviousButton = new System.Windows.Forms.Button(); this.NextButton = new System.Windows.Forms.Button(); this.FinishedButton = new System.Windows.Forms.Button(); this.QuestionBox = new System.Windows.Forms.RichTextBox(); this.questionsLabel = new System.Windows.Forms.Label(); this.SuspendLayout(); // // radioButtonGB // this.radioButtonGB.BackColor = System.Drawing.SystemColors.ControlLightLight; this.radioButtonGB.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.radioButtonGB.Location = new System.Drawing.Point(10, 313); this.radioButtonGB.Name = "radioButtonGB"; this.radioButtonGB.Size = new System.Drawing.Size(562, 173); this.radioButtonGB.TabIndex = 0; this.radioButtonGB.TabStop = false; this.radioButtonGB.Text = "AnswerBox"; // // startSurvey // this.startSurvey.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); this.startSurvey.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.startSurvey.Location = new System.Drawing.Point(33, 491); this.startSurvey.Name = "startSurvey"; this.startSurvey.Size = new System.Drawing.Size(119, 24); this.startSurvey.TabIndex = 1; this.startSurvey.Text = "Start Survey"; this.startSurvey.UseVisualStyleBackColor = false; this.startSurvey.Click += new System.EventHandler(this.startSurvey_Click); // // PreviousButton // this.PreviousButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); this.PreviousButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.PreviousButton.Location = new System.Drawing.Point(158, 491); this.PreviousButton.Name = "PreviousButton"; this.PreviousButton.Size = new System.Drawing.Size(119, 24); this.PreviousButton.TabIndex = 2; this.PreviousButton.Text = "Previous"; this.PreviousButton.UseVisualStyleBackColor = false; this.PreviousButton.Click += new System.EventHandler(this.PreviousButton_Click); // // NextButton // this.NextButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); this.NextButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.NextButton.Location = new System.Drawing.Point(283, 491); this.NextButton.Name = "NextButton"; this.NextButton.Size = new System.Drawing.Size(119, 24); this.NextButton.TabIndex = 3; this.NextButton.Text = "Next"; this.NextButton.UseVisualStyleBackColor = false; this.NextButton.Click += new System.EventHandler(this.NextButton_Click); // // FinishedButton // this.FinishedButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); this.FinishedButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FinishedButton.Location = new System.Drawing.Point(408, 491); this.FinishedButton.Name = "FinishedButton"; this.FinishedButton.Size = new System.Drawing.Size(119, 24); this.FinishedButton.TabIndex = 4; this.FinishedButton.Text = "Finished"; this.FinishedButton.UseVisualStyleBackColor = false; this.FinishedButton.Click += new System.EventHandler(this.FinishedButton_Click); // // QuestionBox // this.QuestionBox.BackColor = System.Drawing.SystemColors.ControlLightLight; this.QuestionBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.QuestionBox.Location = new System.Drawing.Point(7, 31); this.QuestionBox.Name = "QuestionBox"; this.QuestionBox.ReadOnly = true; this.QuestionBox.Size = new System.Drawing.Size(559, 276); this.QuestionBox.TabIndex = 5; this.QuestionBox.Text = ""; // // questionsLabel // this.questionsLabel.AutoSize = true; this.questionsLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.questionsLabel.Location = new System.Drawing.Point(12, 9); this.questionsLabel.Name = "questionsLabel"; this.questionsLabel.Size = new System.Drawing.Size(68, 18); this.questionsLabel.TabIndex = 6; this.questionsLabel.Text = "Question"; // // SurveyForm // this.ClientSize = new System.Drawing.Size(578, 527); this.Controls.Add(this.questionsLabel); this.Controls.Add(this.QuestionBox); this.Controls.Add(this.FinishedButton); this.Controls.Add(this.NextButton); this.Controls.Add(this.PreviousButton); this.Controls.Add(this.startSurvey); this.Controls.Add(this.radioButtonGB); this.Name = "SurveyForm"; this.ResumeLayout(false); this.PerformLayout(); } //private void InitializeComponent() //{ // this.SuspendLayout(); // // // // SurveyForm // // // this.ClientSize = new System.Drawing.Size(654, 558); // this.Name = "SurveyForm"; // this.ResumeLayout(false); //} } }