CNiSlide

CNi

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

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

CNiSlide encapsulates the interface to the Measurement Studio ActiveX slide control, which represents different types of linear displays.

CNiSlide 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 Slide Events page.

Features

  • Different display styles - vertical and horizontal slides, tanks, and thermometers.
  • Ability to use the CNiAxis class to interface to a single axis of a slide 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.
  • Custom ticks, labels, and value pairs. Ticks are the divisions that represent values on the slide. 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 the value 212 F.
  • Built-in format styles, including scientific, symbolic engineering, scaling, time, and date, for the labels.
  • Animation - you can animate different parts of the control. For example, you might want to animate a pointer if its value exceeds a safe limit in the application.
  • Custom images - you can add images to different parts of the control, including the background and pointers.

CNiSlide 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 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 CNiControlMetrics object associated with 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 value by which the pointer value is incremented/decremented when you click on the increment or decrement buttons use the keyboard to increment or decrement the pointer.
Public data CNiColor InteriorColor Specifies the color used to paint the interior of several types of slide styles.
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

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

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

Protected destructor

~CNiSlide()

'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 itemIndex )

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

Images( const CString& itemName )

Gets the image object associated with the specified part of the CNiSlide 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( SlideStyles style )

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

ValidateControl()

Validates the current state of the control.