context: /*!
  	@file
  	@author		Generate utility by Albert Semenov
  	@date		01/2009
  	@module
  */
  
  using System;
  using System.Runtime.InteropServices;
  
  namespace MyGUI.Sharp
  {
  
      public  class ItemBox : DDContainer
      {
  
          #region ItemBox
  
          protected override string GetWidgetType() { return "ItemBox"; }
  
          internal static BaseWidget RequestWrapItemBox(BaseWidget _parent, IntPtr _widget)
          {
  			ItemBox widget = new ItemBox();
  			widget.WrapWidget(_parent, _widget);
              return widget;
          }
  
          internal static BaseWidget RequestCreateItemBox(BaseWidget _parent, WidgetStyle _style, string _skin, IntCoord _coord, Align _align, string _layer, string _name)
          {
  			ItemBox widget = new ItemBox();
  			widget.CreateWidgetImpl(_parent, _style, _skin, _coord, _align, _layer, _name);
              return widget;
          }
          
  		#endregion
  	
  		
  		//InsertPoint
  		#region Event NotifyItem
  
  		[DllImport("MyGUI_Export", CallingConvention = CallingConvention.Cdecl)]
  		private static extern void ExportItemBoxEvent_AdviseNotifyItem( IntPtr _native, bool _advise );
  
  		public delegate void HandleNotifyItem(
  			 ItemBox _sender ,
  			ref IBNotifyItemData _info );
  			
  		private HandleNotifyItem mEventNotifyItem;
  		public event HandleNotifyItem EventNotifyItem
  		{
  			add
  			{
  				if (ExportEventNotifyItem.mDelegate == null)
  				{
  					ExportEventNotifyItem.mDelegate = new ExportEventNotifyItem.ExportHandle( OnExportNotifyItem );
  					ExportEventNotifyItem.ExportItemBoxEvent_DelegateNotifyItem( ExportEventNotifyItem.mDelegate );
  				}
  
  				if (mEventNotifyItem == null)
  					ExportItemBoxEvent_AdviseNotifyItem( mNative, true );
  				mEventNotifyItem += value;
  			}
  			remove
  			{
  				mEventNotifyItem -= value;
  				if (mEventNotifyItem == null)
  					ExportItemBoxEvent_AdviseNotifyItem( mNative, false );
  			}
  		}
  
  		private struct ExportEventNotifyItem
  		{
  			[DllImport("MyGUI_Export", CallingConvention = CallingConvention.Cdecl)]
  			public static extern void ExportItemBoxEvent_DelegateNotifyItem( ExportHandle _delegate );
  			[UnmanagedFunctionPointer(CallingConvention.StdCall)]
  			public delegate void ExportHandle(
  				[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(InterfaceMarshaler))]  ItemBox _sender ,
  				[In] ref IBNotifyItemData _info );
  				
  			public static ExportHandle mDelegate;
  		}
  
  		private static void OnExportNotifyItem(
  			 ItemBox _sender ,
  			ref IBNotifyItemData _info )
  		{
  			if (_sender.mEventNotifyItem != null)
  				_sender.mEventNotifyItem(
  					 _sender ,
  					ref _info );
  		}
  
  		#endregion
  		#region Event MouseItemActivate
  
  		[DllImport("MyGUI_Export", CallingConvention = CallingConvention.Cdecl)]
  		private static extern void ExportItemBoxEvent_AdviseMouseItemActivate( IntPtr _native, bool _advise );
  
  		public delegate void HandleMouseItemActivate(
  			 ItemBox _sender ,
  			 uint _index );
  			
  		private HandleMouseItemActivate mEventMouseItemActivate;
  		public event HandleMouseItemActivate EventMouseItemActivate
  		{
  			add
  			{
  				if (ExportEventMouseItemActivate.mDelegate == null)
  				{
  					ExportEventMouseItemActivate.mDelegate = new ExportEventMouseItemActivate.ExportHandle( OnExportMouseItemActivate );
  					ExportEventMouseItemActivate.ExportItemBoxEvent_DelegateMouseItemActivate( ExportEventMouseItemActivate.mDelegate );
  				}
  
  				if (mEventMouseItemActivate == null)
  					ExportItemBoxEvent_AdviseMouseItemActivate( mNative, true );
  				mEventMouseItemActivate += value;
  			}
  			remove
  			{
  				mEventMouseItemActivate -= value;
  				if (mEventMouseItemActivate == null)
  					ExportItemBoxEvent_AdviseMouseItemActivate( mNative, false );
  			}
  		}
  
  		private struct ExportEventMouseItemActivate
  		{
  			[DllImport("MyGUI_Export", CallingConvention = CallingConvention.Cdecl)]
  			public static extern void ExportItemBoxEvent_DelegateMouseItemActivate( ExportHandle _delegate );
  			[UnmanagedFunctionPointer(CallingConvention.StdCall)]
  			public delegate void ExportHandle(
  				[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(InterfaceMarshaler))]  ItemBox _sender ,
  				  uint _index );
  				
  			public static ExportHandle mDelegate;
  		}
  
  		private static void OnExportMouseItemActivate(
  			 ItemBox _sender ,
  			 uint _index )
  		{
  			if (_sender.mEventMouseItemActivate != null)
  				_sender.mEventMouseItemActivate(
  					 _sender ,
  					 _index );
  		}
  
  		#endregion
  		#region Event ChangeItemPosition
  
  		[DllImport("MyGUI_Export", CallingConvention = CallingConvention.Cdecl)]
  		private static extern void ExportItemBoxEvent_AdviseChangeItemPosition( IntPtr _native, bool _advise );
  
  		public delegate void HandleChangeItemPosition(
  			 ItemBox _sender ,
  			 uint _index );
  			
  		private HandleChangeItemPosition mEventChangeItemPosition;
  		public event HandleChangeItemPosition EventChangeItemPosition
  		{
  			add
  			{
  				if (ExportEventChangeItemPosition.mDelegate == null)
  				{
  					ExportEventChangeItemPosition.mDelegate = new ExportEventChangeItemPosition.ExportHandle( OnExportChangeItemPosition );
  					ExportEventChangeItemPosition.ExportItemBoxEvent_DelegateChangeItemPosition( ExportEventChangeItemPosition.mDelegate );
  				}
  
  				if (mEventChangeItemPosition == null)
  					ExportItemBoxEvent_AdviseChangeItemPosition( mNative, true );
  				mEventChangeItemPosition += value;
  			}
  			remove
  			{
  				mEventChangeItemPosition -= value;
  				if (mEventChangeItemPosition == null)
  					ExportItemBoxEvent_AdviseChangeItemPosition( mNative, false );
  			}
  		}
  
  		private struct ExportEventChangeItemPosition
  		{
  			[DllImport("MyGUI_Export", CallingConvention = CallingConvention.Cdecl)]
  			public static extern void ExportItemBoxEvent_DelegateChangeItemPosition( ExportHandle _delegate );
  			[UnmanagedFunctionPointer(CallingConvention.StdCall)]
  			public delegate void ExportHandle(
  				[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(InterfaceMarshaler))]  ItemBox _sender ,
  				  uint _index );
  				
  			public static ExportHandle mDelegate;
  		}
  
  		private static void OnExportChangeItemPosition(
  			 ItemBox _sender ,
  			 uint _index )
  		{
  			if (_sender.mEventChangeItemPosition != null)
  				_sender.mEventChangeItemPosition(
  					 _sender ,
  					 _index );
  		}
  
  		#endregion
  		#region Event SelectItemAccept
  
  		[DllImport("MyGUI_Export", CallingConvention = CallingConvention.Cdecl)]
  		private static extern void ExportItemBoxEvent_AdviseSelectItemAccept( IntPtr _native, bool _advise );
  
  		public delegate void HandleSelectItemAccept(
  			 ItemBox _sender ,
  			 uint _index );
  			
  		private HandleSelectItemAccept mEventSelectItemAccept;
  		public event HandleSelectItemAccept EventSelectItemAccept
  		{
  			add
  			{
  				if (ExportEventSelectItemAccept.mDelegate == null)
  				{
  					ExportEventSelectItemAccept.mDelegate = new ExportEventSelectItemAccept.ExportHandle( OnExportSelectItemAccept );
  					ExportEventSelectItemAccept.ExportItemBoxEvent_DelegateSelectItemAccept( ExportEventSelectItemAccept.mDelegate );
  				}
  
  				if (mEventSelectItemAccept == null)
  					ExportItemBoxEvent_AdviseSelectItemAccept( mNative, true );
  				mEventSelectItemAccept += value;
  			}
  			remove
  			{
  				mEventSelectItemAccept -= value;
  				if (mEventSelectItemAccept == null)
  					ExportItemBoxEvent_AdviseSelectItemAccept( mNative, false );
  			}
  		}
  
  		private struct ExportEventSelectItemAccept
  		{
  			[DllImport("MyGUI_Export", CallingConvention = CallingConvention.Cdecl)]
  			public static extern void ExportItemBoxEvent_DelegateSelectItemAccept( ExportHandle _delegate );
  			[UnmanagedFunctionPointer(CallingConvention.StdCall)]
  			public delegate void ExportHandle(
  				[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(InterfaceMarshaler))]  ItemBox _sender ,
  				  uint _index );
  				
  			public static ExportHandle mDelegate;
  		}
  
  		private static void OnExportSelectItemAccept(
  			 ItemBox _sender ,
  			 uint _index )
  		{
  			if (_sender.mEventSelectItemAccept != null)
  				_sender.mEventSelectItemAccept(
  					 _sender ,
  					 _index );
  		}
  
  		#endregion
  		#region Request DrawItem
  
  		[DllImport("MyGUI_Export", CallingConvention = CallingConvention.Cdecl)]
  		private static extern void ExportItemBoxEvent_AdviseDrawItem( IntPtr _native, bool _advise );
  
  		public delegate void HandleDrawItem(
  			 ItemBox _sender ,
  			 Widget _item ,
  			ref IBDrawItemInfo _info );
  			
  		private HandleDrawItem mEventDrawItem;
  		public event HandleDrawItem RequestDrawItem
  		{
  			add
  			{
  				if (ExportEventDrawItem.mDelegate == null)
  				{
  					ExportEventDrawItem.mDelegate = new ExportEventDrawItem.ExportHandle( OnExportDrawItem );
  					ExportEventDrawItem.ExportItemBoxEvent_DelegateDrawItem( ExportEventDrawItem.mDelegate );
  				}
  
  				if (mEventDrawItem == null)
  					ExportItemBoxEvent_AdviseDrawItem( mNative, true );
  				mEventDrawItem += value;
  			}
  			remove
  			{
  				mEventDrawItem -= value;
  
gt: 				if (mEventDrawItem == null)