//*********************************************************
// Labwindows/cvi8.5 控件-面板回调函数优先级演示程序
// szlihongtao
// 2010-06-07
// 参照 王建新的<Labwindows/cvi测试技术及工程应用> page29
// 稍有改写
//*********************************************************
#include <utility.h>
#include <cvirte.h>
#include <userint.h>
#include "callfunction.h"
//*********************************************************
static int panelHandle;
//*********************************************************
int main (int argc, char *argv[])
{
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
if ((panelHandle = LoadPanel (0, "callfunction.uir", PANEL)) < 0)
return -1;
DisplayPanel (panelHandle);
RunUserInterface ();
DiscardPanel (panelHandle);
return 0;
}
//*********************************************************
int CVICALLBACK panel (int panel, int event, void *callbackData,
int eventData1, int eventData2)
{
switch (event)
{
case EVENT_LEFT_CLICK:
SetCtrlVal (panelHandle, PANEL_NUMERIC, 100);
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;
}
//*********************************************************
int CVICALLBACK OK (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_LEFT_CLICK:
SetCtrlVal (panelHandle, PANEL_NUMERIC, 1);
Delay(1.0); // 延时1秒
break;
}
return 0;
}
//*********************************************************
//*********************************************************
//*********************************************************
文章评论(0条评论)
登录后参与讨论