int ScrollBar_Create (int panelHandle, int controlTop, int controlLeft, int vertical, CtrlCallbackPtr callbackFunction, void *callbackData);
This function creates a new scroll bar and returns a scroll bar ID used to specify the control in subsequent function calls.
Input | |||||||||||||||||||||||||||||||||||
Name | Type | Description | |||||||||||||||||||||||||||||||||
panelHandle | integer | The specifier for a particular panel that is currently in memory. This handle will have been returned by the LoadPanel, NewPanel, or DuplicatePanel function. |
|||||||||||||||||||||||||||||||||
controlTop | integer | The vertical coordinate at which the upper left corner of the control (not including labels) is placed. The coordinate must be an integer value from The origin (0,0) is at the upper-left corner of the panel (directly below the title bar) before the panel is scrolled. |
|||||||||||||||||||||||||||||||||
controlLeft | integer | The horizontal coordinate at which the upper left corner of the control (not including labels) is placed. The coordinate must be an integer value from The origin (0,0) is at the upper-left corner of the panel (directly below the title bar) before the panel is scrolled. |
|||||||||||||||||||||||||||||||||
vertical | integer | This value of this control specifies the orientation of the scroll:
|
|||||||||||||||||||||||||||||||||
callbackFunction | CtrlCallbackPtr | The name of the user function that processes the scroll bar callback. This event function (type CtrlCallbackPtr) takes the form: int CVICALLBACK ScrollBarCallback(int panel, int scrollBar, int event, void *callbackData, int eventData1, int eventData2); The event function is passed the Panel Handle and Scroll Bar ID of the scroll bar generating the event. The Event type as well as Callback data defined by the user is passed to the event function as well. The new value of the scroll bar is also passed in the eventData1 parameter, and a pointer to this value is passed in the eventData2 parameter. The following is a list of each scroll bar action, the fired scroll bar event and a description of changes to the scroll bar.
Holding down the mouse button or the key causes any of the first four events to continue firing. The eventData2 parameter can be cast to an integer pointer (int *) and then used to modify the scroll bar value in the callback function. The scroll bar thumb is moved to the modified location immediately after exiting the callback. |
|||||||||||||||||||||||||||||||||
callbackData | void * | A pointer to user-defined data passed to the event function. |
Name | Type | Description | |||||||||||||||
scrollBarID | integer | Returns the ID used to specify this scroll bar in subsequent function calls. Negative values indicate that an error occurred.
|