moel@345: using System; moel@345: using System.Collections.Generic; moel@345: using System.Text; moel@345: using System.ComponentModel; moel@345: using System.Windows.Forms; moel@345: moel@345: namespace Aga.Controls.Tree.NodeControls moel@345: { moel@345: moel@345: public class NodeIntegerTextBox : NodeTextBox moel@345: { moel@345: private bool _allowNegativeSign = true; moel@345: [DefaultValue(true)] moel@345: public bool AllowNegativeSign moel@345: { moel@345: get { return _allowNegativeSign; } moel@345: set { _allowNegativeSign = value; } moel@345: } moel@345: moel@345: public NodeIntegerTextBox() moel@345: { moel@345: } moel@345: moel@345: protected override TextBox CreateTextBox() moel@345: { moel@345: NumericTextBox textBox = new NumericTextBox(); moel@345: textBox.AllowDecimalSeparator = false; moel@345: textBox.AllowNegativeSign = AllowNegativeSign; moel@345: return textBox; moel@345: } moel@345: moel@345: protected override void DoApplyChanges(TreeNodeAdv node, Control editor) moel@345: { moel@345: SetValue(node, (editor as NumericTextBox).IntValue); moel@345: } moel@345: } moel@345: }