forked from extnet/Ext.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTabPanelBase.cs
More file actions
949 lines (874 loc) · 34.2 KB
/
TabPanelBase.cs
File metadata and controls
949 lines (874 loc) · 34.2 KB
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
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
/********
* @version : 1.6.0 - Ext.NET Pro License
* @author : Ext.NET, Inc. http://www.ext.net/
* @date : 2012-11-21
* @copyright : Copyright (c) 2007-2012, Ext.NET, Inc. (http://www.ext.net/). All rights reserved.
* @license : See license.txt and http://www.ext.net/license/.
********/
using System;
using System.Collections;
using System.ComponentModel;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net.Utilities;
namespace Ext.Net
{
/// <summary>
///
/// </summary>
[Meta]
[Description("")]
public abstract partial class TabPanelBase : PanelBase, IItems, IAutoPostBack
{
/// <summary>
///
/// </summary>
[Category("0. About")]
[Description("")]
public override string XType
{
get
{
return "tabpanel";
}
}
/// <summary>
///
/// </summary>
[Category("0. About")]
[Description("")]
public override string InstanceOf
{
get
{
return "Ext.TabPanel";
}
}
/// <summary>
///
/// </summary>
protected override bool UseDefaultLayout
{
get
{
return false;
}
}
/// <summary>
///
/// </summary>
/// <param name="e"></param>
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
if (!this.DesignMode)
{
this.Page.PreRender += Page_PreRender;
}
}
private void Page_PreRender(object sender, EventArgs e)
{
if (this.MinTabWidth != Unit.Pixel(30))
{
this.ResizeTabs = true;
}
foreach (BoxComponentBase item in this.Items)
{
if (item.Hidden)
{
if (this.LazyItems.Contains(item))
{
this.LazyItems.Remove(item);
}
}
}
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public override bool HasLayout()
{
return true;
}
/// <summary>
/// The numeric index of the tab that should be initially activated on render.
/// </summary>
[Meta]
[DefaultValue(null)]
[Browsable(false)]
[Description("The numeric index of the tab that should be initially activated on render.")]
public virtual BoxComponentBase ActiveTab
{
get
{
if (this.ActiveTabIndex > this.Items.Count - 1)
{
return this.Items[this.Items.Count - 1] as BoxComponentBase;
}
return this.Items[this.ActiveTabIndex] as BoxComponentBase;
}
set
{
this.ActiveTabIndex = this.Items.IndexOf(value);
}
}
/// <summary>
/// The numeric index of the tab that should be initially activated on render.
/// </summary>
[Meta]
[DirectEventUpdate(MethodName = "SetActiveTab")]
[Category("7. TabPanel")]
[DefaultValue(-1)]
[NotifyParentProperty(true)]
[Description("The numeric index of the tab that should be initially activated on render.")]
public virtual int ActiveTabIndex
{
get
{
object obj = this.ViewState["ActiveTabIndex"];
return (obj == null) ? (this.Items.Count == 0) ? -1 : 0 : (int)obj;
}
set
{
this.ViewState["ActiveTabIndex"] = value;
this.CheckTabVisible();
}
}
/// <summary>
///
/// </summary>
[ConfigOption("activeTab")]
[DefaultValue(-1)]
protected internal int VisibleIndex
{
get
{
int i = this.ActiveTabIndex;
int correction = 0;
for (int ind = 0; ind < Math.Min(i, this.Items.Count); ind++)
{
if (!this.Items[ind].Visible || this.Items[ind].Hidden)
{
correction++;
}
}
return i - correction;
}
}
internal bool HasVisibleTab
{
get
{
foreach (BoxComponentBase item in this.Items)
{
if (item.Visible == true)
{
return true;
}
}
return false;
}
}
private void CheckTabVisible()
{
TabPanel tp = (TabPanel)this;
if (tp.AutoPostBack && tp.DeferredRender)
{
for (int i = 0; i < tp.Items.Count; i++)
{
if (tp.Items[i] is IContent)
{
if (!tp.Items[i].HasLayout() || (tp.Items[i].HasLayout() && tp.ActiveTabIndex == i))
{
((IContent)tp.Items[i]).ContentContainer.Visible = (tp.ActiveTabIndex == i);
}
}
foreach (Control control in tp.Items[i].Controls)
{
control.Visible = tp.ActiveTabIndex == i;
}
}
}
}
/// <summary>
///
/// </summary>
/// <param name="e"></param>
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
this.CheckTabVisible();
}
/// <summary>
/// True to animate tab scrolling so that hidden tabs slide smoothly into view (defaults to true). Only applies when EnableTabScroll = true.
/// </summary>
[Meta]
[ConfigOption]
[Category("7. TabPanel")]
[DefaultValue(true)]
[NotifyParentProperty(true)]
[Description("True to animate tab scrolling so that hidden tabs slide smoothly into view (defaults to true). Only applies when EnableTabScroll = true.")]
public virtual bool AnimScroll
{
get
{
object obj = this.ViewState["AnimScroll"];
return (obj == null) ? true : (bool)obj;
}
set
{
this.ViewState["AnimScroll"] = value;
}
}
/// <summary>
/// The CSS selector used to search for tabs in existing markup when autoTabs = true (defaults to 'div.x-tab'). This can be any valid selector supported by Ext.DomQuery.select. Note that the query will be executed within the scope of this tab panel only (so that multiple tab panels from markup can be supported on a page).
/// </summary>
[Meta]
[ConfigOption]
[Category("7. TabPanel")]
[DefaultValue("div.x-tab")]
[NotifyParentProperty(true)]
[Description("The CSS selector used to search for tabs in existing markup when autoTabs = true (defaults to 'div.x-tab'). This can be any valid selector supported by Ext.DomQuery.select. Note that the query will be executed within the scope of this tab panel only (so that multiple tab panels from markup can be supported on a page).")]
public virtual string AutoTabSelector
{
get
{
return (string)this.ViewState["AutoTabSelector"] ?? "div.x-tab";
}
set
{
this.ViewState["AutoTabSelector"] = value;
}
}
/// <summary>
/// true to query the DOM for any divs with a class of 'x-tab' to be automatically converted to tabs and added to this panel (defaults to false). Note that the query will be executed within the scope of the container element only (so that multiple tab panels from markup can be supported via this method).
/// </summary>
/// <remarks>
/// This method is only possible when the markup is structured correctly as a container with nested divs containing the class 'x-tab'. To create TabPanels without these limitations, or to pull tab content from other elements on the page, see the example at the top of the class for generating tabs from markup.
/// There are a couple of things to note when using this method:
/// When using the autoTabs config (as opposed to passing individual tab configs in the TabPanel's items collection), you must use applyTo to correctly use the specified id as the tab container. The autoTabs method replaces existing content with the TabPanel components.
/// Make sure that you set deferredRender: false so that the content elements for each tab will be rendered into the TabPanel immediately upon page load, otherwise they will not be transformed until each tab is activated and will be visible outside the TabPanel.
/// </remarks>
[Meta]
[ConfigOption]
[Category("7. TabPanel")]
[DefaultValue(false)]
[NotifyParentProperty(true)]
[Description("True to animate tab scrolling so that hidden tabs slide smoothly into view (defaults to true). Only applies when EnableTabScroll = true.")]
public virtual bool AutoTabs
{
get
{
object obj = this.ViewState["AutoTabs"];
return (obj == null) ? false : (bool)obj;
}
set
{
this.ViewState["AutoTabs"] = value;
}
}
/// <summary>
/// The base CSS class applied to the panel (defaults to 'x-tab-panel').
/// </summary>
[Meta]
[ConfigOption]
[Category("7. TabPanel")]
[DefaultValue("x-tab-panel")]
[NotifyParentProperty(true)]
[Description("The base CSS class applied to the panel (defaults to 'x-tab-panel').")]
public override string BaseCls
{
get
{
return (string)this.ViewState["BaseCls"] ?? "x-tab-panel";
}
set
{
this.ViewState["BaseCls"] = value;
}
}
/// <summary>
/// Determining whether or not each tab is rendered only when first accessed (defaults to true).
/// </summary>
[Meta]
[ConfigOption]
[Category("7. TabPanel")]
[DefaultValue(true)]
[NotifyParentProperty(true)]
[Description("Determining whether or not each tab is rendered only when first accessed (defaults to true).")]
public virtual bool DeferredRender
{
get
{
object obj = this.ViewState["DeferredRender"];
return (obj == null) ? true : (bool)obj;
}
set
{
this.ViewState["DeferredRender"] = value;
}
}
/// <summary>
/// True to enable scrolling to tabs that may be invisible due to overflowing the overall TabPanel width. Only available with tabs on addToStart. (defaults to false).
/// </summary>
[Meta]
[ConfigOption]
[Category("7. TabPanel")]
[DefaultValue(false)]
[NotifyParentProperty(true)]
[Description("True to enable scrolling to tabs that may be invisible due to overflowing the overall TabPanel width. Only available with tabs on addToStart. (defaults to false).")]
public virtual bool EnableTabScroll
{
get
{
object obj = this.ViewState["EnableTabScroll"];
return (obj == null) ? false : (bool)obj;
}
set
{
this.ViewState["EnableTabScroll"] = value;
if (value)
{
this.TabPosition = TabPosition.Top;
}
}
}
/// <summary>
/// Set to true to do a layout of tab items as tabs are changed.
/// </summary>
[Meta]
[ConfigOption]
[Category("7. TabPanel")]
[DefaultValue(false)]
[NotifyParentProperty(true)]
[Description("Set to true to do a layout of tab items as tabs are changed.")]
public virtual bool LayoutOnTabChange
{
get
{
object obj = this.ViewState["LayoutOnTabChange"];
return (obj == null) ? false : (bool)obj;
}
set
{
this.ViewState["LayoutOnTabChange"] = value;
}
}
/// <summary>
/// The minimum width in pixels for each tab when ResizeTabs = true (defaults to 30).
/// </summary>
[Meta]
[ConfigOption]
[Category("7. TabPanel")]
[DefaultValue(typeof(Unit), "30")]
[NotifyParentProperty(true)]
[Description("The minimum width in pixels for each tab when ResizeTabs = true (defaults to 30).")]
public virtual Unit MinTabWidth
{
get
{
return this.UnitPixelTypeCheck(ViewState["MinTabWidth"], Unit.Pixel(30), "MinTabWidth");
}
set
{
this.ViewState["MinTabWidth"] = value;
}
}
/// <summary>
/// True to render the tab strip without a background content Container image (defaults to false).
/// </summary>
[Meta]
[ConfigOption]
[Category("7. TabPanel")]
[DefaultValue(false)]
[NotifyParentProperty(true)]
[Description("True to render the tab strip without a background content Container image (defaults to false).")]
public bool Plain
{
get
{
object obj = this.ViewState["Plain"];
return (obj == null) ? false : (bool)obj;
}
set
{
this.ViewState["Plain"] = value;
}
}
/// <summary>
/// True to automatically resize each tab so that the tabs will completely fill the tab strip (defaults to false). Setting this to true may cause specific widths that might be set per tab to be overridden in order to fit them all into view (although MinTabWidth will always be honored).
/// </summary>
[Meta]
[ConfigOption]
[Category("7. TabPanel")]
[DefaultValue(false)]
[NotifyParentProperty(true)]
[Description("True to automatically resize each tab so that the tabs will completely fill the tab strip (defaults to false). Setting this to true may cause specific widths that might be set per tab to be overridden in order to fit them all into view (although MinTabWidth will always be honored).")]
public bool ResizeTabs
{
get
{
object obj = this.ViewState["ResizeTabs"];
return (obj == null) ? false : (bool)obj;
}
set
{
this.ViewState["ResizeTabs"] = value;
}
}
/// <summary>
/// The number of milliseconds that each scroll animation should last (defaults to .35). Only applies when AnimScroll = true.
/// </summary>
[Meta]
[ConfigOption]
[Category("7. TabPanel")]
[DefaultValue(0.35f)]
[NotifyParentProperty(true)]
[Description("The number of milliseconds that each scroll animation should last (defaults to .35). Only applies when AnimScroll = true.")]
public virtual float ScrollDuration
{
get
{
object obj = this.ViewState["ScrollDuration"];
return (obj == null) ? 0.35f : (float)obj;
}
set
{
this.ViewState["ScrollDuration"] = value;
}
}
/// <summary>
/// The number of pixels to scroll each time a tab scroll button is pressed (defaults to 100, or if ResizeTabs = true, the calculated tab width). Only applies when EnableTabScroll = true.
/// </summary>
[Meta]
[ConfigOption]
[Category("7. TabPanel")]
[DefaultValue(100)]
[NotifyParentProperty(true)]
[Description("The number of pixels to scroll each time a tab scroll button is pressed (defaults to 100, or if ResizeTabs = true, the calculated tab width). Only applies when EnableTabScroll = true.")]
public virtual int ScrollIncrement
{
get
{
object obj = this.ViewState["ScrollIncrement"];
return (obj == null) ? 100 : (int)obj;
}
set
{
this.ViewState["ScrollIncrement"] = value;
}
}
/// <summary>
/// Number of milliseconds between each scroll while a tab scroll button is continuously pressed (defaults to 400).
/// </summary>
[Meta]
[ConfigOption]
[Category("7. TabPanel")]
[DefaultValue(400)]
[NotifyParentProperty(true)]
[Description("Number of milliseconds between each scroll while a tab scroll button is continuously pressed (defaults to 400).")]
public virtual int ScrollRepeatInterval
{
get
{
object obj = this.ViewState["ScrollRepeatInterval"];
return (obj == null) ? 400 : (int)obj;
}
set
{
this.ViewState["ScrollRepeatInterval"] = value;
}
}
/// <summary>
///
/// </summary>
/// <param name="item"></param>
protected override void BeforeItemAdd(Component item)
{
base.BeforeItemAdd(item);
if (!(item is BoxComponentBase))
{
throw new InvalidOperationException(string.Format("Invalid type of Control ({0}). Only Components which inherit from Ext.Net.BoxComponent can be added to this ({1}) Items Collection.", item.GetType(), this.GetType()));
}
}
/// <summary>
/// The number of pixels of space to calculate into the sizing and scrolling of tabs. If you change the margin in CSS, you will need to update this value so calculations are correct with either resizeTabs or scrolling tabs. (defaults to 2)
/// </summary>
[Meta]
[ConfigOption]
[Category("7. TabPanel")]
[DefaultValue(typeof(Unit), "2")]
[NotifyParentProperty(true)]
[Description("The number of pixels of space to calculate into the sizing and scrolling of tabs. If you change the margin in CSS, you will need to update this value so calculations are correct with either resizeTabs or scrolling tabs. (defaults to 2)")]
public virtual Unit TabMargin
{
get
{
return this.UnitPixelTypeCheck(ViewState["TabMargin"], Unit.Pixel(2), "TabMargin");
}
set
{
this.ViewState["TabMargin"] = value;
}
}
/// <summary>
/// The alignment of the Tabs (defaults to 'Left'). Other option includes 'Right'. Note that tab scrolling is only supported for TabAlign='Left'. Note that when 'Right', the Tabs will be rendered in reverse order.
/// </summary>
[Meta]
[Category("7. TabPanel")]
[DefaultValue(TabAlign.Left)]
[NotifyParentProperty(true)]
[Description("The alignment of the Tabs (defaults to 'Left'). Other option includes 'Right'. Note that tab scrolling is only supported for TabAlign='Left'. Note that when 'Right', the Tabs will be rendered in reverse order.")]
public virtual TabAlign TabAlign
{
get
{
object obj = this.ViewState["TabAlign"];
return (obj == null) ? TabAlign.Left : (TabAlign)obj;
}
set
{
this.ViewState["TabAlign"] = value;
if (value == TabAlign.Right)
{
this.EnableTabScroll = false;
}
}
}
/// <summary>
///
/// </summary>
[ConfigOption("tabAlign", JsonMode.ToLower)]
[DefaultValue(TabAlign.Left)]
[Description("")]
protected virtual TabAlign TabAlignProxy
{
get
{
if (this.TabAlign == TabAlign.Right)
{
string styles = "#".ConcatWith(this.ClientID, " ul.x-tab-strip {width:100%;}#", this.ClientID, " ul.x-tab-strip li {float:right;margin:0 2px 0 0;}");
this.ResourceManager.RegisterClientStyleBlock(this.ClientID.ConcatWith("_TabAlign"), styles);
}
return this.TabAlign;
}
}
/// <summary>
/// This config option is used on child Components of ths TabPanel. A CSS class name applied to the tab strip item representing the child Component, allowing special styling to be applied.
/// </summary>
[Meta]
[ConfigOption]
[Category("7. TabPanel")]
[DefaultValue("")]
[NotifyParentProperty(true)]
[Description("This config option is used on child Components of ths TabPanel. A CSS class name applied to the tab strip item representing the child Component, allowing special styling to be applied.")]
public virtual string TabCls
{
get
{
return (string)this.ViewState["TabCls"] ?? "";
}
set
{
this.ViewState["TabCls"] = value;
}
}
/// <summary>
/// The position where the tab strip should be rendered (defaults to 'addToStart'). The only other supported value is 'Bottom'. Note that tab scrolling is only supported for position 'addToStart'.
/// </summary>
[Meta]
[ConfigOption(JsonMode.ToLower)]
[Category("7. TabPanel")]
[DefaultValue(TabPosition.Top)]
[NotifyParentProperty(true)]
[Description("The position where the tab strip should be rendered (defaults to 'addToStart'). The only other supported value is 'Bottom'. Note that tab scrolling is only supported for position 'addToStart'.")]
public virtual TabPosition TabPosition
{
get
{
object obj = this.ViewState["TabPosition"];
return (obj == null) ? TabPosition.Top : (TabPosition)obj;
}
set
{
this.ViewState["TabPosition"] = value;
if (value == TabPosition.Bottom)
{
this.EnableTabScroll = false;
}
}
}
/// <summary>
/// The initial width in pixels of each new tab (defaults to 120).
/// </summary>
[Meta]
[ConfigOption]
[Category("7. TabPanel")]
[DefaultValue(typeof(Unit), "120")]
[NotifyParentProperty(true)]
[Description("The initial width in pixels of each new tab (defaults to 120).")]
public virtual Unit TabWidth
{
get
{
return this.UnitPixelTypeCheck(ViewState["TabWidth"], Unit.Pixel(120), "TabWidth");
}
set
{
this.ViewState["TabWidth"] = value;
}
}
/// <summary>
/// For scrolling tabs, the number of pixels to increment on mouse wheel scrolling (defaults to 20).
/// </summary>
[Meta]
[ConfigOption]
[Category("7. TabPanel")]
[DefaultValue(20)]
[NotifyParentProperty(true)]
[Description("For scrolling tabs, the number of pixels to increment on mouse wheel scrolling (defaults to 20).")]
public virtual int WheelIncrement
{
get
{
object obj = this.ViewState["WheelIncrement"];
return (obj == null) ? 20 : (int)obj;
}
set
{
this.ViewState["WheelIncrement"] = value;
}
}
private MenuCollection defaultTabMenu;
/// <summary>
/// Default menu for all tabs
/// </summary>
[Meta]
[ConfigOption("defaultTabMenu", typeof(ItemCollectionJsonConverter))]
[Category("7. TabPanel")]
[NotifyParentProperty(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
[Description("Default menu for all tabs")]
public virtual MenuCollection DefaultTabMenu
{
get
{
if (this.defaultTabMenu == null)
{
this.defaultTabMenu = new MenuCollection();
this.defaultTabMenu.AfterItemAdd += this.AfterItemAdd;
this.defaultTabMenu.AfterItemRemove += this.AfterItemRemove;
}
return this.defaultTabMenu;
}
}
/* Public Methods
-----------------------------------------------------------------------------------------------*/
/// <summary>
/// Sets the specified Panel as the active Tab. This method fires the beforetabchange event which can return false to cancel the tab change.
/// </summary>
[Meta]
[Description("Sets the specified Panel as the active Tab. This method fires the beforetabchange event which can return false to cancel the tab change.")]
public virtual void Activate(BoxComponentBase item)
{
this.Activate(item.ClientID);
}
/// <summary>
/// Sets the specified Panel as the active Panel. This method fires the beforetabchange event which can return false to cancel the tab change.
/// </summary>
[Meta]
[Description("Sets the specified Panel as the active Panel. This method fires the beforetabchange event which can return false to cancel the tab change.")]
public virtual void Activate(string item)
{
this.Call("activate", item);
}
/// <summary>
/// Suspends any internal calculations or scrolling while doing a bulk operation. See endUpdate
/// </summary>
[Meta]
[Description("Suspends any internal calculations or scrolling while doing a bulk operation. See endUpdate")]
public virtual void BeginUpdate()
{
this.Call("beginUpdate");
}
/// <summary>
/// Suspends any internal calculations or scrolling while doing a bulk operation. See endUpdate
/// </summary>
[Meta]
[Description("Suspends any internal calculations or scrolling while doing a bulk operation. See endUpdate")]
public virtual void EndUpdate()
{
this.Call("endUpdate");
}
/// <summary>
/// Hides the tab strip item for the passed tab
/// </summary>
[Meta]
[Description("Hides the tab strip item for the passed tab")]
public virtual void HideTabStripItem(int item)
{
this.Call("hideTabStripItem", item);
}
/// <summary>
/// Hides the tab strip item for the passed tab
/// </summary>
[Meta]
[Description("Hides the tab strip item for the passed tab")]
public virtual void HideTabStripItem(BoxComponentBase item)
{
this.HideTabStripItem(item.ClientID);
}
/// <summary>
/// Hides the tab strip item for the passed tab
/// </summary>
[Meta]
[Description("Hides the tab strip item for the passed tab")]
public virtual void HideTabStripItem(string item)
{
this.Call("hideTabStripItem", item);
}
/// <summary>
/// True to scan the markup in this tab panel for autoTabs using the autoTabSelector
/// </summary>
[Meta]
[Description("True to scan the markup in this tab panel for autoTabs using the autoTabSelector")]
public virtual void ReadTabs(bool removeExisting)
{
this.Call("hideTabStripItem", removeExisting);
}
/// <summary>
/// Scrolls to a particular tab if tab scrolling is enabled
/// </summary>
[Meta]
[Description("Scrolls to a particular tab if tab scrolling is enabled")]
public virtual void ScrollToTab(BoxComponentBase item, bool animate)
{
this.Call("scrollToTab", new JRawValue(item.ClientID), animate);
}
/// <summary>
/// Sets the specified tab as the active tab. This method fires the beforetabchange event which can return false to cancel the tab change.
/// </summary>
[Meta]
[Description("Sets the specified tab as the active tab. This method fires the beforetabchange event which can return false to cancel the tab change.")]
public virtual void SetActiveTab(int index)
{
int correction = 0;
for (int ind = 0; ind < Math.Min(index, this.Items.Count); ind++)
{
if (!this.Items[ind].Visible)
{
correction++;
}
}
this.Call("setActiveTab", index - correction);
}
/// <summary>
/// Sets the specified tab as the active tab. This method fires the beforetabchange event which can return false to cancel the tab change.
/// </summary>
[Meta]
[Description("Sets the specified tab as the active tab. This method fires the beforetabchange event which can return false to cancel the tab change.")]
public virtual void SetActiveTab(BoxComponentBase item)
{
this.SetActiveTab(item.ClientID);
}
/// <summary>
/// Sets the specified tab as the active tab. This method fires the beforetabchange event which can return false to cancel the tab change.
/// </summary>
/// <param name="id">The id.</param>
[Meta]
[Description("Sets the specified tab as the active tab. This method fires the beforetabchange event which can return false to cancel the tab change.")]
public virtual void SetActiveTab(string id)
{
this.Call("setActiveTab", id);
}
/// <summary>
/// Unhides the tab strip item for the passed tab
/// </summary>
[Meta]
[Description("Unhides the tab strip item for the passed tab")]
public virtual void UnhideTabStripItem(int index)
{
this.Call("unhideTabStripItem", index);
}
/// <summary>
/// Unhides the tab strip item for the passed tab
/// </summary>
[Meta]
[Description("Unhides the tab strip item for the passed tab")]
public virtual void UnhideTabStripItem(BoxComponentBase item)
{
this.UnhideTabStripItem(item.ClientID);
}
/// <summary>
/// Unhides the tab strip item for the passed tab
/// </summary>
[Meta]
[Description("Unhides the tab strip item for the passed tab")]
public virtual void UnhideTabStripItem(string id)
{
this.Call("unhideTabStripItem", id);
}
/* IAutoPostBack
-----------------------------------------------------------------------------------------------*/
/// <summary>
/// Gets or sets a value indicating whether the control state automatically posts back to the server when tab changed.
/// </summary>
[Meta]
[Category("Behavior")]
[DefaultValue(false)]
[NotifyParentProperty(true)]
[Description("Gets or sets a value indicating whether the control state automatically posts back to the server when tab changed.")]
public virtual bool AutoPostBack
{
get
{
object obj = this.ViewState["AutoPostBack"];
return (obj == null) ? false : (bool)obj;
}
set
{
this.ViewState["AutoPostBack"] = value;
}
}
/// <summary>
/// Gets or sets a value indicating whether validation is performed when the control is set to validate when a postback occurs.
/// </summary>
[Meta]
[Category("Behavior")]
[DefaultValue(false)]
[NotifyParentProperty(true)]
[Description("Gets or sets a value indicating whether validation is performed when the control is set to validate when a postback occurs.")]
public virtual bool CausesValidation
{
get
{
object obj = this.ViewState["CausesValidation"];
return (obj != null && (bool)obj);
}
set
{
this.ViewState["CausesValidation"] = value;
}
}
/// <summary>
/// Gets or Sets the Controls ValidationGroup
/// </summary>
[Meta]
[Category("Behavior")]
[DefaultValue("")]
[NotifyParentProperty(true)]
[Description("Gets or Sets the Controls ValidationGroup")]
public virtual string ValidationGroup
{
get
{
return (string)this.ViewState["ValidationGroup"] ?? "";
}
set
{
this.ViewState["ValidationGroup"] = value;
}
}
}
}