f69e12001b38a3d05e2eb801e2d02965bf115195
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.CommonUI / Controls / InputField.cs
1 /*
2  * Copyright(c) 2019 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using System;
18 using Tizen.NUI.BaseComponents;
19 using System.ComponentModel;
20
21 namespace Tizen.NUI.CommonUI
22 {
23     /// <summary>
24     /// InputField is a editable input compoment
25     /// </summary>
26     /// <since_tizen> 6 </since_tizen>
27     /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
28     [EditorBrowsable(EditorBrowsableState.Never)]
29     public class InputField : Control
30     {
31         // the background image
32         private ImageView bgImage = null;
33         // the textField
34         private TextField textField = null;
35         // the attributes of the inputField
36         private InputFieldAttributes inputFieldAttrs = null;
37         // the flag indicate should relayout the textField in base class
38         private bool relayoutTextField = true;
39
40         /// <summary>
41         /// Initializes a new instance of the InputField class.
42         /// </summary>
43         /// <since_tizen> 6 </since_tizen>
44         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
45         [EditorBrowsable(EditorBrowsableState.Never)]
46         public InputField() : base()
47         {
48             Initialize();
49         }
50
51         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
52         [EditorBrowsable(EditorBrowsableState.Never)]
53         public InputField(string style) : base(style)
54         {
55             Initialize();
56         }
57
58         /// <summary>
59         /// Initializes a new instance of the InputField class.
60         /// </summary>
61         /// <param name="attributes">Create Header by attributes customized by user.</param>
62         /// <since_tizen> 6 </since_tizen>
63         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
64         [EditorBrowsable(EditorBrowsableState.Never)]
65         public InputField(InputFieldAttributes attributes) : base(attributes)
66         {
67             Initialize();
68         }
69
70         /// <summary>
71         /// Gets or sets the property for the enabled state.
72         /// </summary>
73         /// <since_tizen> 6 </since_tizen>
74         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
75         [EditorBrowsable(EditorBrowsableState.Never)]
76         public bool StateEnabled
77         {
78             get
79             {
80                 return Sensitive;
81             }
82             set
83             {
84                 Sensitive = value;
85             }
86         }
87
88         /// <summary>
89         /// Gets or sets the property for the text content.
90         /// </summary>
91         /// <since_tizen> 6 </since_tizen>
92         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
93         [EditorBrowsable(EditorBrowsableState.Never)]
94         public string Text
95         {
96             get
97             {
98                 return textField.Text;
99             }
100             set
101             {
102                 textField.Text = value;
103             }
104         }
105
106         /// <summary>
107         /// Gets or sets the property for the hint text.
108         /// </summary>
109         /// <since_tizen> 6 </since_tizen>
110         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
111         [EditorBrowsable(EditorBrowsableState.Never)]
112         public string HintText
113         {
114             get
115             {
116                 return textField.PlaceholderText;
117             }
118             set
119             {
120                 textField.PlaceholderText = value;
121             }
122         }
123
124         /// <summary>
125         /// Gets or sets the property for the color of the input text.
126         /// </summary>
127         /// <since_tizen> 6 </since_tizen>
128         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
129         [EditorBrowsable(EditorBrowsableState.Never)]
130         public Color TextColor
131         {
132             get
133             {
134                 return textField.TextColor;
135             }
136             set
137             {
138                 CreateTextFieldAttributes();
139                 if (null == inputFieldAttrs.InputBoxAttributes.TextColor)
140                 {
141                     inputFieldAttrs.InputBoxAttributes.TextColor = new ColorSelector();
142                 }
143                 inputFieldAttrs.InputBoxAttributes.TextColor.All = value;
144                 textField.TextColor = value;
145             }
146         }
147
148         /// <summary>
149         /// Gets or sets text color.
150         /// </summary>
151         /// <since_tizen> 6 </since_tizen>
152         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
153         [EditorBrowsable(EditorBrowsableState.Never)]
154         public Color HintTextColor
155         {
156             get
157             {
158                 return textField.PlaceholderTextColor;
159             }
160             set
161             {
162                 CreateTextFieldAttributes();
163                 if (null == inputFieldAttrs.InputBoxAttributes.PlaceholderTextColor)
164                 {
165                     inputFieldAttrs.InputBoxAttributes.PlaceholderTextColor = new ColorSelector();
166                 }
167                 inputFieldAttrs.InputBoxAttributes.PlaceholderTextColor.All = value;
168                 textField.PlaceholderTextColor = value;
169             }
170         }
171
172         /// <summary>
173         /// Gets or sets primary cursor color.
174         /// </summary>
175         /// <since_tizen> 6 </since_tizen>
176         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
177         [EditorBrowsable(EditorBrowsableState.Never)]
178         public Color PrimaryCursorColor
179         {
180             get
181             {
182                 return textField.PrimaryCursorColor;
183             }
184             set
185             {
186                 CreateTextFieldAttributes();
187                 if (null == inputFieldAttrs.InputBoxAttributes.PrimaryCursorColor)
188                 {
189                     inputFieldAttrs.InputBoxAttributes.PrimaryCursorColor = new ColorSelector();
190                 }
191                 inputFieldAttrs.InputBoxAttributes.PrimaryCursorColor.All = value;
192                 textField.PrimaryCursorColor = value;
193             }
194         }
195
196         /// <summary>
197         /// Gets or sets secondary cursor color.
198         /// </summary>
199         /// <since_tizen> 6 </since_tizen>
200         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
201         [EditorBrowsable(EditorBrowsableState.Never)]
202         public Color SecondaryCursorColor
203         {
204             get
205             {
206                 return textField.SecondaryCursorColor;
207             }
208             set
209             {
210                 CreateTextFieldAttributes();
211                 if (null == inputFieldAttrs.InputBoxAttributes.SecondaryCursorColor)
212                 {
213                     inputFieldAttrs.InputBoxAttributes.SecondaryCursorColor = new ColorSelector();
214                 }
215                 inputFieldAttrs.InputBoxAttributes.SecondaryCursorColor.All = value;
216                 textField.SecondaryCursorColor = value;
217             }
218         }
219
220         /// <summary>
221         /// Gets or sets font family of text.
222         /// </summary>
223         /// <since_tizen> 6 </since_tizen>
224         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
225         [EditorBrowsable(EditorBrowsableState.Never)]
226         public string FontFamily
227         {
228             get
229             {
230                 return textField.FontFamily;
231             }
232             set
233             {
234                 CreateTextFieldAttributes();
235                 inputFieldAttrs.InputBoxAttributes.FontFamily = value;
236                 textField.FontFamily = value;
237             }
238         }
239
240         /// <summary>
241         /// Gets or sets point size of text.
242         /// </summary>
243         /// <since_tizen> 6 </since_tizen>
244         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
245         [EditorBrowsable(EditorBrowsableState.Never)]
246         public float PointSize
247         {
248             get
249             {
250                 return textField.PointSize;
251             }
252             set
253             {
254                 CreateTextFieldAttributes();
255                 if (null == inputFieldAttrs.InputBoxAttributes.PointSize)
256                 {
257                     inputFieldAttrs.InputBoxAttributes.PointSize = new FloatSelector();
258                 }
259                 inputFieldAttrs.InputBoxAttributes.PointSize.All = value;
260                 textField.PointSize = value;
261             }
262         }
263
264         /// <summary>
265         /// Gets or sets enable cursor blink.
266         /// </summary>
267         /// <since_tizen> 6 </since_tizen>
268         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
269         [EditorBrowsable(EditorBrowsableState.Never)]
270         public bool EnableCursorBlink
271         {
272             get
273             {
274                 return textField.EnableCursorBlink;
275             }
276             set
277             {
278                 CreateTextFieldAttributes();
279                 inputFieldAttrs.InputBoxAttributes.EnableCursorBlink = value;
280                 textField.EnableCursorBlink = value;
281             }
282         }
283
284         /// <summary>
285         /// Gets or sets enable selection.
286         /// </summary>
287         /// <since_tizen> 6 </since_tizen>
288         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
289         [EditorBrowsable(EditorBrowsableState.Never)]
290         public bool EnableSelection
291         {
292             get
293             {
294                 return textField.EnableSelection;
295             }
296             set
297             {
298                 CreateTextFieldAttributes();
299                 inputFieldAttrs.InputBoxAttributes.EnableSelection = value;
300                 textField.EnableSelection = value;
301             }
302         }
303
304         /// <summary>
305         /// Gets or sets cursor width.
306         /// </summary>
307         /// <since_tizen> 6 </since_tizen>
308         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
309         [EditorBrowsable(EditorBrowsableState.Never)]
310         public int CursorWidth
311         {
312             get
313             {
314                 return textField.CursorWidth;
315             }
316             set
317             {
318                 CreateTextFieldAttributes();
319                 inputFieldAttrs.InputBoxAttributes.CursorWidth = value;
320                 textField.CursorWidth = value;
321             }
322         }
323
324         /// <summary>
325         /// Gets or sets if enable ellipsis.
326         /// </summary>
327         /// <since_tizen> 6 </since_tizen>
328         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
329         [EditorBrowsable(EditorBrowsableState.Never)]
330         public bool EnableEllipsis
331         {
332             get
333             {
334                 return textField.Ellipsis;
335             }
336             set
337             {
338                 CreateTextFieldAttributes();
339                 inputFieldAttrs.InputBoxAttributes.EnableEllipsis = value;
340                 textField.Ellipsis = value;
341             }
342         }
343
344         /// <summary>
345         /// Gets or sets background image's resource url of input field.
346         /// </summary>
347         /// <since_tizen> 6 </since_tizen>
348         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
349         [EditorBrowsable(EditorBrowsableState.Never)]
350         public string BackgroundImageURL
351         {
352             get
353             {
354                 return inputFieldAttrs.BackgroundImageAttributes?.ResourceURL?.All;
355             }
356             set
357             {
358                 if (value != null)
359                 {
360                     CreateBackgroundAttributes();
361                     if (inputFieldAttrs.BackgroundImageAttributes.ResourceURL == null)
362                     {
363                         inputFieldAttrs.BackgroundImageAttributes.ResourceURL = new StringSelector();
364                     }
365                     inputFieldAttrs.BackgroundImageAttributes.ResourceURL.All = value;
366                     RelayoutRequest();
367                 }
368             }
369         }
370
371         /// <summary>
372         /// Background image's border in Button.
373         /// </summary>
374         /// <since_tizen> 6 </since_tizen>
375         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
376         [EditorBrowsable(EditorBrowsableState.Never)]
377         public Rectangle BackgroundImageBorder
378         {
379             get
380             {
381                 return inputFieldAttrs.BackgroundImageAttributes?.Border?.All;
382             }
383             set
384             {
385                 if (value != null)
386                 {
387                     CreateBackgroundAttributes();
388                     if (inputFieldAttrs.BackgroundImageAttributes.Border == null)
389                     {
390                         inputFieldAttrs.BackgroundImageAttributes.Border = new RectangleSelector();
391                     }
392                     inputFieldAttrs.BackgroundImageAttributes.Border.All = value;
393                     RelayoutRequest();
394                 }
395             }
396         }
397
398         /// <summary>
399         /// Gets and Sets Space.
400         /// </summary>
401         public int Space
402         {
403             get
404             {
405                 return inputFieldAttrs.Space ?? 0;
406             }
407             set
408             {
409                 inputFieldAttrs.Space = value;
410                 RelayoutRequest();
411             }
412         }
413
414         /// <summary>
415         /// Get Input Field attribues.
416         /// </summary>
417         /// <since_tizen> 6 </since_tizen>
418         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
419         [EditorBrowsable(EditorBrowsableState.Never)]
420         protected override Attributes GetAttributes()
421         {
422             return new InputFieldAttributes();
423         }
424
425         /// <summary>
426         /// Dispose Input Field and all children on it.
427         /// </summary>
428         /// <param name="type">Dispose type.</param>
429         /// <since_tizen> 6 </since_tizen>
430         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
431         [EditorBrowsable(EditorBrowsableState.Never)]
432         protected override void Dispose(DisposeTypes type)
433         {
434             if (disposed)
435             {
436                 return;
437             }
438             if (type == DisposeTypes.Explicit)
439             {
440                 if (bgImage != null)
441                 {
442                     this.Remove(bgImage);
443                     bgImage.Dispose();
444                     bgImage = null;
445                 }
446                 if (null != textField)
447                 {
448                     textField.FocusGained -= OnTextFieldFocusGained;
449                     textField.FocusLost -= OnTextFieldFocusLost;
450                     textField.TextChanged -= OnTextFieldTextChanged;
451                     textField.KeyEvent -= OnTextFieldKeyEvent;
452                     this.Remove(textField);
453                     textField.Dispose();
454                     textField = null;
455                 }
456             }
457
458             base.Dispose(type);
459         }
460
461         /// <summary>
462         /// Update Input Field by attributes.
463         /// </summary>
464         /// <since_tizen> 6 </since_tizen>
465         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
466         [EditorBrowsable(EditorBrowsableState.Never)]
467         protected override void OnUpdate()
468         {
469             ApplyAttributes(this, inputFieldAttrs);
470             ApplyAttributes(bgImage, inputFieldAttrs.BackgroundImageAttributes);
471             ApplyAttributes(textField, inputFieldAttrs.InputBoxAttributes);
472             RelayoutComponent();
473             OnLayoutDirectionChanged();
474         }
475
476         /// <summary>
477         /// Theme change callback when theme is changed, this callback will be trigger.
478         /// </summary>
479         /// <since_tizen> 6 </since_tizen>
480         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
481         [EditorBrowsable(EditorBrowsableState.Never)]
482         protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
483         {
484             InputFieldAttributes tempAttributes = StyleManager.Instance.GetAttributes(style) as InputFieldAttributes;
485             if (tempAttributes != null)
486             {
487                 attributes = inputFieldAttrs = tempAttributes;
488                 RelayoutRequest();
489             }
490         }
491
492         /// <summary>
493         /// Theme change callback when text field focus is gained, this callback will be trigger.
494         /// </summary>
495         /// <since_tizen> 6 </since_tizen>
496         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
497         [EditorBrowsable(EditorBrowsableState.Never)]
498         protected virtual void OnTextFieldFocusGained(object source, EventArgs e)
499         {
500         }
501
502         /// <summary>
503         /// Theme change callback when text field is lost, this callback will be trigger.
504         /// </summary>
505         /// <since_tizen> 6 </since_tizen>
506         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
507         [EditorBrowsable(EditorBrowsableState.Never)]
508         protected virtual void OnTextFieldFocusLost(object source, EventArgs e)
509         {
510         }
511
512         /// <summary>
513         /// Theme change callback when text field's text is changed, this callback will be trigger.
514         /// </summary>
515         /// <since_tizen> 6 </since_tizen>
516         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
517         [EditorBrowsable(EditorBrowsableState.Never)]
518         protected virtual void OnTextFieldTextChanged(object sender, TextField.TextChangedEventArgs e)
519         {
520         }
521
522         /// <summary>
523         /// Theme change callback when text field have a key event, this callback will be trigger.
524         /// </summary>
525         /// <since_tizen> 6 </since_tizen>
526         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
527         [EditorBrowsable(EditorBrowsableState.Never)]
528         protected virtual bool OnTextFieldKeyEvent(object source, KeyEventArgs e)
529         {
530             return false;
531         }
532
533         /// <summary>
534         /// Set the text field 2D size
535         /// </summary>
536         /// <param name="w">Input Field' width.</param>
537         /// <param name="h">Input Field' height.</param>
538         /// <since_tizen> 6 </since_tizen>
539         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
540         [EditorBrowsable(EditorBrowsableState.Never)]
541         protected void SetTextFieldSize2D(int w, int h)
542         {
543             if (textField != null)
544             {
545                 textField.Size2D = new Size2D(w, h);
546             }
547         }
548
549         /// <summary>
550         /// Set the text field X pose
551         /// </summary>
552         /// <param name="x">Input Field' X.</param>
553         /// <since_tizen> 6 </since_tizen>
554         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
555         [EditorBrowsable(EditorBrowsableState.Never)]
556         protected void SetTextFieldPosX(int x)
557         {
558             if (textField != null)
559             {
560                 textField.PositionX = x;
561             }
562         }
563
564         /// <summary>
565         /// Set the text field  text color
566         /// </summary>
567         /// <param name="color">Input Field' color.</param>
568         /// <since_tizen> 6 </since_tizen>
569         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
570         [EditorBrowsable(EditorBrowsableState.Never)]
571         protected void SetTextFieldTextColor(Color color)
572         {
573             if (textField != null)
574             {
575                 textField.TextColor = color;
576             }
577         }
578
579         /// <summary>
580         /// Set the text field relayout flag
581         /// </summary>
582         /// <param name="value">relayout text field' value.</param>
583         /// <since_tizen> 6 </since_tizen>
584         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
585         [EditorBrowsable(EditorBrowsableState.Never)]
586         protected void RelayoutTextField(bool value)
587         {
588             relayoutTextField = value;
589         }
590
591         private void Initialize()
592         {
593             inputFieldAttrs = attributes as InputFieldAttributes;
594             if (null == inputFieldAttrs)
595             {
596                 throw new Exception("Fail to get the InputField attributes.");
597             }
598
599             bgImage = new ImageView();
600             if (null == bgImage)
601             {
602                 throw new Exception("Fail to create background image.");
603             }
604
605             textField = new TextField();
606             if (null == textField)
607             {
608                 throw new Exception("Fail to create text field.");
609             }
610
611             if (null != inputFieldAttrs.BackgroundImageAttributes)
612             {
613                 bgImage.WidthResizePolicy = ResizePolicyType.FillToParent;
614                 bgImage.HeightResizePolicy = ResizePolicyType.FillToParent;
615                 bgImage.ParentOrigin = Tizen.NUI.ParentOrigin.Center;
616                 bgImage.PivotPoint = Tizen.NUI.PivotPoint.Center;
617                 bgImage.PositionUsesPivotPoint = true;
618                 this.Add(bgImage);
619             }
620
621             if (null != inputFieldAttrs.InputBoxAttributes)
622             {
623                 textField.WidthResizePolicy = ResizePolicyType.Fixed;
624                 textField.HeightResizePolicy = ResizePolicyType.Fixed;
625                 textField.ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft;
626                 textField.PivotPoint = Tizen.NUI.PivotPoint.CenterLeft;
627                 textField.PositionUsesPivotPoint = true;
628                 this.Add(textField);
629
630                 textField.FocusGained += OnTextFieldFocusGained;
631                 textField.FocusLost += OnTextFieldFocusLost;
632                 textField.TextChanged += OnTextFieldTextChanged;
633                 textField.KeyEvent += OnTextFieldKeyEvent;
634             }
635         }
636
637         private void OnLayoutDirectionChanged()
638         {
639             if (inputFieldAttrs == null) return;
640             if (textField != null)
641             {
642                 if (LayoutDirection == ViewLayoutDirectionType.LTR)
643                 {
644                     if(inputFieldAttrs.InputBoxAttributes != null)
645                     {
646                         inputFieldAttrs.InputBoxAttributes.HorizontalAlignment = HorizontalAlignment.Begin;
647                         inputFieldAttrs.InputBoxAttributes.ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft;
648                         inputFieldAttrs.InputBoxAttributes.PivotPoint = Tizen.NUI.PivotPoint.CenterLeft;
649                         inputFieldAttrs.InputBoxAttributes.PositionUsesPivotPoint = true;
650                     }
651                     textField.HorizontalAlignment = HorizontalAlignment.Begin;
652                     textField.ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft;
653                     textField.PivotPoint = Tizen.NUI.PivotPoint.CenterLeft;
654                     textField.PositionUsesPivotPoint = true;
655                 }
656                 else //ViewLayoutDirectionType.RTL
657                 {
658                     if (inputFieldAttrs.InputBoxAttributes != null)
659                     {
660                         inputFieldAttrs.InputBoxAttributes.HorizontalAlignment = HorizontalAlignment.End;
661                         inputFieldAttrs.InputBoxAttributes.ParentOrigin = Tizen.NUI.ParentOrigin.CenterRight;
662                         inputFieldAttrs.InputBoxAttributes.PivotPoint = Tizen.NUI.PivotPoint.CenterRight;
663                     }
664                     textField.HorizontalAlignment = HorizontalAlignment.End;
665                     textField.ParentOrigin = Tizen.NUI.ParentOrigin.CenterRight;
666                     textField.PivotPoint = Tizen.NUI.PivotPoint.CenterRight;
667                     textField.PositionUsesPivotPoint = true;
668                 }
669             }
670         }
671
672         private void RelayoutComponent()
673         {
674             if (!relayoutTextField)
675             {
676                 return;
677             }
678             int space = inputFieldAttrs.Space ?? 0;
679
680             if (textField != null)
681             {
682                 textField.Size2D = new Size2D(this.Size2D.Width - space * 2, this.Size2D.Height);
683                 textField.PositionX = space;
684             }
685         }
686
687         private void CreateBackgroundAttributes()
688         {
689             if (null == inputFieldAttrs.BackgroundImageAttributes)
690             {
691                 inputFieldAttrs.BackgroundImageAttributes = new ImageAttributes();
692             }
693         }
694
695         private void CreateTextFieldAttributes()
696         {
697             if (null == inputFieldAttrs.InputBoxAttributes)
698             {
699                 inputFieldAttrs.InputBoxAttributes = new TextFieldAttributes();
700             }
701         }
702     }
703 }