//----------------------------------------------------------------------------
// OptionsForm.cs
//
// Options form for C1ReportDesigner application
//
// This is a part of the C1ReportDesigner package.
// Copyright (C) ComponentOne LLC
// All rights reserved.
//
// This source code is intended as a supplement to the
// C1ReportDesigner control and related documentation 
// provided with the product.
// See these sources for detailed information regarding the
// C1ReportDesigner product.
//----------------------------------------------------------------------------
using System;
using System.Reflection;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

using C1.Win.C1ReportDesigner;

namespace ReportDesignerApp
{
    /// <summary>
    /// Summary description for OptionsForm.
    /// </summary>
    public class OptionsForm : System.Windows.Forms.Form
    {
        // ** fields
        private System.Windows.Forms.Button _btnOK;
        private System.Windows.Forms.Button _btnCancel;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.CheckBox _chkReload;
        private System.Windows.Forms.ComboBox _cmbUnits;
        private System.Windows.Forms.ComboBox _cmbExport;
        private System.Windows.Forms.CheckBox _chkEmbed;
        private System.Windows.Forms.CheckBox _chkUndo;
        private System.Windows.Forms.CheckBox _chkAutoSave;
        private System.Windows.Forms.CheckBox _chkCategorize;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.CheckBox _chkFilterField;
        private System.Windows.Forms.GroupBox groupBox2;
        private System.Windows.Forms.GroupBox groupBox3;
        private System.Windows.Forms.CheckBox _chkShowGrid;
        private System.Windows.Forms.CheckBox _chkSnapToGrid;
        private System.Windows.Forms.CheckBox _chkShowSubreportContent;
        private System.Windows.Forms.GroupBox groupBox5;
        private System.Windows.Forms.CheckBox _chkSyntaxColoring;
        private System.Windows.Forms.CheckBox _chkSyntaxCheck;
        private System.Windows.Forms.Button _btnFont;
        private System.Windows.Forms.Label label3;
        private Font _scriptEditorFont = new Font("Courier New", 9);
        private CheckBox _chkSortReportList;
        private NumericUpDown _numSpacing;
        private Label label4;
        private C1.Design.ColorPickerControl _cpicGridColorMajor;
        private C1.Design.ColorPickerControl _cpicFieldEdgeColor;
        private Label label5;
        private Label label6;
        private Label label7;
        private C1.Design.ColorPickerControl _cpicGridColorMinor;
        private CheckBox _chkShowExportOptions;

        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        // ** ctor
        public OptionsForm()
        {
            // initialize component
            InitializeComponent();
            AutoScaleMode = AutoScaleMode.None;
            Font = MainForm.DefaultAppFont;

            // populate export options combo with main app's filter options
            _cmbExport.Items.Clear();
            string[] exportOptions = MainForm._exportFilter.Split('|');
            for (int i = 0; i < exportOptions.Length; i += 2)
            {
                _cmbExport.Items.Add(exportOptions[i]);
            }
        }

        // ** dispose
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }


