CNiNumEdit |
Class |
Declared in: NiNumedit.h |
Overview
CNiNumEdit encapsulates the interface to a Measurement Studio ActiveX numeric edit control, which displays and facilitates the editing of numeric values.
CNiNumEdit is capable of responding to events that are generated by the control. For a list of the events that can be generated by this control and details on how to respond to the events in your program, refer to the Numeric Edit Events page.
Features
- Range checking.
- Increment and decrement buttons.
- Control or indicator display style. A control accepts input from users, while an indicator displays only its current value.
- Built-in numeric format styles, including scientific, symbolic engineering, scaling, time, and date.
- CNiNumEdit includes bindable properties. You can bind these properties to a DataSocket source or target. This allows you to read property values from and write property values to the source or target. Click here for a list of bindable properties.
Note: To specify a date/time value, you must convert your date or time value to a double. A date is implemented as a floating-point value with the integer part of the number measuring days from midnight, 30 December 1899, and the fractional part representing the time of day. The absolute value of the fractional part of the number represents the time as a fraction of a day. Thus, 1 second equals 1 / 24 hours / 60 minutes, which is 1/86400 or approximately 1.157407e-5. So, midnight, 31 December 1899, is represented by 1.0. Similarly, 6 AM, 1 January 1900, is represented by 2.25, and midnight, 29 December 1899, is -1.0. However, 6 AM, 29 December 1899, is -1.25.
Base Classes
Data Items
double | AccelInc | Specifies the amount the value increments or decrements when the user holds down the increment or decrement button longer that the time specified by the AccelTime property. | |
long | AccelTime | Specifies the number of seconds the increment or decrement button must be held down until the value is changed by the AccelInc value instead of the IncDecVal. | |
Alignments | Alignment | Specifies how the text within the control is aligned. | |
Appearances | Appearance | Specifies how the edit box portion of the control is drawn. | |
CNiColor | BackColor | Specifies the background color of the edit box portion of the control. | |
CNiColor | BackgroundColor | Specifies the background color of the increment and decrement buttons portion of the control. | |
CNiBindings | Bindings | Gets a collection of binding objects associated with the control. | |
BorderStyles | BorderStyle | Specifies the border around the edit box portion of the control. | |
CNiColor | ButtonColor | Specifies the color of the increment and decrement buttons. | |
ButtonStyles | ButtonStyle | Specifies the style of the increment and decrement buttons. | |
bool | Discrete | Specifies if the control is in discrete or continuous mode. | |
double | DiscreteBase | Specifies the interval to use in a discrete control. | |
double | DiscreteInterval | Specifies the interval to use in a discrete control. | |
bool | Enabled | Specifies if the user is able to interact with the control. | |
CNiFont | Font | Specifies the font the control uses. | |
CString | FormatString | Specifies the string that formats the value in the numeric edit control. | |
Positions | IncDecButtonPosition | Specifies the location of the increment and decrement buttons on the control. | |
bool | IncDecButtonVisible | Specifies if the increment and decrement buttons are visible. | |
double | IncDecValue | Specifies the amount the value increments or decrements when the user clicks the increment or decrement button. | |
double | Maximum | Specifies the maximum value of the control for range checking. | |
double | Minimum | Specifies the minimum value of the control for range checking. | |
NumEditModes | Mode | Specifies how the control operates. | |
bool | RangeChecking | Specifies if the control enforces the minimum and maximum. | |
CString | Text | Specifies the text that is displayed in the edit box. | |
CNiColor | TextColor | Specifies the color of the text in the control. | |
double | Value | Current value of the numeric edit control. |
Constructors
CNiNumEdit( CNiInterface::ThreadAccess option = CNiInterface::MultipleThreadsWithCaching ) |
Destructors
Functions
void | AboutBox() |
Displays the About Box for the control. | |
CNiPicture | Returns an image of the entire control. | ||
virtual BOOL | Create( LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL ) |
Creates the ActiveX control that is represented in the MFC program by this object. | |
BOOL | Create( LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CFile* pPersist = NULL, BOOL bStorage = FALSE, BSTR bstrLicKey = NULL ) |
Creates the ActiveX control that is represented in the MFC program by this object. | |
BOOL | CreateControl( LPCTSTR lpszClass, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CFile* pPersist = NULL, BOOL bStorage = FALSE, BSTR bstrLicKey = NULL ) |
Creates the ActiveX control that is represented in the MFC program by this object. | |
BOOL | CreateControl( REFCLSID clsid, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CFile* pPersist = NULL, BOOL bStorage = FALSE, BSTR bstrLicKey = NULL ) |
Creates the ActiveX control that is represented in the MFC program by this object. | |
void | ExportStyle( LPCTSTR fileName ) |
Exports the style of the control to a file. | |
static const CLSID & | GetClsid() |
Returns the globally unique identifier (GUID) of the ActiveX control to which this class connects. | |
static const IID & | GetIid() |
Returns the globally unique identifier (GUID) of the ActiveX interface to which this class connects. | |
void | ImportStyle( LPCTSTR fileName ) |
Imports a previously exported style. | |
void | SetMinMax( double minimum, double maximum ) |
Sets the Minimum and Maximum properties. | |
void | Validates the current state of the control. |