using System;
using System.Drawing;
using System.Windows.Forms;
namespace AT.STO.UI.Win
{
	/// 
	/// Represents the method which responds to a  event.
	/// 
	/// 
	/// 
	public delegate void DropDownCancelEventHandler(object sender, DropDownCancelEventArgs e);
	
	/// 
	/// Represents the method which responds to a  event.
	/// 
	/// 
	/// 
	public delegate void DropDownClosedEventHandler(object sender, DropDownClosedEventArgs e);
	
	/// 
	/// 
	/// 
	/// The object firing the event.
	/// 
	public delegate void DropDownValueChangedEventHandler(object sender, DropDownValueChangedEventArgs e);
	
	/// 
	/// Arguments to a .  Provides a
	/// reference to the popup form that is to be closed and 
	/// allows the operation to be cancelled.
	/// 
	/// Thousand thanks to Steve McMahon:
	/// http://www.vbaccelerator.com/home/NET/Code/Controls/Popup_Windows/Popup_Windows/Popup_Form_Demonstration.asp
	/// 
	public class DropDownCancelEventArgs : EventArgs
	{
	#region Private Variable Declarations
		private bool	_cancel				= false;
		private Point	_cursorLocation;
		private Form	_dropDown			= null;
	#endregion
	#region Constructor / Destructor
		/// 
		/// Constructs a new instance of this class.
		/// 
		/// The popup form
		/// The mouse location, if any, where the
		/// mouse event that would cancel the popup occured.
		public DropDownCancelEventArgs(Form DropDown, Point CursorLocation)
		{
			_dropDown		= DropDown;
			_cursorLocation = CursorLocation;
			_cancel			= false;
		}
	#endregion
	#region Public Properties	
		/// 
		/// 
		/// 
		public bool Cancel
		{
			get { return _cancel; }
			set { _cancel = value; }
		}
		/// 
		/// 
		/// 
		public Point CursorLocation
		{
			get { return _cursorLocation; }
		}
		/// 
		/// 
		/// 
		public Form DropDown
		{
			get { return _dropDown; }
		}
	#endregion
	}
	/// 
	/// Contains event information for a  event.
	/// 
	/// Thousand thanks to Steve McMahon:
	/// http://www.vbaccelerator.com/home/NET/Code/Controls/Popup_Windows/Popup_Windows/Popup_Form_Demonstration.asp
	/// 
	public class DropDownClosedEventArgs : EventArgs
	{
	#region Private Variable Declarations
		private Form _dropDown = null;
	#endregion
	#region Constructor / Destructor
		/// 
		/// Constructs a new instance of this class for the specified
		/// popup form.
		/// 
		/// DropDown Form which is being closed.
		public DropDownClosedEventArgs(Form DropDown)
		{
			_dropDown = DropDown;
		}
	#endregion
	#region Public Properties
		/// 
		/// Gets the dropdown form which is being closed.
		/// 
		public Form DropDown
		{
			get { return _dropDown; }
		}
	#endregion
	}
	
	/// 
	/// Contains event information for DropDownValueChangedEventHandler.
	/// 
	public class DropDownValueChangedEventArgs : EventArgs
	{
	#region Private Variable Declarations
		private object _value = null;
	#endregion
	#region Constructor / Destructor
		/// 
		/// Default Constructor
		/// 
		public DropDownValueChangedEventArgs()
		{
		}
		
		/// 
		/// Initialization with the control's value.
		/// 
		/// 
		public DropDownValueChangedEventArgs(object Value)
		{
			_value = Value;
		}
	#endregion
	#region Public Properties
		/// 
		/// Gets or sets the control's value.
		/// 
		public object Value
		{
			get { return _value; }
			set { _value = value; }
		}
	#endregion
	}
}