Exemple #1
0
    void Init()
    {
        m_hWindow = XWnd_Create(0, 0, 350, 200, L"ìŲʽçÃæ¿â´°¿Ú",NULL, xc_window_style_default);
        XBtn_SetType(XBtn_Create(10, 5, 60, 20,L"close",m_hWindow),button_type_close);
		
        m_hGif1=XShapeGif_Create(20,50,100,100,m_hWindow);
        XShapeGif_SetImage(m_hGif1,XImage_LoadFile(L"image\\gif.gif"));
		
        m_hGif2=XShapeGif_Create(150,50,100,100,m_hWindow);
        XShapeGif_SetImage(m_hGif2,XImage_LoadFile(L"image\\gif.gif"));
		
        m_hButton = XBtn_Create(260, 50, 60, 20,L"Ïú»Ù", m_hWindow);
        XEle_RegEventCPP(m_hButton,XE_BNCLICK,&CMyWindowGif::OnBtnClick);
        XWnd_ShowWindow(m_hWindow,SW_SHOW);
    }
BOOL CALLBACK MyEventBtnClick2(HELE hEle,HELE hEventEle) //按钮点击事件
{
	int row=0;
	int column=0;
	XRichEdit_GetCurrentPos(hRichEdit,&row,&column);
	HIMAGE hImage=XImage_LoadFile(L"image\\touxiang.jpg");
	XRichEdit_InsertImage(hRichEdit,hImage,L"image\\touxiang.jpg",row,column);
	XEle_RedrawEle(hRichEdit);
	return TRUE;
}
//插入图片
BOOL CALLBACK OnEventBtnClick_Image(HELE hEle,HELE hEventEle)
{
	if(hEle != hEventEle) return FALSE;

	int row=0;
	int column=0;
	XRichEdit_GetCurrentPos(hRichEdit2,&row,&column);
	HIMAGE hImage=XImage_LoadFile(L"image\\tou.jpg");
	XRichEdit_InsertImage(hRichEdit2,hImage,L"image\\tou.jpg",row,column);
	XEle_RedrawEle(hRichEdit2);
	return TRUE;
}
Exemple #4
0
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
    XInitXCGUI();
	
    HWINDOW hWindow = XWnd_Create(0, 0, 300, 200, L"ìŲʽçÃæ¿â´°¿Ú",NULL, xc_window_style_default);
    XBtn_SetType(XBtn_Create(10, 5, 60, 20,L"close",hWindow),button_type_close);
	
    my_image_info  info;
    info.hImage1=XImage_LoadFile(L"1.png");
    info.hImage2=XImage_LoadFile(L"2.png");
    info.hImage3=XImage_LoadFile(L"3.png");
    info.hImage4=XImage_LoadFile(L"4.png");
    info.hImage5=XImage_LoadFile(L"5.png");
    info.hImage6=XImage_LoadFile(L"6.png");
	
    int left=20;
    int top=50;
    CreateButton(left,top,&info,hWindow); left+=50;
    CreateButton(left,top,&info,hWindow); left+=50;
    CreateButton(left,top,&info,hWindow); left+=50;
    CreateButton(left,top,&info,hWindow); left+=50;
    CreateButton(left,top,&info,hWindow); left+=50;
	
    left=20; top=100;
    CreateButtonLoop(left,top,&info,hWindow); left+=50;
    CreateButtonLoop(left,top,&info,hWindow); left+=50;
    CreateButtonLoop(left,top,&info,hWindow); left+=50;
    CreateButtonLoop(left,top,&info,hWindow); left+=50;
    CreateButtonLoop(left,top,&info,hWindow); left+=50;
	
    XWnd_ShowWindow(hWindow,SW_SHOW);
    XRunXCGUI();
    XExitXCGUI();
    return 0;
}
Exemple #5
0
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;
}