public SettingsPage()
        {
            m_sp = this;
            InitializeComponent();
            NavigationCacheMode = NavigationCacheMode.Enabled;

            int nLength = Sequences.strDiagramSettings.Length / 17;

            for (int i = 1; i < nLength; ++i)
            {
                if (Sequences.strDiagramSettings[5, i].Length > 0)
                {
                    cbxLineSequence.Items.Add(Sequences.strDiagramSettings[5, i]);
                }
            }
            cbxLineSequence.SelectedIndex = Sequences.LineSequence;

            for (int i = 1; i < nLength; ++i)
            {
                if (Sequences.strDiagramSettings[6, i].Length > 0)
                {
                    cbxLineRatio.Items.Add(Sequences.strDiagramSettings[6, i]);
                }
            }
            cbxLineRatio.SelectedIndex = Sequences.LineRatio;

            for (int i = 1; i < nLength; ++i)
            {
                if (Sequences.strDiagramSettings[7, i].Length > 0)
                {
                    cbxLineLabel.Items.Add(Sequences.strDiagramSettings[7, i]);
                }
            }
            cbxLineLabel.SelectedIndex = Sequences.LineLabel;

            for (int i = 1; i < nLength; ++i)
            {
                if (Sequences.strDiagramSettings[8, i].Length > 0)
                {
                    cbxLineText.Items.Add(Sequences.strDiagramSettings[8, i]);
                }
            }
            cbxLineText.SelectedIndex = Sequences.LineText;

            for (int i = 1; i < nLength; ++i)
            {
                if (Sequences.strDiagramSettings[9, i].Length > 0)
                {
                    cbxTrigramSequence.Items.Add(Sequences.strDiagramSettings[9, i]);
                }
            }
            cbxTrigramSequence.SelectedIndex = Sequences.TrigramSequence;

            for (int i = 1; i < nLength; ++i)
            {
                if (Sequences.strDiagramSettings[10, i].Length > 0)
                {
                    cbxTrigramRatio.Items.Add(Sequences.strDiagramSettings[10, i]);
                }
            }
            cbxTrigramRatio.SelectedIndex = Sequences.TrigramRatio;

            for (int i = 1; i < nLength; ++i)
            {
                if (Sequences.strDiagramSettings[11, i].Length > 0)
                {
                    cbxTrigramLabel.Items.Add(Sequences.strDiagramSettings[11, i]);
                }
            }
            cbxTrigramLabel.SelectedIndex = Sequences.TrigramLabel;

            for (int i = 1; i < nLength; ++i)
            {
                if (Sequences.strDiagramSettings[12, i].Length > 0)
                {
                    cbxTrigramText.Items.Add(Sequences.strDiagramSettings[12, i]);
                }
            }
            cbxTrigramText.SelectedIndex = Sequences.TrigramText;

            for (int i = 1; i < nLength; ++i)
            {
                if (Sequences.strDiagramSettings[13, i].Length > 0)
                {
                    cbxHexagramSequence.Items.Add(Sequences.strDiagramSettings[13, i]);
                }
            }
            cbxHexagramSequence.SelectedIndex = Sequences.HexagramSequence;

            for (int i = 1; i < nLength; ++i)
            {
                if (Sequences.strDiagramSettings[14, i].Length > 0)
                {
                    cbxHexagramRatio.Items.Add(Sequences.strDiagramSettings[14, i]);
                }
            }
            cbxHexagramRatio.SelectedIndex = Sequences.HexagramRatio;

            for (int i = 1; i < nLength; ++i)
            {
                if (Sequences.strDiagramSettings[15, i].Length > 0)
                {
                    cbxHexagramLabel.Items.Add(Sequences.strDiagramSettings[15, i]);
                }
            }
            cbxHexagramLabel.SelectedIndex = Sequences.HexagramLabel;

            for (int i = 1; i < nLength; ++i)
            {
                if (Sequences.strDiagramSettings[16, i].Length > 0)
                {
                    cbxHexagramText.Items.Add(Sequences.strDiagramSettings[16, i]);
                }
            }
            cbxHexagramText.SelectedIndex = Sequences.HexagramText;
        }