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

namespace CSGBuilder {
    public partial class TranslateForm : Form {
        public TranslateForm() {
            InitializeComponent();
        }

        private void Translate_FormClosing(object sender, FormClosingEventArgs e) {
            if (this.DialogResult == DialogResult.OK) {
                if (tbDX.Text == "" || tbDY.Text == "" || tbDZ.Text == "") {
                    MessageBox.Show("Empty fields!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    e.Cancel = true; return;
                }
                double x;
                if (!Double.TryParse(tbDX.Text, out x) || !Double.TryParse(tbDY.Text, out x) || !Double.TryParse(tbDZ.Text, out x)) {
                    MessageBox.Show("Incorrect number format!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    e.Cancel = true; return;
                }
            }
        }
    }
}