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 LinePropForm : Form
    {
        public int m_iSeqNum;  
        public int m_iLineColor;
        public int m_iLineWidth;
        public int m_iLineStyle;       //0普通实线 1-- 2.. 5无
        public int m_iEndMode;         //0无 11起点○ 12终端○ 13两端○  21起点● 22终端● 23两端● 31起点← 32终端← 33两端←

        public LinePropForm()
        {
            InitializeComponent();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            m_iSeqNum = Int32.Parse(txtSeqNum.Text);
            m_iLineColor = Int32.Parse(txtLineColor.Text);
            m_iLineWidth = Int32.Parse(txtLineWidth.Text);
            m_iLineStyle = Int32.Parse(txtLineStyle.Text);
            m_iEndMode = Int32.Parse(txtEndMode.Text);

            if (m_iLineStyle != 0 && m_iLineStyle != 1 && m_iLineStyle != 2 && m_iLineStyle != 5)
                m_iLineStyle = 0;
            if (m_iEndMode != 0
                && m_iEndMode != 11 && m_iEndMode != 12 && m_iEndMode != 13
                && m_iEndMode != 21 && m_iEndMode != 22 && m_iEndMode != 23
                && m_iEndMode != 31 && m_iEndMode != 32 && m_iEndMode != 33)
                m_iEndMode = 0;

            this.DialogResult = DialogResult.OK;
        }

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

        private void LinePropForm_Load(object sender, EventArgs e)
        {
            txtSeqNum.Text = string.Format("{0}", m_iSeqNum);
            txtLineColor.Text = string.Format("{0}", m_iLineColor);
            txtLineWidth.Text = string.Format("{0}", m_iLineWidth);
            txtLineStyle.Text = string.Format("{0}", m_iLineStyle);
            txtEndMode.Text = string.Format("{0}", m_iEndMode);
        }
    }
}
