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

namespace AHD.SM
{
    public partial class sc_EditorOptions : ASMSettingsControl
    {
        public sc_EditorOptions()
        {
            InitializeComponent();

            button1.BackColor = Program.Settings.SubtitleTextEditorBackColor;
            checkBox1.Checked = Program.Settings.SubtitleTextEditorShowStatusStrip;
            numericUpDown_megnaticAccuracy.Value = Program.Settings.MegnaticAccuracy;
            numericUpDown_smartToolAccuracy.Value = Program.Settings.SmartToolAccuracy;
        }
        public override string ToString()
        {
            return Program.ResourceManager.GetString("Title_Editors");
        }
        public override void SaveSettings()
        {
            Program.Settings.SubtitleTextEditorShowStatusStrip = checkBox1.Checked;
            Program.Settings.SubtitleTextEditorBackColor = button1.BackColor;
            Program.Settings.MegnaticAccuracy = (int)numericUpDown_megnaticAccuracy.Value;
            Program.Settings.SmartToolAccuracy = (int)numericUpDown_smartToolAccuracy.Value;
            base.SaveSettings();
        }
        public override void DefaultSettings()
        {
            checkBox1.Checked = true;
            button1.BackColor = Color.Black;
            numericUpDown_megnaticAccuracy.Value = 5;
            numericUpDown_smartToolAccuracy.Value = 7;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ColorDialog dial = new ColorDialog();
            dial.Color = button1.BackColor;
            if (dial.ShowDialog(this) == DialogResult.OK)
            {
                button1.BackColor = dial.Color;
            }
        }
    }
}
