useit.c
来自「LabVIEW宝典 .part2」· C语言 代码 · 共 46 行
C
46 行
/*-----------------------------------------------------------------*/
/* This program will use a DLL to display text onto the CVI Panel. */
/*-----------------------------------------------------------------*/
/* Note: If any other object covers the DLL displayed text, the */
/* text will have to be redrawn. */
/*-----------------------------------------------------------------*/
#include <cvirte.h> /* Needed if linking in external compiler; harmless otherwise */
#include <userint.h>
#include "cvitext.h"
int main (int argc, char *argv[])
{
int panel, plot, quit, eventPanel, eventControl, clear;
int window;
if (InitCVIRTE (0, argv, 0) == 0) /* Needed if linking in external compiler; harmless otherwise */
return -1; /* out of memory */
/* Create UI interface */
panel = NewPanel (0, "Panel", 50, 50, 200, 600);
SetPanelAttribute(panel, ATTR_CONFORM_TO_SYSTEM, 1);
plot = NewCtrl (panel, CTRL_SQUARE_COMMAND_BUTTON, "__Draw Text", 150, 50);
quit = NewCtrl (panel, CTRL_SQUARE_COMMAND_BUTTON, "__Quit", 150, 150);
DisplayPanel (panel);
/* Get the system window handle of the CVI panel */
GetPanelAttribute(panel, ATTR_SYSTEM_WINDOW_HANDLE, &window);
/* Loop and wait for the next event */
while (1) {
GetUserEvent (1, &eventPanel, &eventControl);
if (eventControl == quit)
break;
else if (eventControl == plot) {
/* Call the DLL function to draw text */
DrawTextInWindow (window, 10, 10, "LabWindows/CVI", "Arial", 60, 1, 1, 3, 16777215);
}
}
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?