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; }
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { XInitXCGUI(); // 初始化 extern char ConfigFile[MAX_PATH]; GetAppDir(ConfigFile); strcat(ConfigFile, "/GuiDF.ini"); if (IsFileExist(ConfigFile)) LoadConfigFile(); HWINDOW hWindow = XWnd_CreateWindow(0, 0, 380, 282, L"检测打包Adobe文档字体(C)2012.05 蘭公子"); // 创建窗口 if (hWindow) { // 设置图标 HICON logo_hIcon = LoadIcon(hInstance, (LPCTSTR)LOGO_ICON); XWnd_SetIcon(hWindow, logo_hIcon, false); InitXC_Window(hWindow); // 窗口布局 XWnd_ShowWindow(hWindow, SW_SHOW); //显示窗口 XRunXCGUI(); //运行 } return 0; }
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { XInitXCGUI(); //创建窗口 HWINDOW hWindow=XWnd_CreateWindow(0,0,550,450,L"炫彩界面库-窗口-RichEdit"); XWnd_EnableDragBorder(hWindow,FALSE); XWnd_SetBkColor(hWindow,RGB(230,242,253)); int top=2; hRichEdit1=XRichEdit_Create(2,top,530,200,hWindow); //创建RichEdit 1 XEle_SetBkColor(XSView_GetView(hRichEdit1),RGB(240,240,240)); XRichEdit_SetReadOnly(hRichEdit1,TRUE); top+=200; HELE hToolBarEle=XEle_Create(2,top,530,68,hWindow); XEle_SetBkColor(hToolBarEle,RGB(230,242,253)); XEle_EnableBorder(hToolBarEle,FALSE); top+=68; hRichEdit2=XRichEdit_Create(2,top,530,110,hWindow); //创建RichEdit 2 XRichEdit_SetText(hRichEdit2,L"待发送的文本内容123456."); top+=112; HELE hBtnSend=XBtn_Create(530-60,top,60,22,L"发送",hWindow); XEle_EnableFocus(hBtnSend,FALSE); ////////默认属性/////////////////////////////// int left=5; HELE hStatic1=XStatic_Create(left,2,60,20,L"默认属性:",hToolBarEle); //默认属性 XEle_SetBkTransparent(hStatic1,TRUE); left+=62; hColor=XCHColor_Create(left,2,75,20,hToolBarEle); //颜色 XCHColor_SetColor(hColor,RGB(0,0,0)); left+=77; //字体名称 hCombox_fontName=XComboBox_Create(left,2,80,20,hToolBarEle); XComboBox_EnableEdit(hCombox_fontName,FALSE); XComboBox_AddString(hCombox_fontName,L"宋体"); XComboBox_AddString(hCombox_fontName,L"隶书"); XComboBox_AddString(hCombox_fontName,L"方正舒体"); XComboBox_AddString(hCombox_fontName,L"华文彩云"); XComboBox_SetSelectItem(hCombox_fontName,0); left+=82; hFontSize=XComboBox_Create(left,2,60,20,hToolBarEle); //字体大小 XComboBox_EnableEdit(hFontSize,FALSE); XComboBox_AddString(hFontSize,L"12"); XComboBox_AddString(hFontSize,L"14"); XComboBox_AddString(hFontSize,L"16"); XComboBox_AddString(hFontSize,L"18"); XComboBox_AddString(hFontSize,L"20"); XComboBox_SetSelectItem(hFontSize,0); left+=62; hBold=XBtn_Create(left,2,30,20,L"B",hToolBarEle); //粗体 left+=32; hItalic=XBtn_Create(left,2,30,20,L"/",hToolBarEle); //斜体 left+=32; hUnderline=XBtn_Create(left,2,30,20,L"&U",hToolBarEle); //下划线 //////////选择属性////////////////////////////////////// left=5; HELE hStatic2=XStatic_Create(left,24,60,20,L"选择属性:",hToolBarEle); XEle_SetBkTransparent(hStatic2,TRUE); left+=62; hColor2=XCHColor_Create(left,24,75,20,hToolBarEle); //颜色 left+=77; //字体名称 hCombox_fontName2=XComboBox_Create(left,24,80,20,hToolBarEle); XComboBox_EnableEdit(hCombox_fontName2,FALSE); XComboBox_AddString(hCombox_fontName2,L"宋体"); XComboBox_AddString(hCombox_fontName2,L"隶书"); XComboBox_AddString(hCombox_fontName2,L"方正舒体"); XComboBox_AddString(hCombox_fontName2,L"华文彩云"); XComboBox_SetSelectItem(hCombox_fontName2,0); left+=82; hFontSize2=XComboBox_Create(left,24,60,20,hToolBarEle); //字体大小 XComboBox_EnableEdit(hFontSize2,FALSE); XComboBox_AddString(hFontSize2,L"12"); XComboBox_AddString(hFontSize2,L"14"); XComboBox_AddString(hFontSize2,L"16"); XComboBox_AddString(hFontSize2,L"18"); XComboBox_AddString(hFontSize2,L"20"); XComboBox_SetSelectItem(hFontSize2,0); left+=62; hBold2=XBtn_Create(left,24,30,20,L"B",hToolBarEle); //粗体 left+=32; hItalic2=XBtn_Create(left,24,30,20,L"/",hToolBarEle); //斜体 left+=32; hUnderline2=XBtn_Create(left,24,30,20,L"&U",hToolBarEle); //下划线 /////////////////////////////////////////////////// left=5; HELE hBtnImage=XBtn_Create(left,46,60,20,L"图片",hToolBarEle); //插入图片 left+=64; HELE hBtnGif=XBtn_Create(left,46,60,20,L"GIF",hToolBarEle);//插入GIF XEle_RegisterEvent(hCombox_fontName,XE_COMBOBOX_SELECT,OnEventComboBoxSelect_default_fontName); XEle_RegisterEvent(hColor,XE_EDIT_CHANGE,OnEventEditChange_default_color); XEle_RegisterEvent(hFontSize,XE_COMBOBOX_SELECT,OnEventComboBoxSelect_default_fontSize); XEle_RegisterEvent(hBold,XE_BNCLICK,OnEventBtnClick_default_bold); XEle_RegisterEvent(hItalic,XE_BNCLICK,OnEventBtnClick_default_italic); XEle_RegisterEvent(hUnderline,XE_BNCLICK,OnEventBtnClick_default_underline); XEle_RegisterEvent(hCombox_fontName2,XE_COMBOBOX_SELECT,OnEventComboBoxSelect_select_fontName); XEle_RegisterEvent(hColor2,XE_EDIT_CHANGE,OnEventEditChange_select_color); XEle_RegisterEvent(hFontSize2,XE_COMBOBOX_SELECT,OnEventComboBoxSelect_select_fontSize); XEle_RegisterEvent(hBold2,XE_BNCLICK,OnEventBtnClick_select_bold); XEle_RegisterEvent(hItalic2,XE_BNCLICK,OnEventBtnClick_select_italic); XEle_RegisterEvent(hUnderline2,XE_BNCLICK,OnEventBtnClick_select_underline); XEle_RegisterEvent(hBtnImage,XE_BNCLICK,OnEventBtnClick_Image); XEle_RegisterEvent(hBtnGif,XE_BNCLICK,OnEventBtnClick_GIF); XEle_RegisterEvent(hBtnSend,XE_BNCLICK,OnEventBtnClick_Send); XWnd_ShowWindow(hWindow,SW_SHOW); XRunXCGUI(); return 0; }
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { XInitXCGUI(); //创建窗口 HWINDOW hWindow=XWnd_CreateWindow(0,0,550,450,L"炫彩界面库-窗口"); XWnd_EnableDragBorder(hWindow,FALSE); HELE hButton=XBtn_Create(10,10,60,22,L"插入元素",hWindow); XEle_EnableEle(hButton,FALSE); XEle_RegisterEvent(hButton,XE_BNCLICK,MyEventBtnClick); HELE hButton2=XBtn_Create(80,10,60,22,L"插入图片",hWindow); XEle_EnableFocus(hButton2,FALSE); XEle_RegisterEvent(hButton2,XE_BNCLICK,MyEventBtnClick2); HELE hButton3=XBtn_Create(150,10,60,22,L"插入GIF",hWindow); XEle_EnableFocus(hButton3,FALSE); XEle_RegisterEvent(hButton3,XE_BNCLICK,MyEventBtnClick3); HELE hButton4=XBtn_Create(220,10,60,22,L"插入GIF",hWindow); XEle_EnableFocus(hButton4,FALSE); XEle_RegisterEvent(hButton4,XE_BNCLICK,MyEventBtnClick4); HELE hButton5=XBtn_Create(290,10,60,22,L"插入GIF",hWindow); XEle_EnableFocus(hButton5,FALSE); XEle_RegisterEvent(hButton5,XE_BNCLICK,MyEventBtnClick5); hRichEdit=XRichEdit_Create(10,40,390,350,hWindow); //创建RichEdit HELE hView=XSView_GetView(hRichEdit); XEle_SetBkColor(hView,RGB(220,220,220)); //创建字体 XC_InitFont(&Font1,L"宋体",12); XC_InitFont(&Font2,L"宋体",16); XC_InitFont(&Font3,L"宋体",20); XC_InitFont(&Font4,L"宋体",28); XC_InitFont(&Font5,L"宋体",16,TRUE); XC_InitFont(&Font6,L"宋体",16,FALSE,TRUE); XC_InitFont(&Font7,L"宋体",16,FALSE,FALSE,TRUE); XStatic_Create(420,30,100,20,L"设置字体:",hWindow); HELE hButtonFont1=XBtn_Create(420,50,100,22,L"字体 12号",hWindow); //12 HELE hButtonFont2=XBtn_Create(420,80,100,22,L"字体 16号",hWindow); //16 HELE hButtonFont3=XBtn_Create(420,110,100,22,L"字体 20号",hWindow); //20 HELE hButtonFont4=XBtn_Create(420,140,100,22,L"字体 28号",hWindow); //28 HELE hButtonFont5=XBtn_Create(420,170,100,22,L"粗体 16号",hWindow);//粗体16号 HELE hButtonFont6=XBtn_Create(420,200,100,22,L"斜体 16号",hWindow);//斜体16号 HELE hButtonFont7=XBtn_Create(420,230,100,22,L"下划线 16号",hWindow);//下弧线16号 XEle_EnableFocus(hButtonFont1,FALSE); XEle_EnableFocus(hButtonFont2,FALSE); XEle_EnableFocus(hButtonFont3,FALSE); XEle_EnableFocus(hButtonFont4,FALSE); XEle_EnableFocus(hButtonFont5,FALSE); XEle_EnableFocus(hButtonFont6,FALSE); XEle_EnableFocus(hButtonFont7,FALSE); XEle_RegisterEvent(hButtonFont1,XE_BNCLICK,MyEventBtnClick6); XEle_RegisterEvent(hButtonFont2,XE_BNCLICK,MyEventBtnClick7); XEle_RegisterEvent(hButtonFont3,XE_BNCLICK,MyEventBtnClick8); XEle_RegisterEvent(hButtonFont4,XE_BNCLICK,MyEventBtnClick9); XEle_RegisterEvent(hButtonFont5,XE_BNCLICK,MyEventBtnClick10); XEle_RegisterEvent(hButtonFont6,XE_BNCLICK,MyEventBtnClick11); XEle_RegisterEvent(hButtonFont7,XE_BNCLICK,MyEventBtnClick12); XStatic_Create(420,265,100,20,L"设置颜色:",hWindow); hColor=XCHColor_Create(420,290,100,22,hWindow); XEle_RegisterEvent(hColor,XE_EDIT_CHANGE,OnEventEditChange); HELE hButtonTest=XBtn_Create(420,320,100,20,L"测试",hWindow); XEle_EnableFocus(hButtonTest,FALSE); XEle_RegisterEvent(hButtonTest,XE_BNCLICK,MyEventBtnClick1_Test); //XRichEdit_SetText(hRichEdit,L"123456"); XWnd_ShowWindow(hWindow,SW_SHOW); XRunXCGUI(); return 0; }