CNiKnob

CNi

Class CNiKnob Base ClassesData ItemsConstructorsDestructorsFunctionsGo to hierarchy chart    Prev page: ValidateControlNext page: ActivePointer    
Class Declared in:
NiKnob.h

'Overview' icon -- Shortcut to top of page. 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.

Hierarchy Chart Hierarchy Chart

'Base Classes' icon -- Shortcut to top of page. Base Classes

'Data Items' icon -- Shortcut to top of page. Data Items

Public data CNiPointer ActivePointer Specifies the CNiPointer object of the active pointer.
Public data double ArcEnd Specifies the end angle (in degrees) for the CNiKnob's axis arc.
Public data double ArcStart Specifies the start angle (in degrees) for the CNiKnob's axis arc.
Public data CNiAxis Axis Returns the CNiAxis object for this control.
Public data CNiColor BackColor Specifies the background color of the control.
Public data CNiBindings Bindings Gets a collection of binding objects associated with the control.
Public data CString Caption Specifies the text that appears in the control.
Public data CNiColor CaptionColor Specifies the color of the caption.
Public data CNiControlMetrics ControlMetrics Returns the ControlMetrics object for this control.
Public data bool Enabled Specifies if the control responds to user input.
Public data CNiFont Font Specifies the font for the caption and axis labels.
Public data CNiColor ForeColor Specifies the color of many objects in the CNiSlide or CNiKnob control.
Public data 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.
Public data double IncDecValue Specifies the amount that the knob is changed when the user uses the keyboard to increment or decrement it.
Public data KeyboardModes KeyboardMode Specifies how the control handles keyboard input from the user.
Public data CNiPointers Pointers Gets a collection of pointer objects associated with the control.
Public data long ReadyState Returns the ready state of the control.
Public data ShowFocusModes ShowFocusMode Specifies how the control indicates that it has the focus.
Public data double Value Specifies the value of the active pointer.
Public data long ValuePairIndex Specifies the index of the value pair selected by the active pointer.
Public data bool Windowless Specifies if the control has a window.

'Constructors' icon -- Shortcut to top of page. Constructors

Protected constructor

CNiKnob( CNiInterface::ThreadAccess option = CNiInterface::MultipleThreadsWithCaching )

'Destructors' icon -- Shortcut to top of page. Destructors

Protected destructor

~CNiKnob()

'Functions' icon -- Shortcut to top of page. Functions

Public function void

AboutBox()

Displays the About Box for the control.
Public function CNiPicture

ControlImage()

Returns an image of the entire control.
Protected function 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.
Protected function 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.
Protected function 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.
Protected function 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.
Public function void

ExportStyle( LPCTSTR fileName )

Exports the style of the control to a file.
Protected function static const CLSID &

GetClsid()

Returns the globally unique identifier (GUID) of the ActiveX control to which this class connects.
Protected function static const IID &

GetIid()

Returns the globally unique identifier (GUID) of the ActiveX interface to which this class connects.
Public function CNiImage

Images( long imageIndex )

Gets the image object associated with the specified part of the CNiKnob control.
Public function CNiImage

Images( const CString& imageName )

Gets the image object associated with the specified part of the CNiKnob control.
Public function void

ImportStyle( LPCTSTR fileName )

Imports a previously exported style.
Public function void

Refresh()

Forces the control to redraw.
Public function void

SetBuiltinStyle( KnobStyles style )

Sets many properties of the control to represent the new style specified.
Protected function void

ValidateControl()

Validates the current state of the control.