コード例 #1
0
ファイル: example_radio.cpp プロジェクト: BraveStone/xcgui
int APIENTRY _tWinMain(HINSTANCE hInstance,  HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
	XInitXCGUI();

	//创建窗口
	hWindow=XWnd_CreateWindow(0,0,400,300,L"炫彩界面库-窗口");

	hImage1=XImage_LoadFile(L"image\\button_leave.png");
	hImage2=XImage_LoadFile(L"image\\button_stay.png");
	hImage3=XImage_LoadFile(L"image\\button_down.png");
	hImage1_check=XImage_LoadFile(L"image\\button_check_leave.png");
	hImage2_check=XImage_LoadFile(L"image\\button_check_stay.png");
	hImage3_check=XImage_LoadFile(L"image\\button_check_down.png");

	HELE hRadio1=CreateRadio(10,10,L"Radio1");
	HELE hRadio2=CreateRadio(10,50,L"Radio2");
	HELE hRadio3=CreateRadio(10,90,L"Radio3");
	HELE hRadio4=CreateRadio(10,130,L"Radio4");
	HELE hRadio5=CreateRadio(10,170,L"Radio5");
	XBtn_SetCheck(hRadio1,TRUE);

///////////////////////////////////////////////////////
	HELE  hEle1=XEle_Create(130,10,200,35,hWindow);
	HELE  hEle2=XEle_Create(130,50,200,35,hWindow);
	HELE  hEle3=XEle_Create(130,90,200,35,hWindow);
	HELE  hEle4=XEle_Create(130,130,200,35,hWindow);
	HELE  hEle5=XEle_Create(130,170,200,35,hWindow);

	XRadio_SetBindEle(hRadio1,hEle1);
	XRadio_SetBindEle(hRadio2,hEle2);
	XRadio_SetBindEle(hRadio3,hEle3);
	XRadio_SetBindEle(hRadio4,hEle4);
	XRadio_SetBindEle(hRadio5,hEle5);

	XEle_SetBkColor(hEle1,RGB(249,141,235));
	XEle_SetBkColor(hEle2,RGB(105,20,193));
	XEle_SetBkColor(hEle3,RGB(0,179,138));
	XEle_SetBkColor(hEle4,RGB(213,48,68));
	XEle_SetBkColor(hEle5,RGB(42,110,187));

	XEle_ShowEle(hEle2,FALSE);
	XEle_ShowEle(hEle3,FALSE);
	XEle_ShowEle(hEle4,FALSE);
	XEle_ShowEle(hEle5,FALSE);
	XWnd_ShowWindow(hWindow,SW_SHOW);

	XRunXCGUI();

	return 0;
}
コード例 #2
0
 virtual void RecreateWidget() {
     CreateRadio();
 }