File: MyGUI_Sharp_TabControl.cs

package info (click to toggle)
mygui 3.2.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 36,224 kB
  • sloc: cpp: 118,031; ansic: 30,202; xml: 15,544; cs: 12,602; tcl: 776; python: 417; makefile: 34
file content (537 lines) | stat: -rw-r--r-- 14,715 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
/*!
	@file
	@author		Generate utility by Albert Semenov
	@date		01/2009
	@module
*/

using System;
using System.Runtime.InteropServices;

namespace MyGUI.Sharp
{
    public  class TabControl :
		Widget
    {
        #region TabControl

        protected override string GetWidgetType() { return "TabControl"; }

        internal static BaseWidget RequestWrapTabControl(BaseWidget _parent, IntPtr _widget)
        {
			TabControl widget = new TabControl();
			widget.WrapWidget(_parent, _widget);
            return widget;
        }

        internal static BaseWidget RequestCreateTabControl(BaseWidget _parent, WidgetStyle _style, string _skin, IntCoord _coord, Align _align, string _layer, string _name)
        {
			TabControl widget = new TabControl();
			widget.CreateWidgetImpl(_parent, _style, _skin, _coord, _align, _layer, _name);
            return widget;
        }
        
		#endregion
	
		
		//InsertPoint
		#region Event TabChangeSelect

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControlEvent_AdviseTabChangeSelect(IntPtr _native, bool _advise);

		public delegate void HandleTabChangeSelect(
			TabControl _sender,
			uint _index);
			
		private HandleTabChangeSelect mEventTabChangeSelect;
		public event HandleTabChangeSelect EventTabChangeSelect
		{
			add
			{
				if (ExportEventTabChangeSelect.mDelegate == null)
				{
					ExportEventTabChangeSelect.mDelegate = new ExportEventTabChangeSelect.ExportHandle(OnExportTabChangeSelect);
					ExportEventTabChangeSelect.ExportTabControlEvent_DelegateTabChangeSelect(ExportEventTabChangeSelect.mDelegate);
				}

				if (mEventTabChangeSelect == null)
					ExportTabControlEvent_AdviseTabChangeSelect(Native, true);
				mEventTabChangeSelect += value;
			}
			remove
			{
				mEventTabChangeSelect -= value;
				if (mEventTabChangeSelect == null)
					ExportTabControlEvent_AdviseTabChangeSelect(Native, false);
			}
		}

		private struct ExportEventTabChangeSelect
		{
			[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
			public static extern void ExportTabControlEvent_DelegateTabChangeSelect(ExportHandle _delegate);
			[UnmanagedFunctionPointer(CallingConvention.StdCall)]
			public delegate void ExportHandle(
				IntPtr _sender,
				uint _index);
				
			public static ExportHandle mDelegate;
		}

		private static void OnExportTabChangeSelect(
			IntPtr _sender,
			uint _index)
		{
			TabControl sender = (TabControl)BaseWidget.GetByNative(_sender);

			if (sender.mEventTabChangeSelect != null)
				sender.mEventTabChangeSelect(
					sender ,
					_index);
		}

		#endregion
		#region Method GetButtonWidth

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
        
		private static extern int ExportTabControl_GetButtonWidth__item(IntPtr _native,
			IntPtr _item);

		public int GetButtonWidth(
			TabItem _item)
		{
			return ExportTabControl_GetButtonWidth__item(Native,
				_item.Native);
		}

		#endregion
		#region Method GetButtonWidthAt

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
        
		private static extern int ExportTabControl_GetButtonWidthAt__index(IntPtr _native,
			uint _index);

		public int GetButtonWidthAt(
			uint _index)
		{
			return ExportTabControl_GetButtonWidthAt__index(Native,
				_index);
		}

		#endregion
		#region Method SetButtonWidth

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControl_SetButtonWidth__item__width(IntPtr _native,
			IntPtr _item,
			int _width);

		public void SetButtonWidth(
			TabItem _item,
			int _width)
		{
			ExportTabControl_SetButtonWidth__item__width(Native,
				_item.Native,
				_width);
		}

		#endregion
		#region Method SetButtonWidthAt

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControl_SetButtonWidthAt__index__width(IntPtr _native,
			uint _index,
			int _width);

		public void SetButtonWidthAt(
			uint _index,
			int _width)
		{
			ExportTabControl_SetButtonWidthAt__index__width(Native,
				_index,
				_width);
		}

		#endregion
		#region Method BeginToItemSelected

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControl_BeginToItemSelected(IntPtr _native);

		public void BeginToItemSelected( )
		{
			ExportTabControl_BeginToItemSelected(Native);
		}

		#endregion
		#region Method BeginToItemLast

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControl_BeginToItemLast(IntPtr _native);

		public void BeginToItemLast( )
		{
			ExportTabControl_BeginToItemLast(Native);
		}

		#endregion
		#region Method BeginToItemFirst

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControl_BeginToItemFirst(IntPtr _native);

		public void BeginToItemFirst( )
		{
			ExportTabControl_BeginToItemFirst(Native);
		}

		#endregion
		#region Method BeginToItem

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControl_BeginToItem__item(IntPtr _native,
			IntPtr _item);

		public void BeginToItem(
			TabItem _item)
		{
			ExportTabControl_BeginToItem__item(Native,
				_item.Native);
		}

		#endregion
		#region Method BeginToItemAt

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControl_BeginToItemAt__index(IntPtr _native,
			uint _index);

		public void BeginToItemAt(
			uint _index)
		{
			ExportTabControl_BeginToItemAt__index(Native,
				_index);
		}

		#endregion
		#region Method GetItemName

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
        
		private static extern IntPtr ExportTabControl_GetItemName__item(IntPtr _native,
			IntPtr _item);

		public string GetItemName(
			TabItem _item)
		{
			return Marshal.PtrToStringUni(ExportTabControl_GetItemName__item(Native,
				_item.Native));
		}

		#endregion
		#region Method GetItemNameAt

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
        
		private static extern IntPtr ExportTabControl_GetItemNameAt__index(IntPtr _native,
			uint _index);

		public string GetItemNameAt(
			uint _index)
		{
			return Marshal.PtrToStringUni(ExportTabControl_GetItemNameAt__index(Native,
				_index));
		}

		#endregion
		#region Method SetItemName

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControl_SetItemName__item__name(IntPtr _native,
			IntPtr _item,
			[MarshalAs(UnmanagedType.LPWStr)] string _name);

		public void SetItemName(
			TabItem _item,
			string _name)
		{
			ExportTabControl_SetItemName__item__name(Native,
				_item.Native,
				_name);
		}

		#endregion
		#region Method SetItemNameAt

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControl_SetItemNameAt__index__name(IntPtr _native,
			uint _index,
			[MarshalAs(UnmanagedType.LPWStr)] string _name);

		public void SetItemNameAt(
			uint _index,
			string _name)
		{
			ExportTabControl_SetItemNameAt__index__name(Native,
				_index,
				_name);
		}

		#endregion
		#region Method SwapItems

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControl_SwapItems__index1__index2(IntPtr _native,
			uint _index1,
			uint _index2);

		public void SwapItems(
			uint _index1,
			uint _index2)
		{
			ExportTabControl_SwapItems__index1__index2(Native,
				_index1,
				_index2);
		}

		#endregion
		#region Method FindItemWith

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
        
		private static extern IntPtr ExportTabControl_FindItemWith__name(IntPtr _native,
			[MarshalAs(UnmanagedType.LPWStr)] string _name);

		public TabItem FindItemWith(
			string _name)
		{
			return (TabItem)BaseWidget.GetByNative(ExportTabControl_FindItemWith__name(Native,
				_name));
		}

		#endregion
		#region Method FindItemIndexWith

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
        
		private static extern uint ExportTabControl_FindItemIndexWith__name(IntPtr _native,
			[MarshalAs(UnmanagedType.LPWStr)] string _name);

		public uint FindItemIndexWith(
			string _name)
		{
			return ExportTabControl_FindItemIndexWith__name(Native,
				_name);
		}

		#endregion
		#region Method FindItemIndex

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
        
		private static extern uint ExportTabControl_FindItemIndex__item(IntPtr _native,
			IntPtr _item);

		public uint FindItemIndex(
			TabItem _item)
		{
			return ExportTabControl_FindItemIndex__item(Native,
				_item.Native);
		}

		#endregion
		#region Method GetItemIndex

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
        
		private static extern uint ExportTabControl_GetItemIndex__item(IntPtr _native,
			IntPtr _item);

		public uint GetItemIndex(
			TabItem _item)
		{
			return ExportTabControl_GetItemIndex__item(Native,
				_item.Native);
		}

		#endregion
		#region Method GetItemAt

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
        
		private static extern IntPtr ExportTabControl_GetItemAt__index(IntPtr _native,
			uint _index);

		public TabItem GetItemAt(
			uint _index)
		{
			return (TabItem)BaseWidget.GetByNative(ExportTabControl_GetItemAt__index(Native,
				_index));
		}

		#endregion
		#region Method RemoveAllItems

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControl_RemoveAllItems(IntPtr _native);

		public void RemoveAllItems( )
		{
			ExportTabControl_RemoveAllItems(Native);
		}

		#endregion
		#region Method RemoveItem

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControl_RemoveItem__item(IntPtr _native,
			IntPtr _item);

		public void RemoveItem(
			TabItem _item)
		{
			ExportTabControl_RemoveItem__item(Native,
				_item.Native);
		}

		#endregion
		#region Method RemoveItemAt

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControl_RemoveItemAt__index(IntPtr _native,
			uint _index);

		public void RemoveItemAt(
			uint _index)
		{
			ExportTabControl_RemoveItemAt__index(Native,
				_index);
		}

		#endregion
		#region Method AddItem

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
        
		private static extern IntPtr ExportTabControl_AddItem__name(IntPtr _native,
			[MarshalAs(UnmanagedType.LPWStr)] string _name);

		public TabItem AddItem(
			string _name)
		{
			return (TabItem)BaseWidget.GetByNative(ExportTabControl_AddItem__name(Native,
				_name));
		}

		#endregion
		#region Method InsertItemAt

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
        
		private static extern IntPtr ExportTabControl_InsertItemAt__index__name(IntPtr _native,
			uint _index,
			[MarshalAs(UnmanagedType.LPWStr)] string _name);

		public TabItem InsertItemAt(
			uint _index,
			string _name)
		{
			return (TabItem)BaseWidget.GetByNative(ExportTabControl_InsertItemAt__index__name(Native,
				_index,
				_name));
		}

		#endregion
		#region Property SmoothShow

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
        
		private static extern bool ExportTabControl_GetSmoothShow(IntPtr _widget);
		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControl_SetSmoothShow(IntPtr _widget, [MarshalAs(UnmanagedType.U1)] bool _value);

		public bool SmoothShow
		{
			get { return ExportTabControl_GetSmoothShow(Native); }
			set { ExportTabControl_SetSmoothShow(Native, value); }
		}

		#endregion
		#region Property ButtonAutoWidth

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
        
		private static extern bool ExportTabControl_GetButtonAutoWidth(IntPtr _widget);
		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControl_SetButtonAutoWidth(IntPtr _widget, [MarshalAs(UnmanagedType.U1)] bool _value);

		public bool ButtonAutoWidth
		{
			get { return ExportTabControl_GetButtonAutoWidth(Native); }
			set { ExportTabControl_SetButtonAutoWidth(Native, value); }
		}

		#endregion
		#region Property ButtonDefaultWidth

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
        
		private static extern int ExportTabControl_GetButtonDefaultWidth(IntPtr _widget);
		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControl_SetButtonDefaultWidth(IntPtr _widget, int _value);

		public int ButtonDefaultWidth
		{
			get { return ExportTabControl_GetButtonDefaultWidth(Native); }
			set { ExportTabControl_SetButtonDefaultWidth(Native, value); }
		}

		#endregion
		#region Property ItemSelected

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
        
		private static extern IntPtr ExportTabControl_GetItemSelected(IntPtr _widget);
		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControl_SetItemSelected(IntPtr _widget, TabItem _value);

		public TabItem ItemSelected
		{
			get { return (TabItem)BaseWidget.GetByNative(ExportTabControl_GetItemSelected(Native)); }
			set { ExportTabControl_SetItemSelected(Native, value); }
		}

		#endregion
		#region Property IndexSelected

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
        
		private static extern uint ExportTabControl_GetIndexSelected(IntPtr _widget);
		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void ExportTabControl_SetIndexSelected(IntPtr _widget, uint _value);

		public uint IndexSelected
		{
			get { return ExportTabControl_GetIndexSelected(Native); }
			set { ExportTabControl_SetIndexSelected(Native, value); }
		}

		#endregion
		#region Property ItemCount

		[DllImport(DllName.m_dllName, CallingConvention = CallingConvention.Cdecl)]
        
		private static extern uint ExportTabControl_GetItemCount(IntPtr _native);

		public uint ItemCount
		{
			get { return ExportTabControl_GetItemCount(Native); }
		}

		#endregion
		
    }
}