public TextBox( String name, String caption, Real width, Real height )
{
lines = new List<string>();
element = OverlayManager.Instance.Elements.CreateElementFromTemplate( "SdkTrays/TextBox", "BorderPanel", name );
element.Width = width;
element.Height = height;
OverlayElementContainer container = (OverlayElementContainer)element;
this.textArea = (TextArea)container.Children[ Name + "/TextBoxText" ];
this.captionBar = (BorderPanel)container.Children[ Name + "/TextBoxCaptionBar" ];
this.captionBar.Width = width - 4;
this.captionTextArea = (TextArea)this.captionBar.Children[ this.captionBar.Name + "/TextBoxCaption" ];
this.Caption = caption;
this.scrollTrack = (BorderPanel)container.Children[ Name + "/TextBoxScrollTrack" ];
this.scrollHandle = (Panel)this.scrollTrack.Children[ this.scrollTrack.Name + "/TextBoxScrollHandle" ];
this.scrollHandle.Hide();
this.isDragging = false;
this.scrollPercentage = 0;
this.startingLine = 0;
this.padding = 15;
this.text = "";
this.RefitContents();
}