TextCtrl for numeric input.
More...
Public Member Functions | |
| NumericInput (Window parent, int id, int defaultValue, System.Drawing.Point pos, System.Drawing.Size size) | |
| NumericInput (Window parent, int id, int defaultValue) | |
| void | OnChar (object sender, Event e) |
Properties | |
| int | MaxValue [get, set] |
| The maximum value. | |
| new string | Value [get, set] |
| Sets and gets the text value. | |
TextCtrl for numeric input.
This class is a prerequisite for the NumericGridEditor which is an example for a C# implementation of a GridCellEditor. It only allows digits as input. Optionally, a MaxValue() may be specified for the input values. Refer to remarks on BigGridFrame.
Definition at line 1361 of file Grid.cs.
| wx.SampleGrid.NumericInput.NumericInput | ( | Window | parent, | |
| int | id, | |||
| int | defaultValue | |||
| ) |
| wx.SampleGrid.NumericInput.NumericInput | ( | Window | parent, | |
| int | id, | |||
| int | defaultValue, | |||
| System.Drawing.Point | pos, | |||
| System.Drawing.Size | size | |||
| ) |
| void wx.SampleGrid.NumericInput.OnChar | ( | object | sender, | |
| Event | e | |||
| ) |
Definition at line 1381 of file Grid.cs.
01382 { 01383 if (e is KeyEvent) 01384 { 01385 KeyEvent kev=(KeyEvent) e; 01386 if (kev.KeyCode >= '0' && kev.KeyCode <= '9') 01387 { 01388 if ((int)InsertionPoint >= Value.Length) 01389 { 01390 Value=Value+new string((char) kev.KeyCode, 1); 01391 } 01392 else 01393 { 01394 Value=Value.Substring(0, (int)InsertionPoint) 01395 +new string((char) kev.KeyCode, 1) 01396 +Value.Substring((int)InsertionPoint); 01397 } 01398 } 01399 else if (kev.KeyCode==(int)KeyCode.WXK_DELETE 01400 || kev.KeyCode==(int)KeyCode.WXK_BACK 01401 || kev.KeyCode >= 256) 01402 { 01403 kev.Skip(); 01404 } 01405 01406 } 01407 }
int wx.SampleGrid.NumericInput.MaxValue [get, set] |
The maximum value.
This might be null in case of unconstrained input.
Definition at line 1379 of file Grid.cs.
Referenced by wx.SampleGrid.NumericGridEditor.Create().
new string wx.SampleGrid.NumericInput.Value [get, set] |
Sets and gets the text value.
On setting the value: A value containing non-digits will be ignored. If minimum or maximum is exceeded, either a text representation of the minimum is set or the last digits of the value will be selected.
Definition at line 1415 of file Grid.cs.
Referenced by wx.SampleGrid.NumericGridEditor.BeginEdit(), wx.SampleGrid.NumericGridEditor.EndEdit(), and wx.SampleGrid.NumericGridEditor.StartingKey().
(c) 2003-2010 the wx.NET project