using System;
using System.ComponentModel;
using System.Drawing.Printing;
using System.Windows.Forms;
using Infragistics.Win.Misc;

namespace Medivators.Reporting
{
	public partial class dlgPrintPreview : Form
	{
		public dlgPrintPreview()
		{
			InitializeComponent();
		}

		private void numericUpDown1_ValueChanged(object sender, Hanna.Controls.ValueChangedEventArgs e)
		{
			this.printPreviewDisplay.Columns = e.Value;
		}

		public PrintDocument Document
		{
			get { return printPreviewDisplay.Document; }
			set { printPreviewDisplay.Document = value; }
		}

		private void btnPrint_Click(object sender, EventArgs e)
		{
			try
			{
				Document.Print();
			}
			catch (Exception ex)
			{
				App.ShowError("Error printing report.", ex);
			}
		}
		private void btnOK_Click(object sender, EventArgs e)
		{
			this.Hide();
		}

		#region *	manual handling command button Focus and LostFocus
		private void Command_Focus(object sender, EventArgs e)
		{
			((UltraButton)sender).Appearance.FontData.Bold = Infragistics.Win.DefaultableBoolean.True;
		}

		private void Command_Unfocus(object sender, EventArgs e)
		{
			((UltraButton)sender).Appearance.FontData.Bold = Infragistics.Win.DefaultableBoolean.False;
		}
		#endregion

	}
}