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

namespace FYEDrawDemo_CSharp
{
    public partial class CanvasPropForm : Form
    {
        public int m_iVirBackColor;
        public int m_iCanWidth;
        public int m_iCanHeight;
        public int m_iVirWidth;
        public int m_iVirHeight;
        public int m_iDisplayGrid;

        public CanvasPropForm()
        {
            InitializeComponent();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            m_iVirBackColor = Int32.Parse(txtBackColor.Text);
            m_iCanWidth = Int32.Parse(txtCanWidth.Text);
            m_iCanHeight = Int32.Parse(txtCanHeight.Text);
            m_iVirWidth = Int32.Parse(txtVirWidth.Text);
            m_iVirHeight = Int32.Parse(txtVirHeight.Text);
            m_iDisplayGrid = chkDisplayGrid.Checked ? 1 : 0;

            this.DialogResult = DialogResult.OK;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }

        private void CanvasPropForm_Load(object sender, EventArgs e)
        {
            txtBackColor.Text = string.Format("{0}", m_iVirBackColor);
            txtCanWidth.Text = string.Format("{0}", m_iCanWidth);
            txtCanHeight.Text = string.Format("{0}", m_iCanHeight);
            txtVirWidth.Text = string.Format("{0}", m_iVirWidth);
            txtVirHeight.Text = string.Format("{0}", m_iVirHeight);
            chkDisplayGrid.Checked = m_iDisplayGrid != 0;
        }
    }
}
