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 TabControl : 14 Widget 15 { 16 #region TabControl 17 GetWidgetType()18 protected override string GetWidgetType() { return "TabControl"; } 19 RequestWrapTabControl(BaseWidget _parent, IntPtr _widget)20 internal static BaseWidget RequestWrapTabControl(BaseWidget _parent, IntPtr _widget) 21 { 22 TabControl widget = new TabControl(); 23 widget.WrapWidget(_parent, _widget); 24 return widget; 25 } 26 RequestCreateTabControl(BaseWidget _parent, WidgetStyle _style, string _skin, IntCoord _coord, Align _align, string _layer, string _name)27 internal static BaseWidget RequestCreateTabControl(BaseWidget _parent, WidgetStyle _style, string _skin, IntCoord _coord, Align _align, string _layer, string _name) 28 { 29 TabControl widget = new TabControl(); 30 widget.CreateWidgetImpl(_parent, _style, _skin, _coord, _align, _layer, _name); 31 return widget; 32 } 33 34 #endregion 35 36 37 //InsertPoint 38 #region Event TabChangeSelect 39 40 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControlEvent_AdviseTabChangeSelect(IntPtr _native, bool _advise)41 private static extern void ExportTabControlEvent_AdviseTabChangeSelect(IntPtr _native, bool _advise); 42 HandleTabChangeSelect( TabControl _sender, uint _index)43 public delegate void HandleTabChangeSelect( 44 TabControl _sender, 45 uint _index); 46 47 private HandleTabChangeSelect mEventTabChangeSelect; 48 public event HandleTabChangeSelect EventTabChangeSelect 49 { 50 add 51 { 52 if (ExportEventTabChangeSelect.mDelegate == null) 53 { 54 ExportEventTabChangeSelect.mDelegate = new ExportEventTabChangeSelect.ExportHandle(OnExportTabChangeSelect); 55 ExportEventTabChangeSelect.ExportTabControlEvent_DelegateTabChangeSelect(ExportEventTabChangeSelect.mDelegate); 56 } 57 58 if (mEventTabChangeSelect == null) 59 ExportTabControlEvent_AdviseTabChangeSelect(Native, true); 60 mEventTabChangeSelect += value; 61 } 62 remove 63 { 64 mEventTabChangeSelect -= value; 65 if (mEventTabChangeSelect == null) 66 ExportTabControlEvent_AdviseTabChangeSelect(Native, false); 67 } 68 } 69 70 private struct ExportEventTabChangeSelect 71 { 72 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControlEvent_DelegateTabChangeSelectMyGUI.Sharp.TabControl.ExportEventTabChangeSelect73 public static extern void ExportTabControlEvent_DelegateTabChangeSelect(ExportHandle _delegate); 74 [UnmanagedFunctionPointer(CallingConvention.StdCall)] ExportHandleMyGUI.Sharp.TabControl.ExportEventTabChangeSelect75 public delegate void ExportHandle( 76 IntPtr _sender, 77 uint _index); 78 79 public static ExportHandle mDelegate; 80 } 81 OnExportTabChangeSelect( IntPtr _sender, uint _index)82 private static void OnExportTabChangeSelect( 83 IntPtr _sender, 84 uint _index) 85 { 86 TabControl sender = (TabControl)BaseWidget.GetByNative(_sender); 87 88 if (sender.mEventTabChangeSelect != null) 89 sender.mEventTabChangeSelect( 90 sender , 91 _index); 92 } 93 94 #endregion 95 #region Method GetButtonWidth 96 97 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 98 ExportTabControl_GetButtonWidth__item(IntPtr _native, IntPtr _item)99 private static extern int ExportTabControl_GetButtonWidth__item(IntPtr _native, 100 IntPtr _item); 101 GetButtonWidth( TabItem _item)102 public int GetButtonWidth( 103 TabItem _item) 104 { 105 return ExportTabControl_GetButtonWidth__item(Native, 106 _item.Native); 107 } 108 109 #endregion 110 #region Method GetButtonWidthAt 111 112 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 113 ExportTabControl_GetButtonWidthAt__index(IntPtr _native, uint _index)114 private static extern int ExportTabControl_GetButtonWidthAt__index(IntPtr _native, 115 uint _index); 116 GetButtonWidthAt( uint _index)117 public int GetButtonWidthAt( 118 uint _index) 119 { 120 return ExportTabControl_GetButtonWidthAt__index(Native, 121 _index); 122 } 123 124 #endregion 125 #region Method SetButtonWidth 126 127 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControl_SetButtonWidth__item__width(IntPtr _native, IntPtr _item, int _width)128 private static extern void ExportTabControl_SetButtonWidth__item__width(IntPtr _native, 129 IntPtr _item, 130 int _width); 131 SetButtonWidth( TabItem _item, int _width)132 public void SetButtonWidth( 133 TabItem _item, 134 int _width) 135 { 136 ExportTabControl_SetButtonWidth__item__width(Native, 137 _item.Native, 138 _width); 139 } 140 141 #endregion 142 #region Method SetButtonWidthAt 143 144 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControl_SetButtonWidthAt__index__width(IntPtr _native, uint _index, int _width)145 private static extern void ExportTabControl_SetButtonWidthAt__index__width(IntPtr _native, 146 uint _index, 147 int _width); 148 SetButtonWidthAt( uint _index, int _width)149 public void SetButtonWidthAt( 150 uint _index, 151 int _width) 152 { 153 ExportTabControl_SetButtonWidthAt__index__width(Native, 154 _index, 155 _width); 156 } 157 158 #endregion 159 #region Method BeginToItemSelected 160 161 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControl_BeginToItemSelected(IntPtr _native)162 private static extern void ExportTabControl_BeginToItemSelected(IntPtr _native); 163 BeginToItemSelected( )164 public void BeginToItemSelected( ) 165 { 166 ExportTabControl_BeginToItemSelected(Native); 167 } 168 169 #endregion 170 #region Method BeginToItemLast 171 172 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControl_BeginToItemLast(IntPtr _native)173 private static extern void ExportTabControl_BeginToItemLast(IntPtr _native); 174 BeginToItemLast( )175 public void BeginToItemLast( ) 176 { 177 ExportTabControl_BeginToItemLast(Native); 178 } 179 180 #endregion 181 #region Method BeginToItemFirst 182 183 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControl_BeginToItemFirst(IntPtr _native)184 private static extern void ExportTabControl_BeginToItemFirst(IntPtr _native); 185 BeginToItemFirst( )186 public void BeginToItemFirst( ) 187 { 188 ExportTabControl_BeginToItemFirst(Native); 189 } 190 191 #endregion 192 #region Method BeginToItem 193 194 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControl_BeginToItem__item(IntPtr _native, IntPtr _item)195 private static extern void ExportTabControl_BeginToItem__item(IntPtr _native, 196 IntPtr _item); 197 BeginToItem( TabItem _item)198 public void BeginToItem( 199 TabItem _item) 200 { 201 ExportTabControl_BeginToItem__item(Native, 202 _item.Native); 203 } 204 205 #endregion 206 #region Method BeginToItemAt 207 208 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControl_BeginToItemAt__index(IntPtr _native, uint _index)209 private static extern void ExportTabControl_BeginToItemAt__index(IntPtr _native, 210 uint _index); 211 BeginToItemAt( uint _index)212 public void BeginToItemAt( 213 uint _index) 214 { 215 ExportTabControl_BeginToItemAt__index(Native, 216 _index); 217 } 218 219 #endregion 220 #region Method GetItemName 221 222 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 223 ExportTabControl_GetItemName__item(IntPtr _native, IntPtr _item)224 private static extern IntPtr ExportTabControl_GetItemName__item(IntPtr _native, 225 IntPtr _item); 226 GetItemName( TabItem _item)227 public string GetItemName( 228 TabItem _item) 229 { 230 return Marshal.PtrToStringUni(ExportTabControl_GetItemName__item(Native, 231 _item.Native)); 232 } 233 234 #endregion 235 #region Method GetItemNameAt 236 237 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 238 ExportTabControl_GetItemNameAt__index(IntPtr _native, uint _index)239 private static extern IntPtr ExportTabControl_GetItemNameAt__index(IntPtr _native, 240 uint _index); 241 GetItemNameAt( uint _index)242 public string GetItemNameAt( 243 uint _index) 244 { 245 return Marshal.PtrToStringUni(ExportTabControl_GetItemNameAt__index(Native, 246 _index)); 247 } 248 249 #endregion 250 #region Method SetItemName 251 252 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControl_SetItemName__item__name(IntPtr _native, IntPtr _item, [MarshalAs(UnmanagedType.LPWStr)] string _name)253 private static extern void ExportTabControl_SetItemName__item__name(IntPtr _native, 254 IntPtr _item, 255 [MarshalAs(UnmanagedType.LPWStr)] string _name); 256 SetItemName( TabItem _item, string _name)257 public void SetItemName( 258 TabItem _item, 259 string _name) 260 { 261 ExportTabControl_SetItemName__item__name(Native, 262 _item.Native, 263 _name); 264 } 265 266 #endregion 267 #region Method SetItemNameAt 268 269 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControl_SetItemNameAt__index__name(IntPtr _native, uint _index, [MarshalAs(UnmanagedType.LPWStr)] string _name)270 private static extern void ExportTabControl_SetItemNameAt__index__name(IntPtr _native, 271 uint _index, 272 [MarshalAs(UnmanagedType.LPWStr)] string _name); 273 SetItemNameAt( uint _index, string _name)274 public void SetItemNameAt( 275 uint _index, 276 string _name) 277 { 278 ExportTabControl_SetItemNameAt__index__name(Native, 279 _index, 280 _name); 281 } 282 283 #endregion 284 #region Method SwapItems 285 286 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControl_SwapItems__index1__index2(IntPtr _native, uint _index1, uint _index2)287 private static extern void ExportTabControl_SwapItems__index1__index2(IntPtr _native, 288 uint _index1, 289 uint _index2); 290 SwapItems( uint _index1, uint _index2)291 public void SwapItems( 292 uint _index1, 293 uint _index2) 294 { 295 ExportTabControl_SwapItems__index1__index2(Native, 296 _index1, 297 _index2); 298 } 299 300 #endregion 301 #region Method FindItemWith 302 303 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 304 ExportTabControl_FindItemWith__name(IntPtr _native, [MarshalAs(UnmanagedType.LPWStr)] string _name)305 private static extern IntPtr ExportTabControl_FindItemWith__name(IntPtr _native, 306 [MarshalAs(UnmanagedType.LPWStr)] string _name); 307 FindItemWith( string _name)308 public TabItem FindItemWith( 309 string _name) 310 { 311 return (TabItem)BaseWidget.GetByNative(ExportTabControl_FindItemWith__name(Native, 312 _name)); 313 } 314 315 #endregion 316 #region Method FindItemIndexWith 317 318 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 319 ExportTabControl_FindItemIndexWith__name(IntPtr _native, [MarshalAs(UnmanagedType.LPWStr)] string _name)320 private static extern uint ExportTabControl_FindItemIndexWith__name(IntPtr _native, 321 [MarshalAs(UnmanagedType.LPWStr)] string _name); 322 FindItemIndexWith( string _name)323 public uint FindItemIndexWith( 324 string _name) 325 { 326 return ExportTabControl_FindItemIndexWith__name(Native, 327 _name); 328 } 329 330 #endregion 331 #region Method FindItemIndex 332 333 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 334 ExportTabControl_FindItemIndex__item(IntPtr _native, IntPtr _item)335 private static extern uint ExportTabControl_FindItemIndex__item(IntPtr _native, 336 IntPtr _item); 337 FindItemIndex( TabItem _item)338 public uint FindItemIndex( 339 TabItem _item) 340 { 341 return ExportTabControl_FindItemIndex__item(Native, 342 _item.Native); 343 } 344 345 #endregion 346 #region Method GetItemIndex 347 348 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 349 ExportTabControl_GetItemIndex__item(IntPtr _native, IntPtr _item)350 private static extern uint ExportTabControl_GetItemIndex__item(IntPtr _native, 351 IntPtr _item); 352 GetItemIndex( TabItem _item)353 public uint GetItemIndex( 354 TabItem _item) 355 { 356 return ExportTabControl_GetItemIndex__item(Native, 357 _item.Native); 358 } 359 360 #endregion 361 #region Method GetItemAt 362 363 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 364 ExportTabControl_GetItemAt__index(IntPtr _native, uint _index)365 private static extern IntPtr ExportTabControl_GetItemAt__index(IntPtr _native, 366 uint _index); 367 GetItemAt( uint _index)368 public TabItem GetItemAt( 369 uint _index) 370 { 371 return (TabItem)BaseWidget.GetByNative(ExportTabControl_GetItemAt__index(Native, 372 _index)); 373 } 374 375 #endregion 376 #region Method RemoveAllItems 377 378 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControl_RemoveAllItems(IntPtr _native)379 private static extern void ExportTabControl_RemoveAllItems(IntPtr _native); 380 RemoveAllItems( )381 public void RemoveAllItems( ) 382 { 383 ExportTabControl_RemoveAllItems(Native); 384 } 385 386 #endregion 387 #region Method RemoveItem 388 389 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControl_RemoveItem__item(IntPtr _native, IntPtr _item)390 private static extern void ExportTabControl_RemoveItem__item(IntPtr _native, 391 IntPtr _item); 392 RemoveItem( TabItem _item)393 public void RemoveItem( 394 TabItem _item) 395 { 396 ExportTabControl_RemoveItem__item(Native, 397 _item.Native); 398 } 399 400 #endregion 401 #region Method RemoveItemAt 402 403 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControl_RemoveItemAt__index(IntPtr _native, uint _index)404 private static extern void ExportTabControl_RemoveItemAt__index(IntPtr _native, 405 uint _index); 406 RemoveItemAt( uint _index)407 public void RemoveItemAt( 408 uint _index) 409 { 410 ExportTabControl_RemoveItemAt__index(Native, 411 _index); 412 } 413 414 #endregion 415 #region Method AddItem 416 417 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 418 ExportTabControl_AddItem__name(IntPtr _native, [MarshalAs(UnmanagedType.LPWStr)] string _name)419 private static extern IntPtr ExportTabControl_AddItem__name(IntPtr _native, 420 [MarshalAs(UnmanagedType.LPWStr)] string _name); 421 AddItem( string _name)422 public TabItem AddItem( 423 string _name) 424 { 425 return (TabItem)BaseWidget.GetByNative(ExportTabControl_AddItem__name(Native, 426 _name)); 427 } 428 429 #endregion 430 #region Method InsertItemAt 431 432 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 433 ExportTabControl_InsertItemAt__index__name(IntPtr _native, uint _index, [MarshalAs(UnmanagedType.LPWStr)] string _name)434 private static extern IntPtr ExportTabControl_InsertItemAt__index__name(IntPtr _native, 435 uint _index, 436 [MarshalAs(UnmanagedType.LPWStr)] string _name); 437 InsertItemAt( uint _index, string _name)438 public TabItem InsertItemAt( 439 uint _index, 440 string _name) 441 { 442 return (TabItem)BaseWidget.GetByNative(ExportTabControl_InsertItemAt__index__name(Native, 443 _index, 444 _name)); 445 } 446 447 #endregion 448 #region Property SmoothShow 449 450 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 451 ExportTabControl_GetSmoothShow(IntPtr _widget)452 private static extern bool ExportTabControl_GetSmoothShow(IntPtr _widget); 453 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControl_SetSmoothShow(IntPtr _widget, [MarshalAs(UnmanagedType.U1)] bool _value)454 private static extern void ExportTabControl_SetSmoothShow(IntPtr _widget, [MarshalAs(UnmanagedType.U1)] bool _value); 455 456 public bool SmoothShow 457 { 458 get { return ExportTabControl_GetSmoothShow(Native); } 459 set { ExportTabControl_SetSmoothShow(Native, value); } 460 } 461 462 #endregion 463 #region Property ButtonAutoWidth 464 465 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 466 ExportTabControl_GetButtonAutoWidth(IntPtr _widget)467 private static extern bool ExportTabControl_GetButtonAutoWidth(IntPtr _widget); 468 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControl_SetButtonAutoWidth(IntPtr _widget, [MarshalAs(UnmanagedType.U1)] bool _value)469 private static extern void ExportTabControl_SetButtonAutoWidth(IntPtr _widget, [MarshalAs(UnmanagedType.U1)] bool _value); 470 471 public bool ButtonAutoWidth 472 { 473 get { return ExportTabControl_GetButtonAutoWidth(Native); } 474 set { ExportTabControl_SetButtonAutoWidth(Native, value); } 475 } 476 477 #endregion 478 #region Property ButtonDefaultWidth 479 480 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 481 ExportTabControl_GetButtonDefaultWidth(IntPtr _widget)482 private static extern int ExportTabControl_GetButtonDefaultWidth(IntPtr _widget); 483 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControl_SetButtonDefaultWidth(IntPtr _widget, int _value)484 private static extern void ExportTabControl_SetButtonDefaultWidth(IntPtr _widget, int _value); 485 486 public int ButtonDefaultWidth 487 { 488 get { return ExportTabControl_GetButtonDefaultWidth(Native); } 489 set { ExportTabControl_SetButtonDefaultWidth(Native, value); } 490 } 491 492 #endregion 493 #region Property ItemSelected 494 495 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 496 ExportTabControl_GetItemSelected(IntPtr _widget)497 private static extern IntPtr ExportTabControl_GetItemSelected(IntPtr _widget); 498 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControl_SetItemSelected(IntPtr _widget, TabItem _value)499 private static extern void ExportTabControl_SetItemSelected(IntPtr _widget, TabItem _value); 500 501 public TabItem ItemSelected 502 { 503 get { return (TabItem)BaseWidget.GetByNative(ExportTabControl_GetItemSelected(Native)); } 504 set { ExportTabControl_SetItemSelected(Native, value); } 505 } 506 507 #endregion 508 #region Property IndexSelected 509 510 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 511 ExportTabControl_GetIndexSelected(IntPtr _widget)512 private static extern uint ExportTabControl_GetIndexSelected(IntPtr _widget); 513 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] ExportTabControl_SetIndexSelected(IntPtr _widget, uint _value)514 private static extern void ExportTabControl_SetIndexSelected(IntPtr _widget, uint _value); 515 516 public uint IndexSelected 517 { 518 get { return ExportTabControl_GetIndexSelected(Native); } 519 set { ExportTabControl_SetIndexSelected(Native, value); } 520 } 521 522 #endregion 523 #region Property ItemCount 524 525 [DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)] 526 ExportTabControl_GetItemCount(IntPtr _native)527 private static extern uint ExportTabControl_GetItemCount(IntPtr _native); 528 529 public uint ItemCount 530 { 531 get { return ExportTabControl_GetItemCount(Native); } 532 } 533 534 #endregion 535 536 } 537 } 538