using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PDFReader_Demo_CSharp
{
    public partial class ResponseForm : Form
    {
        public ResponseForm()
        {
            InitializeComponent();
        }

        public void SetTitle(String title)
        {
            title_ = title;
        }

        public void SetQuestion(String question)
        {
            question_ = question;
        }

        public void SetDefaultValue(String defaultValue)
        {
            defaultValue_ = defaultValue;
        }

        public void SetLabel(String label)
        {
            label_ = label;
        }

        public void SetIsPassword(bool isPassword)
        {
            isPassword_ = isPassword;
        }


        public string GetResponse()
        {
            return this.textBoxResponse.Text;
        }

        private void buttonOK_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void buttonCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void form_Load(object sender, EventArgs e)
        {
            this.labelQuestion.Text = this.question_;
            if (!this.title_.Equals(""))
            {
                this.Text = this.title_;
            }
            
            this.textBoxResponse.Text = this.defaultValue_;
            if (this.isPassword_)
            {
                this.textBoxResponse.PasswordChar = '*';
            }
        }

        private String title_;
        private String defaultValue_;
        private String label_;
        private String question_;
        private bool isPassword_;
    }
}
