最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

[LabWindows_CVI測試技術及工程應用]3.7滾動條及儀器驅(qū)動使用(學習雜記)

2020-02-23 20:44 作者:技術龍的傳人  | 我要投稿

Scroll?Bar?滾動條

儀器驅(qū)動裝載

Instrument——〉Load(路徑為\National Instruments\CVI2017\toolslib\custctrl\scroll.fp)

滾動條控件(水平?垂直)

滾動條控件函數(shù)
滾動條屬性設置表

滾動條編程

滾動條配置面板


控件屬性設置表

????具體細節(jié)參考https://www.bilibili.com/read/cv4728312操作,這里不再啰嗦,再自己摸索graph屬性的配置,相信你一定能行!!

產(chǎn)生并修改源碼

#include "scroll.h"

#include <cvirte.h>

#include <userint.h>

#include "scrollbar.h"


static int panelHandle;


void getvalue(void);


int main (int argc, char *argv[])

{

int value;

if (InitCVIRTE (0, argv, 0) == 0)

return -1; /* out of memory */

if ((panelHandle = LoadPanel (0, "scrollbar.uir", PANEL)) < 0)

return -1;

//將繪圖控件轉化成滾動條

ScrollBar_ConvertFromGraph(panelHandle, PANEL_GRAPH_VERTICAL,

? scrollbarCB, &panelHandle);

ScrollBar_GetAttribute(panelHandle, PANEL_GRAPH_VERTICAL, ATTR_SB_VALUE, &value);//獲取滾動條當前位置

SetCtrlVal(panelHandle, PANEL_NUMERIC_VERTICAL_VAL, value);//在NUMERIC_VERTIVAL_VAL中顯示滾動條的位置

GetCtrlVal(panelHandle, PANEL_NUMERIC_VERTICAL_MIN, &value);//獲取滾動條最小值

ScrollBar_SetAttribute(panelHandle, PANEL_GRAPH_VERTICAL,ATTR_SB_DOC_MIN, value);

GetCtrlVal(panelHandle, PANEL_NUMERIC_VERTICAL_MAX, &value);//獲取滾動條最大值

ScrollBar_SetAttribute(panelHandle, PANEL_GRAPH_VERTICAL,ATTR_SB_DOC_MAX, value);

GetCtrlVal(panelHandle, PANEL_NUMERIC_VERTICAL_HEIG, &value);//獲取滾動條高度

ScrollBar_SetAttribute(panelHandle, PANEL_GRAPH_VERTICAL,ATTR_SB_HEIGHT, value);

GetCtrlVal(panelHandle, PANEL_NUMERIC_VERTICAL_WID, &value);//獲取滾動條寬度

ScrollBar_SetAttribute(panelHandle, PANEL_GRAPH_VERTICAL,ATTR_SB_WIDTH, value);

GetCtrlVal(panelHandle, PANEL_COLORNUM_COLOR, &value);//獲取滾動條顏色

ScrollBar_SetAttribute(panelHandle, PANEL_GRAPH_VERTICAL,ATTR_SB_COLOR, value);

GetCtrlVal(panelHandle, PANEL_TOGGLEBUTTON_MODE, &value);//獲取滾動條顯示方式

ScrollBar_SetAttribute(panelHandle, PANEL_GRAPH_VERTICAL,ATTR_SB_VERTICAL, value);

GetCtrlVal(panelHandle, PANEL_NUMERIC_VERTICAL_VIEW, &value);//獲取滾動條每次滾動大小

ScrollBar_SetAttribute(panelHandle, PANEL_GRAPH_VERTICAL,ATTR_SB_VIEW_SIZE, value);

DisplayPanel (panelHandle);

RunUserInterface ();

DiscardPanel (panelHandle);

return 0;

}

//滾動條回調(diào)函數(shù)

int CVICALLBACK scrollbarCB (int panel, int control, int event,

void *callbackData, int eventData1, int eventData2)

