#include
#include "asynctmr.h"
#include
#include
#include
#include "2-11.h"
static int AsynID;
int CVICALLBACK DispTimeofAsyn (int reserved, int timerId, int event, void *callbackData, int eventData1, int eventData2);
static int panelHandle;
void DispTimeMess(void);
int main (int argc, char *argv[])
{
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
if ((panelHandle = LoadPanel (0, "2-11.uir", PANEL)) < 0)
return -1;
SetCtrlAttribute (panelHandle, PANEL_TIMER, ATTR_ENABLED, 1);
// AsynID = NewAsyncTimer (1.0, -1, 1, DispTimeofAsyn, 0);
DisplayPanel (panelHandle);
RunUserInterface ();
DiscardPanel (panelHandle);
return 0;
}
int CVICALLBACK quitP (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
QuitUserInterface (0);
break;
}
return 0;
}
int CVICALLBACK DispTime (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_TIMER_TICK:
DispTimeMess();
break;
}
return 0;
}
void DispTimeMess(void)
{
char *CurrTime;
CurrTime = TimeStr ();
SetCtrlVal (panelHandle, PANEL_TEXTMSG, CurrTime);
}
int CVICALLBACK a1223 (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
int i,mm;
char str[200];
switch (event)
{
case EVENT_COMMIT:
for(i=0;i {
mm=0;
Delay(0.1);
Fmt(str,"%s InsertTextBoxLine (panelHandle, PANEL_TEXTBOX, -1, str);
SetCtrlAttribute (panelHandle, PANEL_TEXTBOX, ATTR_FIRST_VISIBLE_LINE,i);
SetActiveCtrl (panelHandle, PANEL_TEXTBOX);
}
break;
}
return 0;
}
int CVICALLBACK DispTimeofAsyn (int reserved, int timerId, int event, void *callbackData, int eventData1, int eventData2)
{
DispTimeMess();
return 0;
}