forked from extnet/Ext.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbstractComponent.cs
More file actions
3642 lines (3341 loc) · 139 KB
/
AbstractComponent.cs
File metadata and controls
3642 lines (3341 loc) · 139 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
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/********
* @version : 2.1.1 - Ext.NET Pro License
* @author : Ext.NET, Inc. http://www.ext.net/
* @date : 2012-12-10
* @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.ComponentModel;
using System.Drawing;
using System.Globalization;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net.Utilities;
namespace Ext.Net
{
/// <summary>
/// Base class for all Ext components. All subclasses of AbstractComponent may participate in the automated Ext component lifecycle of creation, rendering and destruction which is provided by the Container class. Components may be added to a Container through the items config option at the time the Container is created, or they may be added dynamically via the add method.
/// The AbstractComponent base class has built-in support for basic hide/show and enable/disable and size control behavior.
/// All Components are registered with the Ext.ComponentMgr on construction so that they can be referenced at any time via Ext.getCmp, passing the id.
/// All user-developed visual widgets that are required to participate in automated lifecycle and size management should subclass AbstractComponent.
/// See the Creating new UI controls tutorial for details on how and to either extend or augment ExtJs base classes to create custom Components.
/// Every component has a specific xtype, which is its Ext-specific type name, along with methods for checking the xtype like getXType and isXType.
/// </summary>
[Meta]
public abstract partial class AbstractComponent : Observable, IComponent, IContent, ILazy, IStateful, IAnimate, IFloating
{
/// <summary>
///
/// </summary>
[Meta]
[ConfigOption]
[DefaultValue(null)]
[Description("")]
public virtual string TagHiddenName
{
get
{
return this.State.Get<string>("TagHiddenName", null);
}
set
{
this.State.Set("TagHiddenName", value);
}
}
private bool tagRequestChecked;
/// <summary>
/// An Object that contains data about the Component. The default is a null reference.
/// </summary>
[Meta]
[DirectEventUpdate(MethodName = "SetTag")]
[ConfigOption(JsonMode.Serialize)]
[DefaultValue(null)]
[NotifyParentProperty(true)]
[Description("An Object that contains data about the Component. The default is a null reference.")]
public virtual object Tag
{
get
{
if (HttpContext.Current != null && !this.tagRequestChecked)
{
this.tagRequestChecked = true;
string tagFromRequest = HttpContext.Current.Request.Form[this.TagHiddenName ?? this.UniqueID + "_tag"];
if (tagFromRequest != null)
{
tagFromRequest = HttpContext.Current.Server.HtmlDecode(tagFromRequest);
this.SuspendScripting();
this.State.Set("Tag", JSON.Deserialize<object>(tagFromRequest));
//this.State.Set("Tag", tagFromRequest);
this.ResumeScripting();
}
}
return this.State.Get<object>("Tag", null);
}
set
{
this.State.Set("Tag", value);
}
}
/// <summary>
///
/// </summary>
[Meta]
[DefaultValue(null)]
public virtual string TagString
{
get
{
return this.Tag != null ? this.Tag.ToString() : null;
}
set
{
this.Tag = value;
}
}
/// <summary>
///
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public virtual T ConvertTag<T>()
{
if (this.Tag == null)
{
return default(T);
}
if (typeof(T).IsAssignableFrom(typeof(string)))
{
return (T)((object)this.Tag.ToString());
}
if (typeof(T).IsAssignableFrom(typeof(object)))
{
return (T)this.Tag;
}
if (this.Tag is string)
{
return JSON.Deserialize<T>(this.Tag.ToString());
}
return (T)this.Tag;
}
#region Config Options
/// <summary>
/// Specify the id of the element, a DOM element or an existing Element corresponding to a DIV that is already present in the document that specifies some structural markup for this component.
/// </summary>
[Meta]
[Category("3. AbstractComponent")]
[DefaultValue("")]
[Description("Specify the id of the element, a DOM element or an existing Element corresponding to a DIV that is already present in the document that specifies some structural markup for this component.")]
public virtual string ApplyTo
{
get
{
return this.State.Get<string>("ApplyTo", "");
}
set
{
this.State.Set("ApplyTo", value);
}
}
/// <summary>
///
/// </summary>
/// <param name="tag"></param>
protected void SetTag(object tag)
{
this.Call("setTag", tag);
}
/// <summary>
///
/// </summary>
[ConfigOption("applyTo")]
[DefaultValue("")]
protected virtual string ApplyToProxy
{
get
{
return this.IsLazy ? "" : this.ApplyTo;
}
}
private DomObject autoEl;
/// <summary>
/// A tag name or DomHelper spec used to create the Element which will encapsulate this AbstractComponent.
/// You do not normally need to specify this. For the base classes Ext.AbstractComponent and Ext.container.Container,
/// this defaults to 'div'. The more complex Sencha classes use a more complex DOM structure specified by their own renderTpls.
/// This is intended to allow the developer to create application-specific utility Components encapsulated by different DOM elements.
/// </summary>
[Meta]
[ConfigOption(JsonMode.Object)]
[Category("3. AbstractComponent")]
[NotifyParentProperty(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
[Description("A tag name or DomHelper spec used to create the Element which will encapsulate this AbstractComponent.")]
public virtual DomObject AutoEl
{
get
{
return this.autoEl ?? (this.autoEl = new DomObject());
}
}
/// <summary>
/// This config is intended mainly for floating Components which may or may not be shown. Instead of using renderTo in the configuration, and rendering upon construction, this allows a Component to render itself upon first show.
/// Specify as true to have this AbstractComponent render to the document body upon first show.
/// Specify as an element, or the ID of an element to have this AbstractComponent render to a specific element upon first show.
/// This defaults to true for the Window class.
/// </summary>
[Meta]
[ConfigOption]
[Category("3. AbstractComponent")]
[DefaultValue(false)]
[Description("This config is intended mainly for floating Components which may or may not be shown. Instead of using renderTo in the configuration, and rendering upon construction, this allows a AbstractComponent to render itself upon first show. Default is false.")]
public virtual bool AutoRender
{
get
{
return this.State.Get<bool>("AutoRender", false);
}
set
{
this.State.Set("AutoRender", value);
}
}
/// <summary>
/// This config is intended mainly for floating Components which may or may not be shown. Instead of using renderTo in the configuration, and rendering upon construction, this allows a AbstractComponent to render itself upon first show.
/// Specify as true to have this AbstractComponent render to the document body upon first show.
/// Specify as an element, or the ID of an element to have this AbstractComponent render to a specific element upon first show.
/// This defaults to true for the Window class.
/// </summary>
[Meta]
[ConfigOption(JsonMode.Raw)]
[Category("3. AbstractComponent")]
[DefaultValue(null)]
[Description("This config is intended mainly for floating Components which may or may not be shown. Instead of using renderTo in the configuration, and rendering upon construction, this allows a AbstractComponent to render itself upon first show. Default is false.")]
public virtual string AutoRenderElement
{
get
{
return this.State.Get<string>("AutoRenderElement", null);
}
set
{
this.State.Set("AutoRenderElement", value);
}
}
/// <summary>
/// True to automatically show the component upon creation. This config option may only be used for floating components or components that use autoRender. Defaults to false.
/// </summary>
[Meta]
[ConfigOption]
[Category("3. AbstractComponent")]
[DefaultValue(false)]
[Description("True to automatically show the component upon creation. This config option may only be used for floating components or components that use autoRender. Defaults to false.")]
public virtual bool AutoShow
{
get
{
return this.State.Get<bool>("AutoShow", false);
}
set
{
this.State.Set("AutoShow", value);
}
}
/// <summary>
/// The base CSS class to apply to this components's element. This will also be prepended to elements within this component like Panel's body will get a class x-panel-body. This means that if you create a subclass of Panel, and you want it to get all the Panels styling for the element and the body, you leave the baseCls x-panel and use componentCls to add specific styling for this component.
/// </summary>
[Meta]
[ConfigOption]
[Category("3. AbstractComponent")]
[DefaultValue("")]
[Description("The base CSS class to apply to this components's element. This will also be prepended to elements within this component like Panel's body will get a class x-panel-body. This means that if you create a subclass of Panel, and you want it to get all the Panels styling for the element and the body, you leave the baseCls x-panel and use componentCls to add specific styling for this component.")]
public virtual string BaseCls
{
get
{
return this.State.Get<string>("BaseCls", "");
}
set
{
this.State.Set("BaseCls", value);
}
}
///<summary>
/// Specifies the border for this component. The border can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.
///</summary>
[Meta]
[ConfigOption]
[DirectEventUpdate(MethodName="SetBorder")]
[Category("3. AbstractComponent")]
[DefaultValue(null)]
[Description("Specifies the border for this component. The border can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.")]
public virtual bool? Border
{
get
{
return this.State.Get<bool?>("Border", null);
}
set
{
this.State.Set("Border", value);
}
}
///<summary>
/// Specifies the border for this component. The border can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.
///</summary>
[Meta]
[ConfigOption("border")]
[DirectEventUpdate(MethodName = "SetBorderSpec")]
[Category("3. AbstractComponent")]
[DefaultValue(null)]
[Description("Specifies the border for this component. The border can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.")]
public virtual string BorderSpec
{
get
{
return this.State.Get<string>("BorderSpec", null);
}
set
{
this.State.Set("BorderSpec", value);
}
}
ChildElementCollection childEls;
/// <summary>
/// An array describing the child elements of the Component. Each member of the array is an object with these properties:
///
/// name - The property name on the Component for the child element.
/// itemId - The id to combine with the Component's id that is the id of the child element.
/// id - The id of the child element.
///
/// If the array member is a string, it is equivalent to { name: m, itemId: m }.
///
/// For example, a Component which renders a title and body text:
///
/// Ext.create('Ext.Component', {
/// renderTo: Ext.getBody(),
/// renderTpl: [
/// '<h1 id="{id}-title">{title}</h1>',
/// '<p>{msg}</p>',
/// ],
/// renderData: {
/// title: "Error",
/// msg: "Something went wrong"
/// },
/// childEls: ["title"],
/// listeners: {
/// afterrender: function(cmp){
/// // After rendering the component will have a title property
/// cmp.title.setStyle({color: "red"});
/// }
/// }
/// });
///
/// A more flexible, but somewhat slower, approach is RenderSelectors.
/// </summary>
[Meta]
[ConfigOption("childEls", JsonMode.AlwaysArray)]
[Category("3. AbstractComponent")]
[NotifyParentProperty(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
[Description("An array describing the child elements of the Component.")]
public virtual ChildElementCollection ChildEls
{
get
{
return this.childEls ?? (this.childEls = new ChildElementCollection());
}
}
/// <summary>
/// An optional extra CSS class that will be added to this component's Element (defaults to ''). This can be useful for adding customized styles to the component or any of its children using standard CSS rules.
/// </summary>
[Meta]
[DirectEventUpdate(MethodName = "AddCls")]
[ConfigOption]
[Category("3. AbstractComponent")]
[DefaultValue("")]
[Description("An optional extra CSS class that will be added to this component's Element (defaults to ''). This can be useful for adding customized styles to the component or any of its children using standard CSS rules.")]
public virtual string Cls
{
get
{
return this.State.Get<string>("Cls", "");
}
set
{
this.State.Set("Cls", value);
}
}
/// <summary>
/// CSS Class to be added to a components root level element to give distinction to it via styling.
/// </summary>
[Meta]
[ConfigOption]
[Category("3. AbstractComponent")]
[DefaultValue("")]
[Description("CSS Class to be added to a components root level element to give distinction to it via styling.")]
public virtual string ComponentCls
{
get
{
return this.State.Get<string>("ComponentCls", "");
}
set
{
this.State.Set("ComponentCls", value);
}
}
/// <summary>
/// The sizing and positioning of a AbstractComponent's internal Elements is the responsibility of the AbstractComponent's layout manager which sizes a AbstractComponent's internal structure in response to the AbstractComponent being sized.
/// Generally, developers will not use this configuration as all provided Components which need their internal elements sizing (Such as input fields) come with their own componentLayout managers.
/// The default layout manager will be used on instances of the base Ext.AbstractComponent class which simply sizes the AbstractComponent's encapsulating element to the height and width specified in the setSize method.
/// </summary>
[Meta]
[ConfigOption]
[Category("3. AbstractComponent")]
[DefaultValue("")]
[Description("")]
public virtual string ComponentLayout
{
get
{
return this.State.Get<string>("ComponentLayout", "");
}
set
{
this.State.Set("ComponentLayout", value);
}
}
/// <summary>
/// An optional extra CSS class that will be added to this component's container. This can be useful for adding customized styles to the container or any of its children using standard CSS rules.
/// </summary>
[Meta]
[ConfigOption]
[DirectEventUpdate(MethodName = "AddContainerCls")]
[Category("3. AbstractComponent")]
[DefaultValue("")]
[Description("An optional extra CSS class that will be added to this component's container. This can be useful for adding customized styles to the container or any of its children using standard CSS rules.")]
public virtual string CtCls
{
get
{
return this.State.Get<string>("CtCls", "");
}
set
{
this.State.Set("CtCls", value);
}
}
/// <summary>
/// The initial set of data to apply to the tpl to update the content area of the AbstractComponent.
/// </summary>
[Meta]
[ConfigOption(JsonMode.Serialize)]
[DirectEventUpdate(MethodName="Update")]
[Category("3. AbstractComponent")]
[DefaultValue(null)]
[Description("The initial set of data to apply to the tpl to update the content area of the AbstractComponent.")]
public virtual object Data
{
get
{
return this.State.Get<object>("Data", null);
}
set
{
this.State.Set("Data", value);
}
}
/// <summary>
/// Render this component disabled (default is false).
/// </summary>
[Meta]
[ConfigOption]
[DirectEventUpdate(MethodName = "SetDisabled")]
[Category("3. AbstractComponent")]
[DefaultValue(false)]
[Description("Render this component disabled (default is false).")]
public virtual bool Disabled
{
get
{
return this.State.Get<bool>("Disabled", false);
}
set
{
this.State.Set("Disabled", value);
}
}
/// <summary>
/// CSS class to add when the AbstractComponent is disabled. Defaults to 'x-item-disabled'.
/// </summary>
[Meta]
[ConfigOption]
[Category("3. AbstractComponent")]
[DefaultValue("x-item-disabled")]
[Description("CSS class to add when the AbstractComponent is disabled. Defaults to 'x-item-disabled'.")]
public virtual string DisabledCls
{
get
{
return this.State.Get<string>("DisabledCls", "x-item-disabled");
}
set
{
this.State.Set("DisabledCls", value);
}
}
/// <summary>
/// The dock position of this component in its parent panel
/// </summary>
[Meta]
[ConfigOption(JsonMode.ToLower)]
[DirectEventUpdate(MethodName = "SetDocked")]
[Category("3. AbstractComponent")]
[DefaultValue(Dock.None)]
[Description("The dock position of this component in its parent panel")]
public virtual Dock Dock
{
get
{
return this.State.Get<Dock>("Dock", Dock.None);
}
set
{
this.State.Set("Dock", value);
}
}
/// <summary>
/// Specify as true to float the AbstractComponent outside of the document flow using CSS absolute positioning.
/// Components such as Windows and Menus are floating by default.
/// Floating Components that are programatically rendered will register themselves with the global ZIndexManager
/// Floating Components as child items of a Container
/// A floating AbstractComponent may be used as a child item of a Container. This just allows the floating AbstractComponent to seek a ZIndexManager by examining the ownerCt chain.
/// When configured as floating, Components acquire, at render time, a ZIndexManager which manages a stack of related floating Components. The ZIndexManager brings a single floating AbstractComponent to the top of its stack when the AbstractComponent's toFront method is called.
/// The ZIndexManager is found by traversing up the ownerCt chain to find an ancestor which itself is floating. This is so that descendant floating Components of floating Containers (Such as a ComboBox dropdown within a Window) can have its zIndex managed relative to any siblings, but always above that floating ancestor Container.
/// If no floating ancestor is found, a floating AbstractComponent registers itself with the default ZIndexManager.
/// Floating components do not participate in the Container's layout. Because of this, they are not rendered until you explicitly show them.
/// After rendering, the ownerCt reference is deleted, and the floatParent property is set to the found floating ancestor Container. If no floating ancestor Container was found the floatParent property will not be set.
/// </summary>
[Meta]
[Category("3. Component")]
[DefaultValue(false)]
[Description("Specify as true to float the AbstractComponent outside of the document flow using CSS absolute positioning.")]
public virtual bool Floating
{
get
{
return this.State.Get<bool>("Floating", false);
}
set
{
this.State.Set("Floating", value);
}
}
/// <summary>
///
/// </summary>
[DefaultValue(false)]
[ConfigOption("floating")]
protected virtual bool FloatingProxy
{
get
{
return this.Floating && (this.FloatingConfig == null || this.FloatingConfig.Serialize(false) == Const.EmptyObject) ? true : false;
}
}
private LayerConfig floatingCfg;
/// <summary>
/// Additional floating configs
/// </summary>
[Meta]
[Category("3. Component")]
[DefaultValue(null)]
[Description("Additional floating configs")]
[PersistenceMode(PersistenceMode.InnerProperty)]
public virtual LayerConfig FloatingConfig
{
get
{
return this.floatingCfg;
}
set
{
this.floatingCfg = value;
}
}
/// <summary>
///
/// </summary>
[DefaultValue("")]
[ConfigOption("floating", JsonMode.Raw)]
protected virtual string FloatingConfigProxy
{
get
{
if (this.FloatingConfig == null)
{
return Const.EmptyString;
}
string cfg = this.FloatingConfig.Serialize(false);
return cfg != Const.EmptyObject ? cfg : Const.EmptyString;
}
}
/// <summary>
/// Specify as true to have the AbstractComponent inject framing elements within the AbstractComponent at render time to provide a graphical rounded frame around the AbstractComponent content.
/// This is only necessary when running on outdated, or non standard-compliant browsers such as Microsoft's Internet Explorer prior to version 9 which do not support rounded corners natively.
/// The extra space taken up by this framing is available from the read only property frameSize.
/// </summary>
[Meta]
[ConfigOption]
[Category("3. AbstractComponent")]
[DefaultValue(false)]
[Description("Specify as true to have the AbstractComponent inject framing elements within the AbstractComponent at render time to provide a graphical rounded frame around the AbstractComponent content.")]
public virtual bool Frame
{
get
{
return this.State.Get<bool>("Frame", false);
}
set
{
this.State.Set("Frame", value);
}
}
/// <summary>
/// Any component within the FormPanel can be configured with formBind: true. This will cause that component to be automatically disabled when the form is invalid, and enabled when it is valid. This is most commonly used for Button components to prevent submitting the form in an invalid state, but can be used on any component type.
/// </summary>
[Meta]
[ConfigOption]
[Category("3. AbstractComponent")]
[DefaultValue(false)]
[Description("Any component within the FormPanel can be configured with formBind: true. This will cause that component to be automatically disabled when the form is invalid, and enabled when it is valid. This is most commonly used for Button components to prevent submitting the form in an invalid state, but can be used on any component type.")]
public virtual bool FormBind
{
get
{
return this.State.Get<bool>("FormBind", false);
}
set
{
this.State.Set("FormBind", value);
}
}
/// <summary>
/// The height of this component in pixels.
/// </summary>
[Meta]
[ConfigOption]
[DirectEventUpdate(MethodName = "SetHeight")]
[Category("3. AbstractComponent")]
[DefaultValue(typeof(Unit), "")]
[Description("The height of this component in pixels.")]
public override Unit Height
{
get
{
return this.UnitPixelTypeCheck(this.State["Height"], Unit.Empty, "Height");
}
set
{
this.State.Set("Height", value);
}
}
/// <summary>
/// Render this component hidden (default is false). If true, the hide method will be called internally.
/// </summary>
[Meta]
[ConfigOption]
[DirectEventUpdate(Script = "{0}.setVisible(!{1});")]
[Category("3. AbstractComponent")]
[DefaultValue(false)]
[Description("Render this component hidden (default is false). If true, the hide method will be called internally.")]
public virtual bool Hidden
{
get
{
return this.State.Get<bool>("Hidden", false);
}
set
{
this.State.Set("Hidden", value);
}
}
/// <summary>
/// A String which specifies how this AbstractComponent's encapsulating DOM element will be hidden. Values may be
/// 'display' : The AbstractComponent will be hidden using the display: none style.
/// 'visibility' : The AbstractComponent will be hidden using the visibility: hidden style.
/// 'offsets' : The AbstractComponent will be hidden by absolutely positioning it out of the visible area of the document. This is useful when a hidden AbstractComponent must maintain measurable dimensions. Hiding using display results in a AbstractComponent having zero dimensions.
/// Defaults to 'display'.
/// </summary>
[Meta]
[ConfigOption(JsonMode.ToLower)]
[Category("3. AbstractComponent")]
[DefaultValue(HideMode.Display)]
[NotifyParentProperty(true)]
[Description("A String which specifies how this AbstractComponent's encapsulating DOM element will be hidden.")]
public virtual HideMode HideMode
{
get
{
return this.State.Get<HideMode>("HideMode", HideMode.Display);
}
set
{
this.State.Set("HideMode", value);
}
}
/// <summary>
/// An HTML fragment, or a DomHelper specification to use as the layout element content (defaults to ''). The HTML content is added after the component is rendered, so the document will not contain this HTML at the time the render event is fired. This content is inserted into the body before any configured contentEl is appended.
/// </summary>
[Meta]
[DirectEventUpdate(MethodName = "Update")]
[ConfigOption("html")]
[Category("3. AbstractComponent")]
[DefaultValue("")]
[NotifyParentProperty(true)]
[Description("An HTML fragment, or a DomHelper specification to use as the layout element content (defaults to '')")]
public virtual string Html
{
get
{
return this.State.Get<string>("Html", "");
}
set
{
this.State.Set("Html", value);
}
}
private ComponentLoader loader;
/// <summary>
/// A configuration object or an instance of a Ext.ComponentLoader to load remote content for this AbstractComponent.
/// </summary>
[Meta]
[DefaultValue(null)]
[ConfigOption("loader", typeof(LazyControlJsonConverter))]
[Category("3. AbstractComponent")]
[NotifyParentProperty(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
[Description("A configuration object or an instance of a Ext.ComponentLoader to load remote content for this AbstractComponent.")]
public virtual ComponentLoader Loader
{
get
{
return this.loader;
}
set
{
if (this.loader != null)
{
this.Controls.Remove(this.loader);
this.LazyItems.Remove(this.loader);
}
this.loader = value;
if (this.loader != null)
{
this.loader.EnableViewState = this.DesignMode;
this.Controls.Add(this.loader);
this.LazyItems.Add(this.loader);
}
}
}
///<summary>
/// Specifies the margin for this component. The margin can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.
///</summary>
[Meta]
[ConfigOption]
[Category("3. AbstractComponent")]
[DefaultValue(null)]
[Description("Specifies the margin for this component. The margin can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.")]
public virtual int? Margin
{
get
{
return this.State.Get<int?>("Margin", null);
}
set
{
this.State.Set("Margin", value);
}
}
///<summary>
/// Specifies the margin for this component. The margin can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.
///</summary>
[Meta]
[ConfigOption("margin")]
[Category("3. AbstractComponent")]
[DefaultValue(null)]
[Description("Specifies the margin for this component. The margin can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.")]
public virtual string MarginSpec
{
get
{
return this.State.Get<string>("MarginSpec", null);
}
set
{
this.State.Set("MarginSpec", value);
}
}
/// <summary>
/// This is an internal flag that you use when creating custom components.
/// By default this is set to true which means that every component gets a mask when its disabled.
/// Components like FieldContainer, FieldSet, Field, Button, Tab override this property to false since they want to implement custom disable logic.
/// </summary>
[Meta]
[ConfigOption]
[Category("3. AbstractComponent")]
[DefaultValue(true)]
[Description("This is an internal flag that you use when creating custom components. By default this is set to true which means that every component gets a mask when its disabled. Components like FieldContainer, FieldSet, Field, Button, Tab override this property to false since they want to implement custom disable logic.")]
public virtual bool MaskOnDisable
{
get
{
return this.State.Get<bool>("MaskOnDisable", true);
}
set
{
this.State.Set("MaskOnDisable", value);
}
}
///<summary>
/// The maximum value in pixels which this AbstractComponent will set its height to.
/// Warning: This will override any size management applied by layout managers.
///</summary>
[Meta]
[ConfigOption]
[Category("3. AbstractComponent")]
[DefaultValue(null)]
[Description("The maximum value in pixels which this AbstractComponent will set its height to.")]
public virtual int? MaxHeight
{
get
{
return this.State.Get<int?>("MaxHeight", null);
}
set
{
this.State.Set("MaxHeight", value);
}
}
///<summary>
/// The maximum value in pixels which this AbstractComponent will set its width to.
/// Warning: This will override any size management applied by layout managers.
///</summary>
[Meta]
[ConfigOption]
[Category("3. AbstractComponent")]
[DefaultValue(null)]
[Description("The maximum value in pixels which this AbstractComponent will set its width to.")]
public virtual int? MaxWidth
{
get
{
return this.State.Get<int?>("MaxWidth", null);
}
set
{
this.State.Set("MaxWidth", value);
}
}
///<summary>
/// The minimum value in pixels which this AbstractComponent will set its height to.
/// Warning: This will override any size management applied by layout managers.
///</summary>
[Meta]
[ConfigOption]
[Category("3. AbstractComponent")]
[DefaultValue(null)]
[Description("The minimum value in pixels which this AbstractComponent will set its height to.")]
public virtual int? MinHeight
{
get
{
return this.State.Get<int?>("MinHeight", null);
}
set
{
this.State.Set("MinHeight", value);
}
}
///<summary>
/// The minimum value in pixels which this AbstractComponent will set its width to.
/// Warning: This will override any size management applied by layout managers.
///</summary>
[Meta]
[ConfigOption]
[Category("3. AbstractComponent")]
[DefaultValue(null)]
[Description("The minimum value in pixels which this AbstractComponent will set its width to.")]
public virtual int? MinWidth
{
get
{
return this.State.Get<int?>("MinWidth", null);
}
set
{
this.State.Set("MinWidth", value);
}
}
/// <summary>
/// An optional extra CSS class that will be added to this component's Element when the mouse moves over the Element, and removed when the mouse moves out. (defaults to ''). This can be useful for adding customized 'active' or 'hover' styles to the component or any of its children using standard CSS rules.
/// </summary>
[Meta]
[ConfigOption]
[Category("3. AbstractComponent")]
[DefaultValue("")]
[NotifyParentProperty(true)]
[Description("An optional extra CSS class that will be added to this component's Element when the mouse moves over the Element, and removed when the mouse moves out. (defaults to ''). This can be useful for adding customized 'active' or 'hover' styles to the component or any of its children using standard CSS rules.")]
public virtual string OverCls
{
get
{
return this.State.Get<string>("OverCls", "");
}
set
{
this.State.Set("OverCls", value);
}
}
///<summary>
/// Specifies the padding for this component. The padding can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.
///</summary>
[Meta]
[ConfigOption]
[Category("3. AbstractComponent")]
[DefaultValue(null)]
[Description("Specifies the padding for this component. The padding can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.")]
public virtual int? Padding
{
get
{
return this.State.Get<int?>("Padding", null);
}
set
{
this.State.Set("Padding", value);
}
}
///<summary>
/// Specifies the padding for this component. The padding can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.
///</summary>
[Meta]
[ConfigOption("padding")]
[Category("3. AbstractComponent")]
[DefaultValue("")]
[Description("Specifies the padding for this component. The padding can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example: '10 5 3 10'.")]
public virtual string PaddingSpec
{
get
{
return this.State.Get<string>("PaddingSpec", "");
}
set
{
this.State.Set("PaddingSpec", value);
}
}