        //-----------------------------------------------------------------------
        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this._btnOK = new System.Windows.Forms.Button();
            this._btnCancel = new System.Windows.Forms.Button();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this._chkReload = new System.Windows.Forms.CheckBox();
            this._cmbUnits = new System.Windows.Forms.ComboBox();
            this._cmbExport = new System.Windows.Forms.ComboBox();
            this._chkEmbed = new System.Windows.Forms.CheckBox();
            this._chkUndo = new System.Windows.Forms.CheckBox();
            this._chkAutoSave = new System.Windows.Forms.CheckBox();
            this._chkCategorize = new System.Windows.Forms.CheckBox();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this._chkFilterField = new System.Windows.Forms.CheckBox();
            this._chkSortReportList = new System.Windows.Forms.CheckBox();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this._cpicFieldEdgeColor = new C1.Design.ColorPickerControl();
            this._numSpacing = new System.Windows.Forms.NumericUpDown();
            this._cpicGridColorMinor = new C1.Design.ColorPickerControl();
            this.label4 = new System.Windows.Forms.Label();
            this._cpicGridColorMajor = new C1.Design.ColorPickerControl();
            this._chkShowSubreportContent = new System.Windows.Forms.CheckBox();
            this.label7 = new System.Windows.Forms.Label();
            this.label6 = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this._chkShowGrid = new System.Windows.Forms.CheckBox();
            this._chkSnapToGrid = new System.Windows.Forms.CheckBox();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this._chkShowExportOptions = new System.Windows.Forms.CheckBox();
            this.groupBox5 = new System.Windows.Forms.GroupBox();
            this._btnFont = new System.Windows.Forms.Button();
            this._chkSyntaxColoring = new System.Windows.Forms.CheckBox();
            this._chkSyntaxCheck = new System.Windows.Forms.CheckBox();
            this.label3 = new System.Windows.Forms.Label();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this._numSpacing)).BeginInit();
            this.groupBox3.SuspendLayout();
            this.groupBox5.SuspendLayout();
            this.SuspendLayout();
            // 
            // _btnOK
            // 
            this._btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this._btnOK.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this._btnOK.Location = new System.Drawing.Point(358, 338);
            this._btnOK.Name = "_btnOK";
            this._btnOK.Size = new System.Drawing.Size(88, 24);
            this._btnOK.TabIndex = 4;
            this._btnOK.Text = "&OK";
            this._btnOK.Click += new System.EventHandler(this._btnOK_Click);
            // 
            // _btnCancel
            // 
            this._btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this._btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this._btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this._btnCancel.Location = new System.Drawing.Point(454, 338);
            this._btnCancel.Name = "_btnCancel";
            this._btnCancel.Size = new System.Drawing.Size(88, 24);
            this._btnCancel.TabIndex = 5;
            this._btnCancel.Text = "&Cancel";
            this._btnCancel.Click += new System.EventHandler(this._btnCancel_Click);
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.label1.Location = new System.Drawing.Point(18, 51);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(56, 13);
            this.label1.TabIndex = 2;
            this.label1.Text = "Grid Uni&ts:";
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.label2.Location = new System.Drawing.Point(13, 124);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(112, 13);
            this.label2.TabIndex = 4;
            this.label2.Text = "Default E&xport Format:";
            // 
            // _chkReload
            // 
            this._chkReload.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this._chkReload.Location = new System.Drawing.Point(16, 24);
            this._chkReload.Name = "_chkReload";
            this._chkReload.Size = new System.Drawing.Size(240, 21);
            this._chkReload.TabIndex = 0;
            this._chkReload.Text = "&Reload last file on Startup";
            // 
            // _cmbUnits
            // 
            this._cmbUnits.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this._cmbUnits.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this._cmbUnits.Items.AddRange(new object[] {
            "Automatic",
            "English (in)",
            "Metric (cm)",
            "Custom"});
            this._cmbUnits.Location = new System.Drawing.Point(126, 51);
            this._cmbUnits.Name = "_cmbUnits";
            this._cmbUnits.Size = new System.Drawing.Size(102, 21);
            this._cmbUnits.TabIndex = 3;
            this._cmbUnits.SelectedIndexChanged += new System.EventHandler(this._cmbUnits_SelectedIndexChanged);
            // 
            // _cmbExport
            // 
            this._cmbExport.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this._cmbExport.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this._cmbExport.Location = new System.Drawing.Point(13, 141);
            this._cmbExport.Name = "_cmbExport";
            this._cmbExport.Size = new System.Drawing.Size(246, 21);
            this._cmbExport.TabIndex = 5;
            // 
            // _chkEmbed
            // 
            this._chkEmbed.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this._chkEmbed.Location = new System.Drawing.Point(16, 48);
            this._chkEmbed.Name = "_chkEmbed";
            this._chkEmbed.Size = new System.Drawing.Size(240, 21);
            this._chkEmbed.TabIndex = 1;
            this._chkEmbed.Text = "&Embed images into Xml when saving";
            // 
            // _chkUndo
            // 
            this._chkUndo.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this._chkUndo.Location = new System.Drawing.Point(16, 72);
            this._chkUndo.Name = "_chkUndo";
            this._chkUndo.Size = new System.Drawing.Size(192, 21);
            this._chkUndo.TabIndex = 2;
            this._chkUndo.Text = "Enable &undo/redo";
            // 
            // _chkAutoSave
            // 
            this._chkAutoSave.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this._chkAutoSave.Location = new System.Drawing.Point(16, 72);
            this._chkAutoSave.Name = "_chkAutoSave";
            this._chkAutoSave.Size = new System.Drawing.Size(240, 21);
            this._chkAutoSave.TabIndex = 2;
            this._chkAutoSave.Text = "&Save changes before rendering";
            // 
            // _chkCategorize
            // 
            this._chkCategorize.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this._chkCategorize.Location = new System.Drawing.Point(16, 24);
            this._chkCategorize.Name = "_chkCategorize";
            this._chkCategorize.Size = new System.Drawing.Size(192, 21);
            this._chkCategorize.TabIndex = 0;
            this._chkCategorize.Text = "&Categorize property grid";
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this._chkCategorize);
            this.groupBox1.Controls.Add(this._chkFilterField);
            this.groupBox1.Controls.Add(this._chkSortReportList);
            this.groupBox1.Controls.Add(this._chkUndo);
            this.groupBox1.Location = new System.Drawing.Point(8, 8);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(265, 122);
            this.groupBox1.TabIndex = 0;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Properties";
            // 
            // _chkFilterField
            // 
            this._chkFilterField.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this._chkFilterField.Location = new System.Drawing.Point(16, 48);
            this._chkFilterField.Name = "_chkFilterField";
            this._chkFilterField.Size = new System.Drawing.Size(192, 21);
            this._chkFilterField.TabIndex = 1;
            this._chkFilterField.Text = "&Filter field properties";
            // 
            // _chkSortReportList
            // 
            this._chkSortReportList.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this._chkSortReportList.Location = new System.Drawing.Point(16, 96);
            this._chkSortReportList.Name = "_chkSortReportList";
            this._chkSortReportList.Size = new System.Drawing.Size(192, 21);
            this._chkSortReportList.TabIndex = 3;
            this._chkSortReportList.Text = "Sor&t report list";
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this._cpicFieldEdgeColor);
            this.groupBox2.Controls.Add(this._numSpacing);
            this.groupBox2.Controls.Add(this._cpicGridColorMinor);
            this.groupBox2.Controls.Add(this.label4);
            this.groupBox2.Controls.Add(this._cpicGridColorMajor);
            this.groupBox2.Controls.Add(this.label1);
            this.groupBox2.Controls.Add(this._chkShowSubreportContent);
            this.groupBox2.Controls.Add(this.label7);
            this.groupBox2.Controls.Add(this.label6);
            this.groupBox2.Controls.Add(this._cmbUnits);
            this.groupBox2.Controls.Add(this.label5);
            this.groupBox2.Controls.Add(this._chkShowGrid);
            this.groupBox2.Controls.Add(this._chkSnapToGrid);
            this.groupBox2.Location = new System.Drawing.Point(8, 136);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(265, 219);
            this.groupBox2.TabIndex = 1;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Design Pane";
            // 
            // _cpicFieldEdgeColor
            // 
            this._cpicFieldEdgeColor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this._cpicFieldEdgeColor.Color = System.Drawing.Color.Transparent;
            this._cpicFieldEdgeColor.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
            this._cpicFieldEdgeColor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this._cpicFieldEdgeColor.FormattingEnabled = true;
            this._cpicFieldEdgeColor.Items.AddRange(new object[] {
            "",
            "",
            ""});
            this._cpicFieldEdgeColor.Location = new System.Drawing.Point(126, 158);
            this._cpicFieldEdgeColor.Name = "_cpicFieldEdgeColor";
            this._cpicFieldEdgeColor.Size = new System.Drawing.Size(124, 21);
            this._cpicFieldEdgeColor.TabIndex = 11;
            // 
            // _numSpacing
            // 
            this._numSpacing.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this._numSpacing.Enabled = false;
            this._numSpacing.Location = new System.Drawing.Point(126, 78);
            this._numSpacing.Maximum = new decimal(new int[] {
            32000,
            0,
            0,
            0});
            this._numSpacing.Name = "_numSpacing";
            this._numSpacing.Size = new System.Drawing.Size(102, 20);
            this._numSpacing.TabIndex = 5;
            this._numSpacing.Value = new decimal(new int[] {
            1440,
            0,
            0,
            0});
            // 
            // _cpicGridColorMinor
            // 
            this._cpicGridColorMinor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this._cpicGridColorMinor.Color = System.Drawing.Color.Transparent;
            this._cpicGridColorMinor.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
            this._cpicGridColorMinor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this._cpicGridColorMinor.FormattingEnabled = true;
            this._cpicGridColorMinor.Items.AddRange(new object[] {
            "",
            "",
            ""});
            this._cpicGridColorMinor.Location = new System.Drawing.Point(126, 131);
            this._cpicGridColorMinor.Name = "_cpicGridColorMinor";
            this._cpicGridColorMinor.Size = new System.Drawing.Size(124, 21);
            this._cpicGridColorMinor.TabIndex = 9;
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.label4.Location = new System.Drawing.Point(18, 76);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(71, 13);
            this.label4.TabIndex = 4;
            this.label4.Text = "Grid S&pacing:";
            // 
            // _cpicGridColorMajor
            // 
            this._cpicGridColorMajor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this._cpicGridColorMajor.Color = System.Drawing.Color.Transparent;
            this._cpicGridColorMajor.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
            this._cpicGridColorMajor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this._cpicGridColorMajor.FormattingEnabled = true;
            this._cpicGridColorMajor.Items.AddRange(new object[] {
            "",
            "",
            ""});
            this._cpicGridColorMajor.Location = new System.Drawing.Point(126, 104);
            this._cpicGridColorMajor.Name = "_cpicGridColorMajor";
            this._cpicGridColorMajor.Size = new System.Drawing.Size(124, 21);
            this._cpicGridColorMajor.TabIndex = 7;
            // 
            // _chkShowSubreportContent
            // 
            this._chkShowSubreportContent.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this._chkShowSubreportContent.Location = new System.Drawing.Point(16, 185);
            this._chkShowSubreportContent.Name = "_chkShowSubreportContent";
            this._chkShowSubreportContent.Size = new System.Drawing.Size(184, 21);
            this._chkShowSubreportContent.TabIndex = 12;
            this._chkShowSubreportContent.Text = "Show Su&breport Content";
            // 
            // label7
            // 
            this.label7.AutoSize = true;
            this.label7.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.label7.Location = new System.Drawing.Point(18, 134);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(83, 13);
            this.label7.TabIndex = 8;
            this.label7.Text = "Grid &minor color:";
            // 
            // label6
            // 
            this.label6.AutoSize = true;
            this.label6.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.label6.Location = new System.Drawing.Point(18, 161);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(90, 13);
            this.label6.TabIndex = 10;
            this.label6.Text = "Fiel&d edges color:";
            // 
            // label5
            // 
            this.label5.AutoSize = true;
            this.label5.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.label5.Location = new System.Drawing.Point(18, 107);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(83, 13);
            this.label5.TabIndex = 6;
            this.label5.Text = "Grid ma&jor color:";
            // 
            // _chkShowGrid
            // 
            this._chkShowGrid.AutoSize = true;
            this._chkShowGrid.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this._chkShowGrid.Location = new System.Drawing.Point(16, 24);
            this._chkShowGrid.Name = "_chkShowGrid";
            this._chkShowGrid.Size = new System.Drawing.Size(81, 18);
            this._chkShowGrid.TabIndex = 0;
            this._chkShowGrid.Text = "Show &Grid";
            // 
            // _chkSnapToGrid
            // 
            this._chkSnapToGrid.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this._chkSnapToGrid.AutoSize = true;
            this._chkSnapToGrid.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this._chkSnapToGrid.Location = new System.Drawing.Point(126, 24);
            this._chkSnapToGrid.Name = "_chkSnapToGrid";
            this._chkSnapToGrid.Size = new System.Drawing.Size(91, 18);
            this._chkSnapToGrid.TabIndex = 1;
            this._chkSnapToGrid.Text = "S&nap to Grid";
            // 
            // groupBox3
            // 
            this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.groupBox3.Controls.Add(this._chkReload);
            this.groupBox3.Controls.Add(this._chkEmbed);
            this.groupBox3.Controls.Add(this._chkShowExportOptions);
            this.groupBox3.Controls.Add(this._chkAutoSave);
            this.groupBox3.Controls.Add(this._cmbExport);
            this.groupBox3.Controls.Add(this.label2);
            this.groupBox3.Location = new System.Drawing.Point(279, 12);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(265, 170);
            this.groupBox3.TabIndex = 2;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "Save/Load";
            // 
            // _chkShowExportOptions
            // 
            this._chkShowExportOptions.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this._chkShowExportOptions.Location = new System.Drawing.Point(16, 96);
            this._chkShowExportOptions.Name = "_chkShowExportOptions";
            this._chkShowExportOptions.Size = new System.Drawing.Size(240, 21);
            this._chkShowExportOptions.TabIndex = 3;
            this._chkShowExportOptions.Text = "Sho&w options when exporting";
            // 
            // groupBox5
            // 
            this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.groupBox5.Controls.Add(this._btnFont);
            this.groupBox5.Controls.Add(this._chkSyntaxColoring);
            this.groupBox5.Controls.Add(this._chkSyntaxCheck);
            this.groupBox5.Controls.Add(this.label3);
            this.groupBox5.Location = new System.Drawing.Point(279, 188);
            this.groupBox5.Name = "groupBox5";
            this.groupBox5.Size = new System.Drawing.Size(265, 112);
            this.groupBox5.TabIndex = 3;
            this.groupBox5.TabStop = false;
            this.groupBox5.Text = "Script Editor";
            // 
            // _btnFont
            // 
            this._btnFont.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this._btnFont.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this._btnFont.Location = new System.Drawing.Point(67, 74);
            this._btnFont.Name = "_btnFont";
            this._btnFont.Size = new System.Drawing.Size(192, 24);
            this._btnFont.TabIndex = 3;
            this._btnFont.Text = "Courier New, 9pt";
            this._btnFont.Click += new System.EventHandler(this._btnFont_Click);
            // 
            // _chkSyntaxColoring
            // 
            this._chkSyntaxColoring.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this._chkSyntaxColoring.Location = new System.Drawing.Point(16, 48);
            this._chkSyntaxColoring.Name = "_chkSyntaxColoring";
            this._chkSyntaxColoring.Size = new System.Drawing.Size(200, 21);
            this._chkSyntaxColoring.TabIndex = 1;
            this._chkSyntaxColoring.Text = "S&yntax Coloring";
            // 
            // _chkSyntaxCheck
            // 
            this._chkSyntaxCheck.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this._chkSyntaxCheck.Location = new System.Drawing.Point(16, 24);
            this._chkSyntaxCheck.Name = "_chkSyntaxCheck";
            this._chkSyntaxCheck.Size = new System.Drawing.Size(200, 21);
            this._chkSyntaxCheck.TabIndex = 0;
            this._chkSyntaxCheck.Text = "&Auto Syntax Checking";
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.label3.Location = new System.Drawing.Point(16, 80);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(31, 13);
            this.label3.TabIndex = 2;
            this.label3.Text = "F&ont:";
            // 
            // OptionsForm
            // 
            this.AcceptButton = this._btnOK;
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.CancelButton = this._btnCancel;
            this.ClientSize = new System.Drawing.Size(552, 369);
            this.Controls.Add(this.groupBox5);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this._btnOK);
            this.Controls.Add(this._btnCancel);
            this.Controls.Add(this.groupBox2);
            this.Controls.Add(this.groupBox3);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "OptionsForm";
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "C1ReportDesigner Options";
            this.groupBox1.ResumeLayout(false);
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this._numSpacing)).EndInit();
            this.groupBox3.ResumeLayout(false);
            this.groupBox3.PerformLayout();
            this.groupBox5.ResumeLayout(false);
            this.groupBox5.PerformLayout();
            this.ResumeLayout(false);

        }
        #endregion

        //-----------------------------------------------------------------------
        #region ** event handlers

        private void _btnOK_Click(object sender, System.EventArgs e)
        {
            DialogResult = DialogResult.OK;
        }
        private void _btnCancel_Click(object sender, System.EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
        }
        private void _btnFont_Click(object sender, System.EventArgs e)
        {
            using (FontDialog dlg = new FontDialog())
            {
                dlg.Font = _scriptEditorFont;
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    ScriptEditorFont = dlg.Font;
                }
            }
        }
        private void _cmbUnits_SelectedIndexChanged(object sender, EventArgs e)
        {
            _numSpacing.Enabled = _cmbUnits.SelectedIndex == 3; // Custom
        }

        #endregion

        //-----------------------------------------------------------------------
        #region ** object model

        public GridUnitsEnum GridUnits
        {
            get
            {
                switch (_cmbUnits.SelectedIndex)
                {
                    case 0: return GridUnitsEnum.Auto;
                    case 1: return GridUnitsEnum.English;
                    case 2: return GridUnitsEnum.Metric;
                    case 3: return GridUnitsEnum.Custom;
                }
                return GridUnitsEnum.Auto;
            }
            set
            {
                if (value == GridUnitsEnum.Auto) _cmbUnits.SelectedIndex = 0;
                if (value == GridUnitsEnum.English) _cmbUnits.SelectedIndex = 1;
                if (value == GridUnitsEnum.Metric) _cmbUnits.SelectedIndex = 2;
                if (value == GridUnitsEnum.Custom) _cmbUnits.SelectedIndex = 3;
            }
        }
        public int GridSpacing
        {
            get { return (int)_numSpacing.Value; }
            set { _numSpacing.Value = value; }
        }
        public bool ShowGrid
        {
            get { return _chkShowGrid.Checked; }
            set { _chkShowGrid.Checked = value; }
        }
        public bool SnapToGrid
        {
            get { return _chkSnapToGrid.Checked; }
            set { _chkSnapToGrid.Checked = value; }
        }
        public Color GridColorMajor
        {
            get { return _cpicGridColorMajor.Color; }
            set { _cpicGridColorMajor.Color = value; }
        }
        public Color GridColorMinor
        {
            get { return _cpicGridColorMinor.Color; }
            set { _cpicGridColorMinor.Color = value; }
        }
        public Color FieldEdgeColor
        {
            get { return _cpicFieldEdgeColor.Color; }
            set { _cpicFieldEdgeColor.Color = value; }
        }
        public int DefaultExportFormat
        {
            get { return _cmbExport.SelectedIndex + 1; }
            set
            {
                value--;
                if (value >= 0 && value < _cmbExport.Items.Count)
                    _cmbExport.SelectedIndex = value;
            }
        }
        public bool LoadOnStartup
        {
            get { return _chkReload.Checked; }
            set { _chkReload.Checked = value; }
        }
        public bool EmbedImages
        {
            get { return _chkEmbed.Checked; }
            set { _chkEmbed.Checked = value; }
        }
        public bool EnableUndo
        {
            get { return _chkUndo.Checked; }
            set { _chkUndo.Checked = value; }
        }
        public bool SortReportList
        {
            get { return _chkSortReportList.Checked; }
            set { _chkSortReportList.Checked = value; }
        }
        public bool AutoSave
        {
            get { return _chkAutoSave.Checked; }
            set { _chkAutoSave.Checked = value; }
        }
        public bool ShowExportOptions
        {
            get { return _chkShowExportOptions.Checked; }
            set { _chkShowExportOptions.Checked = value; }
        }
        public bool CategorizeProperties
        {
            get { return _chkCategorize.Checked; }
            set { _chkCategorize.Checked = value; }
        }
        public bool UseFieldWrappers
        {
            get { return _chkFilterField.Checked; }
            set { _chkFilterField.Checked = value; }
        }
        public bool ShowSubreportContent // <<B192>>
        {
            get { return _chkShowSubreportContent.Checked; }
            set { _chkShowSubreportContent.Checked = value; }
        }
        public bool SyntaxCheck // <<B193>>
        {
            get { return _chkSyntaxCheck.Checked; }
            set { _chkSyntaxCheck.Checked = value; }
        }
        public bool SyntaxColoring
        {
            get { return _chkSyntaxColoring.Checked; }
            set { _chkSyntaxColoring.Checked = value; }
        }
        public Font ScriptEditorFont
        {
            get { return _scriptEditorFont; }
            set
            {
                if (value != null)
                {
                    _scriptEditorFont = value;
                    _btnFont.Text = string.Format("{0}, {1}pt", value.Name, Math.Round(value.Size));
                }
            }
        }
        #endregion
    }
}
