using System.Windows.Forms;
using FastReport.Export;
using FastReport.Utils;
using FastReport.Export.BIFF8;


namespace FastReport.Forms
{
    internal partial class Excel2003ExportForm : BaseExportForm
    {
        public override void Init(ExportBase export)
        {
            base.Init(export);
            MyRes res = new MyRes("Export,Xls");
            Text = res.Get("");
            Excel2003Document Biff8Export = Export as Excel2003Document;
            cbWysiwyg.Checked = Biff8Export.Wysiwyg;
            cbPageBreaks.Checked = Biff8Export.PageBreaks;
            cbHideGridLines.Checked = Biff8Export.HideGridLines;
            cbPrintOptimized.Checked = Biff8Export.PrintOptimized;
        }
        
        protected override void Done()
        {
            base.Done();
            Excel2003Document Biff8Export = Export as Excel2003Document;
            Biff8Export.Wysiwyg = cbWysiwyg.Checked;
            Biff8Export.PageBreaks = cbPageBreaks.Checked;
            Biff8Export.HideGridLines = cbHideGridLines.Checked;
            Biff8Export.PrintOptimized = cbPrintOptimized.Checked;
        }
        
        public override void Localize()
        {
            base.Localize();
            MyRes res = new MyRes("Export,Misc");
            gbOptions.Text = res.Get("Options");
            cbWysiwyg.Text = res.Get("Wysiwyg");
            cbPageBreaks.Text = res.Get("PageBreaks");
            cbPrintOptimized.Text = res.Get("PrintOptimized");
            cbHideGridLines.Text = Res.Get("Export,Xls,HideGridLines");
        }

        public Excel2003ExportForm()
        {
            InitializeComponent();
        }
    }
}

