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