示例#1
0
文件: TextBox.cs 项目: shangshen/cozy
        /// <summary>
        /// Initializes a new instance of the <see cref="TextBox"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        public TextBox(string name) : base(name)
        {
            Config.Width  = Theme.ControlWidth;
            Config.Height = Theme.ControlHeight;

            this.MaxLength = int.MaxValue;

            // create the cursor to show where you are editing text
            this.TextBoxCursor = new TextBoxCursor(Name + "TextBoxCursor")
            {
                Config =
                {
                    PositionX =  0,
                    PositionY =  0,
                    Width     = 10,
                    Height    = 10
                }
            };

            // this shows the text
            this.Label = new Label(Name + "-TextItem");

            // this draws a square over the text that is being edited
            this.TextBoxSelection = new TextBoxSelectionBox(Name + "-TextBoxSelection");

            this.textBoxUtility = new TextBoxUtility
            {
                Debug = true
            };
        }
示例#2
0
文件: TextBox.cs 项目: xxy1991/cozy
        /// <summary>
        /// Initializes a new instance of the <see cref="TextBox"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        public TextBox(string name) : base(name)
        {
            Config.Width = Theme.ControlWidth;
            Config.Height = Theme.ControlHeight;

            this.MaxLength = int.MaxValue;

            // create the cursor to show where you are editing text
            this.TextBoxCursor = new TextBoxCursor(Name + "TextBoxCursor")
            {
                Config =
                {
                    PositionX = 0, 
                    PositionY = 0, 
                    Width = 10, 
                    Height = 10
                }
            };

            // this shows the text
            this.Label = new Label(Name + "-TextItem");

            // this draws a square over the text that is being edited
            this.TextBoxSelection = new TextBoxSelectionBox(Name + "-TextBoxSelection");

            this.textBoxUtility = new TextBoxUtility
                                      {
                                          Debug = true
                                      };
        }
示例#3
0
文件: TextBox.cs 项目: shangshen/cozy
 /// <summary>
 /// Delete only the selection.
 /// </summary>
 public void DeleteSelectedText()
 {
     TextBoxUtility.DeleteSelection(this);
 }
示例#4
0
文件: TextBox.cs 项目: shangshen/cozy
 /// <summary>
 /// Select everything in the text-box.
 /// Override to perform text selection
 /// </summary>
 public void DoSelectAll()
 {
     TextBoxUtility.DoSelectAll(this);
 }