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 To_com_vcs {
	public partial class FormOption1Dlg : Form {
		public FormOption1Dlg() {
			InitializeComponent();
		}
		
		public long option1 = 0;
		private Dictionary<CheckBox, long> optionVallueMap = new Dictionary<CheckBox, long>();

		private void FormOption1Dlg_Load(object sender, EventArgs e) {
			optionVallueMap.Clear();
			optionVallueMap.Add(chkDMC_GETTEXT_OPT1_TEMP, 0x00000001);
			optionVallueMap.Add(chkDMC_GETTEXT_OPT1_INSERTF, 0x00000002);
			optionVallueMap.Add(chkDMC_GETTEXT_OPT1_INSERTF1, 0x00000004);
			optionVallueMap.Add(chkDMC_GETTEXT_OPT1_INSERTF2, 0x00000008);
			optionVallueMap.Add(chkDMC_GETTEXT_OPT1_INSERTF3, 0x00000010);
			optionVallueMap.Add(chkDMC_GETTEXT_OPT1_OWNERPWD5, 0x00000020);
			optionVallueMap.Add(chkDMC_GETTEXT_OPT1_COMPRESS, 0x00000100);
			optionVallueMap.Add(chkDMC_GETTEXT_OPT1_COMPRESS1, 0x00000200);
			optionVallueMap.Add(chkDMC_GETTEXT_OPT1_COMPRESS2, 0x00000400);
			optionVallueMap.Add(chkDMC_GETTEXT_OPT1_COMPRESS3, 0x00000800);
			optionVallueMap.Add(chkDMC_GETTEXT_OPT1_COMPRESS4, 0x00001000);
			optionVallueMap.Add(chkDMC_GETTEXT_OPT1_TRACK, 0x00002000);
			optionVallueMap.Add(chkDMC_GETTEXT_OPT1_COMPRESS5, 0x00004000);
			optionVallueMap.Add(chkDMC_GETTEXT_OPT1_INSERTF4, 0x00008000);
			optionVallueMap.Add(chkDMC_GETTEXT_OPT1_TXCONV, 0x00010000);
			optionVallueMap.Add(chkDMC_GETTEXT_OPT1_TXCONV2, 0x00020000);
			foreach (CheckBox chk in optionVallueMap.Keys) {
				chk.Checked = (option1 & optionVallueMap[chk]) != 0;
			}
		}

		private void btnOK_Click(object sender, EventArgs e) {
			option1 = 0;
			foreach (CheckBox chk in optionVallueMap.Keys) {
				if (chk.Checked)
					option1 |= optionVallueMap[chk];
			}
		}
	}
}
