1 /*! 2 @file 3 @author Generate utility by Albert Semenov 4 @date 01/2009 5 @module 6 */ 7 8 using System; 9 using System.Runtime.InteropServices; 10 11 namespace MyGUI.Sharp 12 { 13 public class MenuItem : 14 Widget 15 { 16 #region MenuItem 17 GetWidgetType()18 protected override string GetWidgetType() { return "MenuItem"; } 19 RequestWrapMenuItem(BaseWidget _parent, IntPtr _widget)20 internal static BaseWidget RequestWrapMenuItem(BaseWidget _parent, IntPtr _widget) 21 { 22 MenuItem widget = new MenuItem(); 23 widget.WrapWidget(_parent, _widget); 24 return widget; 25 } 26 RequestCreateMenuItem(BaseWidget _parent, WidgetStyle _style, string _skin, IntCoord _coord, Align _align, string _layer, string _name)27 internal static BaseWidget RequestCreateMenuItem(BaseWidget _parent, WidgetStyle _style, string _skin, IntCoord _coord, Align _align, string _layer, string _name) 28 { 29 MenuItem widget = new MenuItem(); 30 widget.CreateWidgetImpl(_parent, _style, _skin, _coord, _align, _layer, _name); 31 return widget; 32 } 33 34 #endregion 35 36 37 //InsertPoint 38 #region Method SetItemChildVisible 39 40 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportMenuItem_SetItemChildVisible__value(IntPtr _native, [MarshalAs(UnmanagedType.U1)] bool _value)41 private static extern void ExportMenuItem_SetItemChildVisible__value(IntPtr _native, 42 [MarshalAs(UnmanagedType.U1)] bool _value); 43 SetItemChildVisible( bool _value)44 public void SetItemChildVisible( 45 bool _value) 46 { 47 ExportMenuItem_SetItemChildVisible__value(Native, 48 _value); 49 } 50 51 #endregion 52 #region Method CreateItemChild 53 54 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 55 ExportMenuItem_CreateItemChild(IntPtr _native)56 private static extern IntPtr ExportMenuItem_CreateItemChild(IntPtr _native); 57 CreateItemChild( )58 public MenuControl CreateItemChild( ) 59 { 60 return (MenuControl)BaseWidget.GetByNative(ExportMenuItem_CreateItemChild(Native)); 61 } 62 63 #endregion 64 #region Method RemoveItem 65 66 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportMenuItem_RemoveItem(IntPtr _native)67 private static extern void ExportMenuItem_RemoveItem(IntPtr _native); 68 RemoveItem( )69 public void RemoveItem( ) 70 { 71 ExportMenuItem_RemoveItem(Native); 72 } 73 74 #endregion 75 #region Property ItemChecked 76 77 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 78 ExportMenuItem_GetItemChecked(IntPtr _widget)79 private static extern bool ExportMenuItem_GetItemChecked(IntPtr _widget); 80 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportMenuItem_SetItemChecked(IntPtr _widget, [MarshalAs(UnmanagedType.U1)] bool _value)81 private static extern void ExportMenuItem_SetItemChecked(IntPtr _widget, [MarshalAs(UnmanagedType.U1)] bool _value); 82 83 public bool ItemChecked 84 { 85 get { return ExportMenuItem_GetItemChecked(Native); } 86 set { ExportMenuItem_SetItemChecked(Native, value); } 87 } 88 89 #endregion 90 #region Property ItemChild 91 92 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 93 ExportMenuItem_GetItemChild(IntPtr _native)94 private static extern IntPtr ExportMenuItem_GetItemChild(IntPtr _native); 95 96 public MenuControl ItemChild 97 { 98 get { return (MenuControl)BaseWidget.GetByNative(ExportMenuItem_GetItemChild(Native)); } 99 } 100 101 #endregion 102 #region Property MenuCtrlParent 103 104 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 105 ExportMenuItem_GetMenuCtrlParent(IntPtr _native)106 private static extern IntPtr ExportMenuItem_GetMenuCtrlParent(IntPtr _native); 107 108 public MenuControl MenuCtrlParent 109 { 110 get { return (MenuControl)BaseWidget.GetByNative(ExportMenuItem_GetMenuCtrlParent(Native)); } 111 } 112 113 #endregion 114 #region Property ItemType 115 116 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 117 ExportMenuItem_GetItemType(IntPtr _widget)118 private static extern MenuItemType ExportMenuItem_GetItemType(IntPtr _widget); 119 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportMenuItem_SetItemType(IntPtr _widget, [MarshalAs(UnmanagedType.I4)] MenuItemType _value)120 private static extern void ExportMenuItem_SetItemType(IntPtr _widget, [MarshalAs(UnmanagedType.I4)] MenuItemType _value); 121 122 public MenuItemType ItemType 123 { 124 get { return ExportMenuItem_GetItemType(Native); } 125 set { ExportMenuItem_SetItemType(Native, value); } 126 } 127 128 #endregion 129 #region Property ItemIndex 130 131 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 132 ExportMenuItem_GetItemIndex(IntPtr _native)133 private static extern uint ExportMenuItem_GetItemIndex(IntPtr _native); 134 135 public uint ItemIndex 136 { 137 get { return ExportMenuItem_GetItemIndex(Native); } 138 } 139 140 #endregion 141 #region Property ItemId 142 143 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 144 ExportMenuItem_GetItemId(IntPtr _widget)145 private static extern IntPtr ExportMenuItem_GetItemId(IntPtr _widget); 146 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportMenuItem_SetItemId(IntPtr _widget, [MarshalAs(UnmanagedType.LPStr)] string _value)147 private static extern void ExportMenuItem_SetItemId(IntPtr _widget, [MarshalAs(UnmanagedType.LPStr)] string _value); 148 149 public string ItemId 150 { 151 get { return Marshal.PtrToStringAnsi(ExportMenuItem_GetItemId(Native)); } 152 set { ExportMenuItem_SetItemId(Native, value); } 153 } 154 155 #endregion 156 #region Property ItemName 157 158 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 159 ExportMenuItem_GetItemName(IntPtr _widget)160 private static extern IntPtr ExportMenuItem_GetItemName(IntPtr _widget); 161 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportMenuItem_SetItemName(IntPtr _widget, [MarshalAs(UnmanagedType.LPWStr)] string _value)162 private static extern void ExportMenuItem_SetItemName(IntPtr _widget, [MarshalAs(UnmanagedType.LPWStr)] string _value); 163 164 public string ItemName 165 { 166 get { return Marshal.PtrToStringUni(ExportMenuItem_GetItemName(Native)); } 167 set { ExportMenuItem_SetItemName(Native, value); } 168 } 169 170 #endregion 171 172 } 173 } 174