|
发表于 2007-4-4 01:19:52
|
显示全部楼层
我是菜鸟,学习后改编了一下,有些问题请教
1.不知本坛如何上传文件.
所以改编的例程代码在: http://www.ednchina.com/blog/hotpower/20556/message.aspx
2.用什么办法得到TAB表中PAGE页中某个控件的ID???
以下是我改编的部分:
1.修改了XIANSHICALLBACK()
int CVICALLBACK XIANSHICALLBACK (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
int TabPageNum;
int tabpanel;
double value;
switch (event)
{
case EVENT_COMMIT:
GetCtrlVal (panelHandle, PANEL_SHURU, &value);
SetCtrlVal (panelHandle, PANEL_SHUCHU, value);
GetActiveTabPage (panelHandle, PANEL_TAB, &TabPageNum);
GetPanelHandleFromTabPage (panelHandle, PANEL_TAB, TabPageNum, &tabpanel);
switch (TabPageNum) {
case 0:
SetCtrlVal (tabpanel, TABPANEL1_SHUCHU, value);
break;
case 1:
SetCtrlVal (tabpanel, TABPANEL2_SHUCHU, value);
break;
case 2:
SetCtrlVal (tabpanel, TABPANEL3_SHUCHU, value);
break;
}
break;
}
return 0;
}
2.加TAB的回调函数TABCB()
int CVICALLBACK TABCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
int TabPageNum;
int tabpanel;
double value;
switch (event)
{
case EVENT_ACTIVE_TAB_CHANGE:
TabPageNum = eventData2;//移动后的当前页
GetPanelHandleFromTabPage (panelHandle, PANEL_TAB, TabPageNum, &tabpanel);
switch (TabPageNum) {
case 0:
GetCtrlVal (tabpanel, TABPANEL1_SHUCHU, &value);
break;
case 1:
GetCtrlVal (tabpanel, TABPANEL2_SHUCHU, &value);
break;
case 2:
GetCtrlVal (tabpanel, TABPANEL3_SHUCHU, &value);
break;
}
SetCtrlVal (panelHandle, PANEL_SHURU, 0.0);//输入清零
SetCtrlVal (panelHandle, PANEL_SHUCHU, value);//输出为移动后的当前页
break;
}
return 0;
} |
|