![]() |
CNiButton | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Class |
Declared in: NiButton.h |
Overview
CNiButton encapsulates the interface to the Measurement Studio ActiveX button control, which represents different Boolean displays such as on/off or true/false. Typically, you often use buttons to input or output Boolean information or initiate an action in your program.
CNiButton 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 Button Events page.
Features
- Different display styles - toggle switches, LEDs, push buttons, slides, and on/off buttons.
- Custom bitmap buttons.
- Button modes specify how the Button control responds to user input. For example, you can make a button respond only programmatically (you cannot make a button respond to user input). Or you can click the button to temporarily change its value and then release to revert the button to its original state (called a latch). Finally, you can click on the button to change its value until you click on it again.
- Built-in format styles for the labels, including scientific, symbolic, engineering scaling, time, and date.
- Animation - you can animate different parts of the control.
- Custom background images.
- CNiButton 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.
Base Classes
Data Items
![]() |
CNiColor | BackColor | Specifies the background color of the button. |
![]() |
CNiBindings | Bindings | Gets a collection of binding objects associated with the control. |
![]() |
CString | Caption | Specifies the text that appears in the button. |
![]() |
CNiColor | CaptionColor | Specifies the color of the caption for the button. |
![]() |
bool | Enabled | Specifies if the control responds to user input. |
![]() |
CNiFont | Font | Specifies the font for the caption and the two text fields in the button. |
![]() |
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. |
![]() |
KeyboardModes | KeyboardMode | Specifies how the control handles keyboard input from the user. |
![]() |
ButtonModes | Mode | Specifies how the button responds to user input. |
![]() |
CNiColor | OffColor | Specifies the color of the button in the off state. |
![]() |
CString | OffText | Specifies the text for the button in the off state. |
![]() |
CNiColor | OffTextColor | Specifies the color of the text for the button in the off state. |
![]() |
CNiColor | OnColor | Specifies the color of the button in the on state. |
![]() |
CString | OnText | Specifies the text for the button in the on state. |
![]() |
CNiColor | OnTextColor | Specifies the color of the text for the button in the on state. |
![]() |
long | ReadyState | Returns the ready state of the control. |
![]() |
ShowFocusModes | ShowFocusMode | Specifies how the control indicates it has the focus. |
![]() |
bool | Value | Specifies the current value of the button. |
![]() |
bool | Windowless | Specifies if the control has a window. |
Constructors
![]() |
CNiButton( 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. |
![]() |
CNiImage | OffImages( long imageIndex ) |
Gets the image object corresponding to the Off state of the CNiButton control that is associated with the specified part of the CNiButton control. |
![]() |
CNiImage | Gets the image object corresponding to the Off state of the CNiButton control that is associated with the specified part of the CNiButton control. | |
![]() |
CNiImage | OnImages( long imageIndex ) |
Gets the image object corresponding to the On state of the CNiButton control that is associated with the specified part of the CNiButton control. |
![]() |
CNiImage | Gets the image object corresponding to the On state of the CNiButton control that is associated with the specified part of the CNiButton control. | |
![]() |
void | Refresh() |
Forces the control to redraw. |
![]() |
void | SetBuiltinStyle( ButtonStyles style ) |
Sets many properties of the control to represent the new style specified. |
![]() |
void | Validates the current state of the control. |