{

switch (event)

{

case EVENT_SB_UP_BUTTON:

getvalue();

break;

case EVENT_SB_DOWN_BUTTON:

getvalue();

break;

case EVENT_SB_PAGE_UP:

getvalue();

break;

case EVENT_SB_PAGE_DOWN:

getvalue();

break;

case EVENT_SB_THUMB_CHANGE:

getvalue();

break;

case EVENT_SB_COMMIT:

getvalue();

break;

}

return 0;

}

//所有Numeric控件的回調(diào)函數(shù)

int CVICALLBACK adjustvalue (int panel, int control, int event,

void *callbackData, int eventData1, int eventData2)

{

int value;

switch (event)

{

case EVENT_COMMIT:

GetCtrlVal(panelHandle, control, &value);//獲取控件值

switch(control) //根據(jù)控件名設置滾動條相應屬性

{

case PANEL_NUMERIC_VERTICAL_MIN: //滾動條最小值

ScrollBar_SetAttribute(panelHandle, PANEL_GRAPH_VERTICAL,

? ATTR_SB_DOC_MIN, value);

break;

case PANEL_NUMERIC_VERTICAL_VAL: //滾動條當前位置值

ScrollBar_SetAttribute(panelHandle, PANEL_GRAPH_VERTICAL,

? ATTR_SB_VALUE, value);

break;

case PANEL_NUMERIC_VERTICAL_MAX: //滾動條最大值

ScrollBar_SetAttribute(panelHandle, PANEL_GRAPH_VERTICAL,

? ATTR_SB_DOC_MAX, value);

break;

case PANEL_NUMERIC_VERTICAL_HEIG: //滾動條高度

ScrollBar_SetAttribute(panelHandle, PANEL_GRAPH_VERTICAL,

? ATTR_SB_HEIGHT, value);

break;

case PANEL_NUMERIC_VERTICAL_WID: //滾動條寬度

ScrollBar_SetAttribute(panelHandle, PANEL_GRAPH_VERTICAL,

? ATTR_SB_WIDTH, value);

break;

case PANEL_COLORNUM_COLOR: //滾動條顏色

ScrollBar_SetAttribute(panelHandle, PANEL_GRAPH_VERTICAL,

? ATTR_SB_COLOR, value);

break;

case PANEL_TOGGLEBUTTON_MODE: //滾動條顯示方式(垂直 水平)

ScrollBar_SetAttribute(panelHandle, PANEL_GRAPH_VERTICAL,

? ATTR_SB_VERTICAL, value);

break;

case PANEL_NUMERIC_VERTICAL_VIEW: //滾動條一次滾動的大小

ScrollBar_SetAttribute(panelHandle, PANEL_GRAPH_VERTICAL,

? ATTR_SB_VIEW_SIZE, value);

break;

}

break;

}

return 0;

}


int CVICALLBACK QuitCallback (int panel, int control, int event,

? void *callbackData, int eventData1, int eventData2)

{

switch (event)

{

case EVENT_COMMIT:

QuitUserInterface (0);

break;

}

return 0;

}


void getvalue(void)

{

int value;

ScrollBar_GetAttribute(panelHandle, PANEL_GRAPH_VERTICAL, ATTR_SB_VALUE, &value);//獲取滾動條當前位置

SetCtrlVal(panelHandle, PANEL_NUMERIC_VERTICAL_VAL, value);//在NUMERIC_VERTIVAL_VAL中顯示滾動條的位置

}


[LabWindows_CVI測試技術及工程應用]3.7滾動條及儀器驅(qū)動使用(學習雜記)的評論 (共 條)

分享到微博請遵守國家法律
美姑县| 五大连池市| 城口县| 大城县| 玛纳斯县| 固安县| 策勒县| 原阳县| 秦皇岛市| 临城县| 岢岚县| 涿州市| 海口市| 伊宁县| 滁州市| 徐闻县| 台南县| 涟水县| 英山县| 英吉沙县| 海丰县| 拜城县| 陈巴尔虎旗| 武宣县| 三明市| 泉州市| 新丰县| 天峻县| 鄂伦春自治旗| 巩留县| 喀喇沁旗| 通榆县| 南昌市| 富源县| 高陵县| 轮台县| 娱乐| 沙湾县| 库尔勒市| 离岛区| 奎屯市|