External/Aga.Controls/Tree/NodeControls/NodeIntegerTextBox.cs
changeset 345 0c551e8818e0
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/External/Aga.Controls/Tree/NodeControls/NodeIntegerTextBox.cs	Sun May 27 15:16:19 2012 +0000
     1.3 @@ -0,0 +1,37 @@
     1.4 +using System;
     1.5 +using System.Collections.Generic;
     1.6 +using System.Text;
     1.7 +using System.ComponentModel;
     1.8 +using System.Windows.Forms;
     1.9 +
    1.10 +namespace Aga.Controls.Tree.NodeControls
    1.11 +{
    1.12 +
    1.13 +	public class NodeIntegerTextBox : NodeTextBox
    1.14 +	{
    1.15 +		private bool _allowNegativeSign = true;
    1.16 +		[DefaultValue(true)]
    1.17 +		public bool AllowNegativeSign
    1.18 +		{
    1.19 +			get { return _allowNegativeSign; }
    1.20 +			set { _allowNegativeSign = value; }
    1.21 +		}
    1.22 +
    1.23 +		public NodeIntegerTextBox()
    1.24 +		{
    1.25 +		}
    1.26 +
    1.27 +		protected override TextBox CreateTextBox()
    1.28 +		{
    1.29 +			NumericTextBox textBox = new NumericTextBox();
    1.30 +			textBox.AllowDecimalSeparator = false;
    1.31 +			textBox.AllowNegativeSign = AllowNegativeSign;
    1.32 +			return textBox;
    1.33 +		}
    1.34 +
    1.35 +		protected override void DoApplyChanges(TreeNodeAdv node, Control editor)
    1.36 +		{
    1.37 +			SetValue(node, (editor as NumericTextBox).IntValue);
    1.38 +		}
    1.39 +	}
    1.40 +}