⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 useit.c

📁 LabVIEW宝典 .part2
💻 C
字号:
/*-----------------------------------------------------------------*/
/* 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -