原创
Labwindows/cvi8.5 使用代码创建Radio Group控件
2010-6-12 14:02
2988
6
7
分类:
软件与OS
//*********************************************************
// Labwindows/cvi8.5 使用代码创建Radio Group控件
// szlihongtao
// 2010-06-09
//*********************************************************
#include <cvirte.h>
#include <userint.h>
#include "radioGroup.h"
#include "rg2.h"
//*********************************************************
static int panelHandle;
int RadioGroup;
//*********************************************************
int main (int argc, char *argv[])
{
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
if ((panelHandle = LoadPanel (0, "rg2.uir", PANEL)) < 0)
return -1;
DisplayPanel (panelHandle);
RunUserInterface ();
DiscardPanel (panelHandle);
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 Callback_gen (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
int i;
switch (event)
{
case EVENT_COMMIT:
{
RadioGroup=Radio_Create (panelHandle, 80, 40);
Radio_AddOption (panelHandle,RadioGroup , "选项1");
Radio_AddOption (panelHandle,RadioGroup , "选项2");
Radio_AddOption (panelHandle,RadioGroup , "选项3");
Radio_AddOption (panelHandle,RadioGroup , "选项4");
Radio_SetMarkedOption (panelHandle,RadioGroup ,2);
break;
}
default:
break;
}
return 0;
}
//*********************************************************
//*********************************************************
//*********************************************************
用户1010551 2012-8-20 20:23
用户1696769 2012-8-17 16:21
用户1696769 2012-8-17 16:15
用户1571904 2012-4-19 20:35