![]() |
CNiKnob | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Class |
Declared in: NiKnob.h |
Overview
CNiKnob encapsulates the interface to the Measurement Studio ActiveX knob control, which represents different types of circular displays.
CNiKnob 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 Knob Events page.
Features
- Different display styles - dials, gauges, and meters.
- Ability to use the CNiAxis class to interface to a single axis of a knob control. This allows you to modify the appearance and behavior of the axis.
- Automatic axis labeling with numeric scales (log or inverted) and values (continuous or discrete).
- Multiple pointers, each one representing one scalar value. A pointer indicates the current value of the knob.
- Custom ticks, labels, and value pairs. Ticks are the divisions that represent increments on the knob. Labels display the value of each tick. Value pairs are names paired with a value. For example, use a value pair to add the text label "Boiling Point" to a numeric axis at the value 212 F.
- CNiKnob 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
![]() |
CNiPointer | ActivePointer | Specifies the CNiPointer object of the active pointer. |
![]() |
double | ArcEnd | Specifies the end angle (in degrees) for the CNiKnob's axis arc. |
![]() |
double | ArcStart | Specifies the start angle (in degrees) for the CNiKnob's axis arc. |
![]() |
CNiAxis | Axis | Returns the CNiAxis object for this control. |
![]() |
CNiColor | BackColor | Specifies the background color of the control. |
![]() |
CNiBindings | Bindings | Gets a collection of binding objects associated with the control. |
![]() |
CString | Caption | Specifies the text that appears in the control. |
![]() |
CNiColor | CaptionColor | Specifies the color of the caption. |
![]() |
CNiControlMetrics | ControlMetrics | Returns the ControlMetrics object for this control. |
![]() |
bool | Enabled | Specifies if the control responds to user input. |
![]() |
CNiFont | Font | Specifies the font for the caption and axis labels. |
![]() |
CNiColor | ForeColor | Specifies the color of many objects in the CNiSlide or CNiKnob control. |
![]() |
bool | ImmediateUpdates | Specifies if the control draws new data as soon as it is available or if the form refreshes the control when it draws other controls. |
![]() |
double | IncDecValue | Specifies the amount that the knob is changed when the user uses the keyboard to increment or decrement it. |
![]() |
KeyboardModes | KeyboardMode | Specifies how the control handles keyboard input from the user. |
![]() |
CNiPointers | Pointers | Gets a collection of pointer objects associated with the control. |
![]() |
long | ReadyState | Returns the ready state of the control. |
![]() |
ShowFocusModes | ShowFocusMode | Specifies how the control indicates that it has the focus. |
![]() |
double | Value | Specifies the value of the active pointer. |
![]() |
long | ValuePairIndex | Specifies the index of the value pair selected by the active pointer. |
![]() |
bool | Windowless | Specifies if the control has a window. |
Constructors
![]() |
CNiKnob( 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. |
![]() |
CNiImage | Images( long imageIndex ) |
Gets the image object associated with the specified part of the CNiKnob control. |
![]() |
CNiImage | Gets the image object associated with the specified part of the CNiKnob control. | |
![]() |
void | ImportStyle( LPCTSTR fileName ) |
Imports a previously exported style. |
![]() |
void | Refresh() |
Forces the control to redraw. |
![]() |
void | SetBuiltinStyle( KnobStyles style ) |
Sets many properties of the control to represent the new style specified. |
![]() |
void | Validates the current state of the control. |