Edit 聊天气泡示例

聊天气泡示例

//包含炫彩界面库文件
#pragma comment(lib, "XCGUI.lib")
#include "xcgui.h"
class CEditRecv
{
public:
HELE m_hEdit;
USHORT m_style1;
HIMAGE m_hImageAvatar;
HIMAGE m_hImageAvatar2;
HIMAGE m_hImageBubble;
HIMAGE m_hImageBubble2;
void OnExit()
{
if (XC_IsHXCGUI(m_hImageAvatar, XC_IMAGE_FRAME)) XImage_Release(m_hImageAvatar);
if (XC_IsHXCGUI(m_hImageAvatar2, XC_IMAGE_FRAME)) XImage_Release(m_hImageAvatar2);
if (XC_IsHXCGUI(m_hImageBubble, XC_IMAGE_FRAME)) XImage_Release(m_hImageBubble);
if (XC_IsHXCGUI(m_hImageBubble2, XC_IMAGE_FRAME)) XImage_Release(m_hImageBubble2);
}
void Init(HWINDOW hWindow, int left, int top, int width, int height)
{
m_hEdit = XEdit_CreateEx(left, top, width, height, edit_type_chat, hWindow);
XEle_EnableKeyTab(m_hEdit, TRUE);
XEdit_SetRowHeight(m_hEdit, 20);
//XEle_SetPadding(m_hEdit,50, 0, 60, 0);
HFONTX hFont1 = XFont_Create2(L"微软雅黑", 9);
m_style1 = XEdit_AddStyle(m_hEdit, hFont1, COLORREF_MAKE(0, 0, 255,255),TRUE);
m_hImageAvatar = XImage_LoadFile(L"image\\avatar.png"); //头像
m_hImageAvatar2 = XImage_LoadFile(L"image\\logo.png"); //头像
m_hImageBubble = XImage_LoadFileAdaptive(L"image\\bubble.png",20,15,20,15); //气泡
m_hImageBubble2 = XImage_LoadFileAdaptive(L"image\\bubble2.png", 20, 16, 20, 10); //气泡2
// XEdit_AddText(m_hEdit, L"\n");
// XChat_AddChatBegin(m_hEdit, 0, 0, chat_flag_center);
// XEdit_AddText(m_hEdit, L"系统消息:123456\n");
// XChat_AddChatEnd(m_hEdit);
}
void Recv(edit_data_copy_ *data)
{
{
XEdit_AddText(m_hEdit, L"\n");
XEdit_AddText(m_hEdit, L"系统消息:123456\n");
XEdit_AddChatEnd(m_hEdit);
}
static int send_left = 1;
if(send_left%2)
XEdit_AddChatBegin(m_hEdit, m_hImageAvatar, m_hImageBubble, chat_flag_left | chat_flag_next_row_bubble);
else
XEdit_AddChatBegin(m_hEdit, m_hImageAvatar2, m_hImageBubble2, chat_flag_right | chat_flag_next_row_bubble);
send_left++;
XEdit_AddTextEx(m_hEdit, L"【实习】梦飞(154460336) 2019/1/23 20:30:12\n", m_style1);
int iCurRow = XEdit_GetCurRow(m_hEdit);
XEdit_SetRowHeightEx(m_hEdit, iCurRow-1, 40);
AddData(data);
XEdit_AddChatEnd(m_hEdit);
XEdit_AddText(m_hEdit, L"\n");
XEdit_AutoScroll(m_hEdit);
XEle_Redraw(m_hEdit);
}
void AddData(edit_data_copy_ *data)
{
//读取样式表
vector<USHORT> styleTable(data->nStyleCount, edit_style_no);
for (int i = 0; i < data->nStyleCount; i++)
{
HIMAGE hObj = data->pStyle[i].hFont_image_obj;
if (XC_IMAGE_FRAME == ty)
{
//HIMAGE hSrc=XImage_GetImageSrc(hObj);
//const wchar_t* pFile = XImgSrc_GetFile(hSrc);
int iStyle = XEdit_AddStyle(m_hEdit, hObj, 0, FALSE);
styleTable[i] = iStyle;
} else if (XC_FONT == ty)
{
COLORREF color = data->pStyle[i].color;
int iStyle = XEdit_AddStyle(m_hEdit, (HFONTX)hObj, color, data->pStyle[i].bColor);
styleTable[i] = iStyle;
} else if (XC_ELE == ty)
{
{
HELE hBtn = XBtn_Create(0, 0, XEle_GetWidth((HELE)hObj), XEle_GetHeight((HELE)hObj), XBtn_GetText((HELE)hObj), m_hEdit);
int iStyle = XEdit_AddStyle(m_hEdit, hBtn, 0, FALSE);
styleTable[i] = iStyle;
}
} else if (XC_SHAPE == ty)
{
{
HIMAGE hImageGif = XShapeGif_GetImage(hObj);
//HIMAGE hSrc=XImage_GetImageSrc(hImageGif);
//const wchar_t* pFile = XImgSrc_GetFile(hSrc);
{
HXCGUI hGif = XShapeGif_Create(0, 0, XImage_GetWidth(hImageGif), XImage_GetHeight(hImageGif), m_hEdit);
XShapeGif_SetImage(hGif, hImageGif);
int iStyle = XEdit_AddStyle(m_hEdit, hGif, 0, FALSE);
styleTable[i] = iStyle;
}
}
}
}
XEdit_AddData(m_hEdit, data, styleTable.data(), data->nStyleCount);
}
};
class CEditSend
{
public:
HWINDOW m_hWindow;
HELE m_hEdit;
HELE m_hBtnSend;
HELE m_hBtnImg1;
HELE m_hBtnImg2;
HELE m_hBtnImg3;
HELE m_hButton;
HELE m_hBtnFont1;
HELE m_hBtnFont2;
HELE m_hBtnFont3;
HELE m_hBtnColor1;
HELE m_hBtnColor2;
HELE m_hBtnColor3;
int m_iCurStyle;
CEditRecv* m_pRecv;
void Init(HWINDOW hWindow, int left, int top, int width, int height)
{
m_hWindow = hWindow;
InitBar(left, top);
m_hBtnSend = XBtn_Create(left + width + 10, top, 80, 30, L"发 送", hWindow);
XEle_EnableFocus(m_hBtnSend, FALSE);
m_hEdit = XEdit_CreateEx(left, top, width, height, edit_type_richedit, hWindow);
XEle_EnableKeyTab(m_hEdit, TRUE);
XEdit_EnableAutoWrap(m_hEdit, FALSE);
XEdit_AddText(m_hEdit, L"ABC");
HIMAGE hImage1 = XImage_LoadFile(L"image\\123.png");
HIMAGE hImage2 = XImage_LoadFile(L"image\\logo.png");
XEdit_AddObject(m_hEdit, hImage1);
XEdit_AddObject(m_hEdit, hImage2);
HELE hBtn = XBtn_Create(0, 0, 60, 24, L"cc", m_hEdit);
XEdit_AddObject(m_hEdit, hBtn);
HIMAGE hImageGif=XImage_LoadFile(L"image\\gif.gif");
if (hImageGif)
{
HXCGUI hGif = XShapeGif_Create(0, 0, XImage_GetWidth(hImageGif), XImage_GetHeight(hImageGif), m_hEdit);
XShapeGif_SetImage(hGif, hImageGif);
XEdit_AddObject(m_hEdit, hGif);
}
int iStyle = XEdit_AddStyleEx(m_hEdit, L"微软雅黑",16, 0, COLORREF_MAKE(200, 0, 0,255), TRUE);
XEdit_AddTextEx(m_hEdit, L"123", iStyle);
iStyle = XEdit_AddStyleEx(m_hEdit, L"微软雅黑", 24, 0, COLORREF_MAKE(0, 200, 0,255), TRUE);
XEdit_AddTextEx(m_hEdit, L"123", iStyle);
iStyle = XEdit_AddStyleEx(m_hEdit, L"微软雅黑", 36, 0, COLORREF_MAKE(0, 0, 200,255), TRUE);
XEdit_AddTextEx(m_hEdit, L"123", iStyle);
XEle_RegEventCPP(m_hBtnSend, XE_BNCLICK, &CEditSend::OnBtnClick_Send);
XEle_RegEventCPP(m_hBtnImg1, XE_BNCLICK, &CEditSend::OnBtnClick_img1);
XEle_RegEventCPP(m_hBtnImg2, XE_BNCLICK, &CEditSend::OnBtnClick_img2);
XEle_RegEventCPP(m_hBtnImg3, XE_BNCLICK, &CEditSend::OnBtnClick_img3);
XEle_RegEventCPP(m_hButton, XE_BNCLICK, &CEditSend::OnBtnClick_button);
XEle_RegEventCPP(m_hBtnFont1, XE_BUTTON_CHECK, &CEditSend::OnBtnClick_font1);
XEle_RegEventCPP(m_hBtnFont2, XE_BUTTON_CHECK, &CEditSend::OnBtnClick_font2);
XEle_RegEventCPP(m_hBtnFont3, XE_BUTTON_CHECK, &CEditSend::OnBtnClick_font3);
XEle_RegEventCPP(m_hBtnColor1, XE_BUTTON_CHECK, &CEditSend::OnBtnClick_color1);
XEle_RegEventCPP(m_hBtnColor2, XE_BUTTON_CHECK, &CEditSend::OnBtnClick_color2);
XEle_RegEventCPP(m_hBtnColor3, XE_BUTTON_CHECK, &CEditSend::OnBtnClick_color3);
XEle_RegEventCPP(m_hEdit, XE_EDIT_STYLE_CHANGED, &CEditSend::OnEditStyleChanged);
XWnd_RegEventCPP(hWindow, WM_PAINT, &CEditSend::OnWndDrawWindow);
}
void InitBar(int left, int top)
{
int x = left;
m_hBtnImg1 = XBtn_Create(x, top - 25, 60, 20, L"img1", m_hWindow); x += 65;
m_hBtnImg2 = XBtn_Create(x, top - 25, 60, 20, L"img2", m_hWindow); x += 65;
m_hBtnImg3 = XBtn_Create(x, top - 25, 60, 20, L"gif", m_hWindow); x += 65;
m_hButton = XBtn_Create(x, top - 25, 60, 20, L"button", m_hWindow); x += 65;
m_hBtnFont1 = XBtn_Create(x, top - 25, 60, 20, L"字体12", m_hWindow); x += 65;
m_hBtnFont2 = XBtn_Create(x, top - 25, 60, 20, L"字体24", m_hWindow); x += 65;
m_hBtnFont3 = XBtn_Create(x, top - 25, 60, 20, L"字体36", m_hWindow); x += 65;
m_hBtnColor1 = XBtn_Create(x, top - 25, 60, 20, L"color1", m_hWindow); x += 65;
m_hBtnColor2 = XBtn_Create(x, top - 25, 60, 20, L"color2", m_hWindow); x += 65;
m_hBtnColor3 = XBtn_Create(x, top - 25, 60, 20, L"color3", m_hWindow); x += 65;
XEle_EnableFocus(m_hBtnImg1, FALSE);
XEle_EnableFocus(m_hBtnImg2, FALSE);
XEle_EnableFocus(m_hBtnImg3, FALSE);
XEle_EnableFocus(m_hButton, FALSE);
XEle_EnableFocus(m_hBtnFont1, FALSE);
XEle_EnableFocus(m_hBtnFont2, FALSE);
XEle_EnableFocus(m_hBtnFont3, FALSE);
XEle_EnableFocus(m_hBtnColor1, FALSE);
XEle_EnableFocus(m_hBtnColor2, FALSE);
XEle_EnableFocus(m_hBtnColor3, FALSE);
XBtn_SetType(m_hBtnFont1, button_type_radio);
XBtn_SetType(m_hBtnFont2, button_type_radio);
XBtn_SetType(m_hBtnFont3, button_type_radio);
XBtn_SetGroupID(m_hBtnFont1, 2);
XBtn_SetGroupID(m_hBtnFont2, 2);
XBtn_SetGroupID(m_hBtnFont3, 2);
XBtn_SetType(m_hBtnColor1, button_type_radio);
XBtn_SetType(m_hBtnColor2, button_type_radio);
XBtn_SetType(m_hBtnColor3, button_type_radio);
XBtn_SetGroupID(m_hBtnColor1, 3);
XBtn_SetGroupID(m_hBtnColor2, 3);
XBtn_SetGroupID(m_hBtnColor3, 3);
}
int OnBtnClick_Send(BOOL *pbHandled)
{
edit_data_copy_* data = XEdit_GetData(m_hEdit);
m_pRecv->Recv(data);
return 0;
}
int OnBtnClick_img1(BOOL *pbHandled)
{
HIMAGE hImage = XImage_LoadFile(L"image\\123.png");
if (hImage)
{
XEdit_AddObject(m_hEdit, hImage);
XEdit_AutoScroll(m_hEdit);
XEle_Redraw(m_hEdit);
}
return 0;
}
int OnBtnClick_img2(BOOL *pbHandled)
{
HIMAGE hImage = XImage_LoadFile(L"image\\logo.png");
if (hImage)
{
XEdit_AddObject(m_hEdit, hImage);
XEdit_AutoScroll(m_hEdit);
XEle_Redraw(m_hEdit);
}
return 0;
}
int OnBtnClick_img3(BOOL *pbHandled)
{
HIMAGE hImageGif = XImage_LoadFile(L"image\\gif.gif");
if (hImageGif)
{
HXCGUI hGif = XShapeGif_Create(0, 0, XImage_GetWidth(hImageGif), XImage_GetHeight(hImageGif), m_hEdit);
XShapeGif_SetImage(hGif, hImageGif);
XEdit_AddObject(m_hEdit, hGif);
XEdit_AutoScroll(m_hEdit);
XEle_Redraw(m_hEdit);
}
return 0;
}
int OnBtnClick_button(BOOL *pbHandled)
{
HELE hButton = XBtn_Create(0, 0, 60, 20, L"button", m_hEdit);
XEdit_AddObject(m_hEdit, hButton);
XEdit_AutoScroll(m_hEdit);
XEle_Redraw(m_hEdit);
return 0;
}
int OnBtnClick_font1(BOOL bCheck, BOOL *pbHandled)
{
if(bCheck) FontColorChange();
return 0;
}
int OnBtnClick_font2(BOOL bCheck, BOOL *pbHandled)
{
if (bCheck) FontColorChange();
return 0;
}
int OnBtnClick_font3(BOOL bCheck, BOOL *pbHandled)
{
if (bCheck) FontColorChange();
return 0;
}
int OnBtnClick_color1(BOOL bCheck, BOOL *pbHandled)
{
if (bCheck) FontColorChange();
return 0;
}
int OnBtnClick_color2(BOOL bCheck, BOOL *pbHandled)
{
if (bCheck) FontColorChange();
return 0;
}
int OnBtnClick_color3(BOOL bCheck, BOOL *pbHandled)
{
if (bCheck) FontColorChange();
return 0;
}
void FontColorChange()
{
int fontSize = 12;
if (XBtn_IsCheck(m_hBtnFont1))
{
fontSize = 12;
} else if (XBtn_IsCheck(m_hBtnFont2))
{
fontSize = 24;
} else if (XBtn_IsCheck(m_hBtnFont3))
{
fontSize = 36;
}
COLORREF color = 0;
if (XBtn_IsCheck(m_hBtnColor1))
{
color = COLORREF_MAKE(200,0,0,255);
} else if (XBtn_IsCheck(m_hBtnColor2))
{
color = COLORREF_MAKE(0, 200, 0,255);
} else if (XBtn_IsCheck(m_hBtnColor3))
{
color = COLORREF_MAKE(0, 0, 200,255);
}
int iStyle = XEdit_AddStyleEx(m_hEdit, L"微软雅黑", fontSize, 0, color, TRUE);
m_iCurStyle = iStyle;
XEdit_SetCurStyle(m_hEdit,iStyle);
XWnd_Redraw(m_hWindow);
}
int OnEditStyleChanged(int iStyle, BOOL *pbHandled)
{
m_iCurStyle = iStyle;
XWnd_Redraw(m_hWindow);
return 0;
}
int OnWndDrawWindow(HDRAW hDraw, BOOL *pbHandled)
{
*pbHandled = TRUE;
XWnd_DrawWindow(m_hWindow, hDraw);
RECT rc;
XEle_GetRect(m_hEdit, &rc);
XDraw_SetBrushColor(hDraw, COLORREF_MAKE(200, 0, 0,255));
if (XEdit_GetStyleInfo(m_hEdit, m_iCurStyle, &info))
{
{
if (info.hFont_image_obj)
{
wstring text = L"字体:";
xc_font_info_i f;
text += f.name;
text += L", ";
text += XC_itow(f.nSize);
XDraw_TextOut(hDraw, rc.right + 10, rc.top + 50, text.c_str(), text.size());
};
if (info.bColor)
{
wstring text = L"颜色:";
wchar_t buf[32] = { 0 };
buf[0] = L'#';
buf[1] = L'F';
buf[2] = L'F';
wsprintf(buf+3, L"%02X", GetRValue(info.color));
wsprintf(buf+5, L"%02X", GetGValue(info.color));
wsprintf(buf+7, L"%02X", GetBValue(info.color));
text += buf;
XDraw_TextOut(hDraw, rc.right + 10, rc.top + 75, text.c_str(), text.size());
}
}
}
return 0;
}
};
class CQQChat
{
public:
HWINDOW m_hWindow;
HELE m_hEdit;
CEditRecv m_edit_recv;
CEditSend m_edit_send;
CQQChat() {
Init();
}
void Init()
{
m_hWindow = XWnd_Create(0, 0, 800, 800, L"炫彩界面库窗口", NULL, window_style_default);
XWnd_EnableDragWindow(m_hWindow, TRUE);
XWnd_EnableDragBorder(m_hWindow, FALSE);
int top = 40;
m_edit_recv.Init(m_hWindow, 20, top, 600, 500); top += (500+30);
m_edit_send.Init(m_hWindow, 20, top, 600, 200);
m_edit_send.m_pRecv = &m_edit_recv;
XWnd_ShowWindow(m_hWindow, SW_SHOW);
}
void OnExit()
{
m_edit_recv.OnExit();
}
};
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
XInitXCGUI(TRUE);
CQQChat MyWindow;
MyWindow.OnExit();
return 0;
}
#define XE_BNCLICK
按钮点击事件.
Definition: XCGUI.h:939
#define XE_BUTTON_CHECK
按钮选中事件
Definition: XCGUI.h:943
#define XE_EDIT_STYLE_CHANGED
Definition: XCGUI.h:1176
@ button_type_radio
单选按钮
Definition: XCGUI.h:295
XC_OBJECT_TYPE
Definition: XCGUI.h:129
@ XC_SHAPE_GIF
形状对象-GIF
Definition: XCGUI.h:232
@ XC_BUTTON
按钮
Definition: XCGUI.h:158
@ XC_FONT
炫彩字体
Definition: XCGUI.h:243
@ XC_ELE
基础元素
Definition: XCGUI.h:152
@ XC_SHAPE
形状对象
Definition: XCGUI.h:218
@ XC_IMAGE_FRAME
图片帧,指定图片的渲染属性
Definition: XCGUI.h:247
@ window_style_default
窗口样式-控制按钮: 居中 图标, 标题, 关闭按钮, 最大化按钮, 最小化按钮
Definition: XCGUI.h:398
const wchar_t *WINAPI XBtn_GetText(HELE hEle)
按钮_取文本 获取文本内容.
Definition: ButtonUI.cpp:1952
HELE WINAPI XBtn_Create(int x, int y, int cx, int cy, const wchar_t *pName, HXCGUI hParent)
按钮_创建 创建按钮元素
Definition: ButtonUI.cpp:1765
BOOL WINAPI XBtn_IsCheck(HELE hEle)
按钮_是否选中 是否选中状态.
Definition: ButtonUI.cpp:1790
void WINAPI XBtn_SetGroupID(HELE hEle, int nID)
按钮_置组ID 设置组ID.
Definition: ButtonUI.cpp:1848
void WINAPI XDraw_TextOut(HDRAW hDraw, int xStart, int yStart, const wchar_t *pString, int cbString)
@绘制_文本
Definition: DrawDC.cpp:3383
void WINAPI XDraw_SetBrushColor(HDRAW hDraw, COLORREF color)
绘制_置画刷颜色 设置画刷颜色.
Definition: DrawDC.cpp:2536
@ chat_flag_right
右侧
Definition: XCGUI.h:1833
@ chat_flag_left
左侧
Definition: XCGUI.h:1831
@ chat_flag_next_row_bubble
下一行显示气泡
Definition: XCGUI.h:1837
@ chat_flag_center
中间
Definition: XCGUI.h:1835
@ edit_type_richedit
富文本编辑框, 每行的高度可能不同
Definition: XCGUI.h:1810
@ edit_type_chat
聊天气泡, 每行的高度可能不同, 功能继承富文本编辑框
Definition: XCGUI.h:1812
@ edit_style_type_font_color
字体
Definition: XCGUI.h:1820
int WINAPI XEdit_AddObject(HELE hEle, HXCGUI hObj)
@编辑框_添加对象 例如: 字体, 图片, UI对象
Definition: EditUI.cpp:7024
void WINAPI XEdit_AddTextEx(HELE hEle, const wchar_t *pString, int iStyle)
@编辑框_添加文本扩展
Definition: EditUI.cpp:7013
void WINAPI XEdit_FreeData(edit_data_copy_ *pData)
@编辑框_释放数据
Definition: EditUI.cpp:6763
void WINAPI XEdit_AddText(HELE hEle, const wchar_t *pString)
@编辑框_添加文本
Definition: EditUI.cpp:6992
void WINAPI XEdit_SetRowHeightEx(HELE hEle, int iRow, int nHeight)
@编辑框_置指定行高度 当类型为 edit_type_richedit 支持指定不同行高
Definition: EditUI.cpp:7170
void WINAPI XEdit_SetRowHeight(HELE hEle, int nHeight)
@编辑框_置默认行高
Definition: EditUI.cpp:7159
void WINAPI XEdit_EnableAutoWrap(HELE hEle, BOOL bEnable)
@编辑框_启用自动换行 启用自动换行
Definition: EditUI.cpp:6600
void WINAPI XEdit_AddData(HELE hEle, edit_data_copy_ *pData, in_buffer_ USHORT *styleTable, int nStyleCount)
@编辑框_添加数据
Definition: EditUI.cpp:6754
void WINAPI XEdit_AddChatEnd(HELE hEle)
@编辑框_添加气泡结束 当前行结束
Definition: EditUI.cpp:7562
BOOL WINAPI XEdit_AutoScroll(HELE hEle)
@编辑框_自动滚动 视图自动滚动到当前插入符位置
Definition: EditUI.cpp:7274
BOOL WINAPI XEdit_GetStyleInfo(HELE hEle, int iStyle, __out edit_style_info_ *info)
@编辑框_取样式信息
Definition: EditUI.cpp:7099
HELE WINAPI XEdit_CreateEx(int x, int y, int cx, int cy, edit_type_ type, HXCGUI hParent)
@编辑框_创建扩展 创建
Definition: EditUI.cpp:6585
void WINAPI XEdit_SetCurStyle(HELE hEle, int iStyle)
@编辑框_置当前样式
Definition: EditUI.cpp:7109
int WINAPI XEdit_AddStyleEx(HELE hEle, const wchar_t *fontName, int fontSize, int fontStyle, COLORREF color, BOOL bColor)
@编辑框_添加样式扩展
Definition: EditUI.cpp:7062
edit_data_copy_ *WINAPI XEdit_GetData(HELE hEle)
@编辑框_取数据 包含文本或非文本内容
Definition: EditUI.cpp:6742
int WINAPI XEdit_AddStyle(HELE hEle, HXCGUI hFont_image_Obj, COLORREF color, BOOL bColor)
@编辑框_添加样式
Definition: EditUI.cpp:7047
int WINAPI XEdit_GetCurRow(HELE hEle)
@编辑框_取当前行
Definition: EditUI.cpp:7233
void WINAPI XEdit_AddChatBegin(HELE hEle, HIMAGE hImageAvatar, HIMAGE hImageBubble, int nFlag)
@编辑框_添加气泡开始 当前行开始
Definition: EditUI.cpp:7553
int WINAPI XEle_GetWidth(HELE hEle)
元素_取宽度 获取元素宽度.
Definition: EleUI.cpp:3640
int WINAPI XEle_GetHeight(HELE hEle)
元素_取高度 获取元素高度.
Definition: EleUI.cpp:3649
void WINAPI XEle_EnableFocus(HELE hEle, BOOL bEnable)
元素_启用焦点 启用焦点.
Definition: EleUI.cpp:4033
void WINAPI XEle_AdjustLayout(HELE hEle, UINT nAdjustNo)
元素_调整布局 调整布局.
Definition: EleUI.cpp:4676
void WINAPI XEle_EnableKeyTab(HELE hEle, BOOL bEnable)
元素_启用接收TAB 启用接收Tab输入.
Definition: EleUI.cpp:4099
void WINAPI XEle_GetRect(HELE hEle, __out RECT *pRect)
元素_取坐标 获取元素坐标.
Definition: EleUI.cpp:3592
void WINAPI XEle_Redraw(HELE hEle, BOOL bImmediate)
元素_重绘 重绘元素.
Definition: EleUI.cpp:4179
void WINAPI XFont_GetFontInfo(HFONTX hFontX, __out font_info_ *pInfo)
字体_取信息 获取字体信息.
Definition: FontX.cpp:944
void WINAPI XImage_Release(HIMAGE hImage)
图片_释放引用计数 释放引用计数,当引用计数为0时,自动销毁.
Definition: ImageFrame.cpp:1530
int WINAPI XImage_GetHeight(HIMAGE hImage)
图片_取高度 获取图片高度.
Definition: ImageFrame.cpp:1503
HIMAGE WINAPI XImage_LoadFileAdaptive(const wchar_t *pFileName, int leftSize, int topSize, int rightSize, int bottomSize)
图片_加载从文件自适应 加载图片从文件,自适应图片.
Definition: ImageFrame.cpp:1030
HIMAGE WINAPI XImage_LoadFile(const wchar_t *pFileName)
图片_加载从文件 加载图片从文件.
Definition: ImageFrame.cpp:1014
int WINAPI XImage_GetWidth(HIMAGE hImage)
图片_取宽度 获取图片宽度.
Definition: ImageFrame.cpp:1494
BOOL WINAPI XC_IsHXCGUI(HXCGUI hXCGUI, XC_OBJECT_TYPE nType)
炫彩_是否句柄包含类型 判断句柄是否拥有该类型.
Definition: Api.cpp:307
const wchar_t *WINAPI XC_itow(int nValue)
炫彩_整数到文本W 转换函数, 返回结果最大长度 TEXT_BUFFER_SIZE = 10240, 使用共享缓存,不需要释放.
Definition: Api.cpp:86
void WINAPI XExitXCGUI()
炫彩_退出 退出界面库释放资源. 不可在dllmain()中卸载, 否则会死锁
Definition: App.cpp:572
void WINAPI XRunXCGUI()
炫彩_运行 运行消息循环,当炫彩窗口数量为0时退出.
Definition: App.cpp:564
XC_OBJECT_TYPE WINAPI XC_GetObjectType(HXCGUI hXCGUI)
炫彩_取对象类型 获取句柄类型.
Definition: Api.cpp:443
BOOL WINAPI XInitXCGUI(BOOL bD2D)
炫彩_初始化 初始化界面库.
Definition: App.cpp:557
void * HXCGUI
资源句柄
Definition: XCGUI.h:92
XC_OBJECT_TYPE WINAPI XObj_GetTypeBase(HXCGUI hXCGUI)
炫彩对象_取基础类型 获取对象的基础类型,
Definition: App.cpp:761
XWnd_RegEventCPP(hWindow, nEvent, memberFunction)
窗口_注册事件CPP 注册窗口事件,将类成员函数作为事件响应函数.函数省略参数窗口自身句柄hWindow.
XEle_RegEventCPP(hEle, nEvent, memberFunction)
元素_注册事件CPP 注册元素事件,将类成员函数作为事件响应函数.函数省略元素自身句柄hEle.
HIMAGE WINAPI XShapeGif_GetImage(HXCGUI hShape)
形状GIF_取图片 获取图片句柄.
Definition: Shape.cpp:1836
void WINAPI XShapeGif_SetImage(HXCGUI hShape, HIMAGE hImage)
形状GIF_置图片 设置GIF图片.
Definition: Shape.cpp:1825
HXCGUI WINAPI XShapeGif_Create(int x, int y, int cx, int cy, HXCGUI hParent)
形状GIF_创建 创建形状对象GIF.
Definition: Shape.cpp:1813
HWINDOW WINAPI XWnd_Create(int x, int y, int cx, int cy, const wchar_t *pTitle, HWND hWndParent, int XCStyle)
窗口_创建 创建窗口
Definition: WindowUI.cpp:5964
void WINAPI XWnd_EnableDragWindow(HWINDOW hWindow, BOOL bEnable)
窗口_启用拖动窗口 启用拖动窗口.
Definition: WindowUI.cpp:6186
void WINAPI XWnd_DrawWindow(HWINDOW hWindow, HDRAW hDraw)
窗口_绘制 在自绘事件函数中,用户手动调用绘制窗口,以便控制绘制顺序.
Definition: WindowUI.cpp:6123
BOOL WINAPI XWnd_ShowWindow(HWINDOW hWindow, int nCmdShow)
@窗口_显示扩展 显示隐藏及控制窗口最大化还原等
Definition: WindowUI.cpp:6387
void WINAPI XWnd_EnableDragBorder(HWINDOW hWindow, BOOL bEnable)
窗口_启用拖动边框 启用拖动窗口边框.
Definition: WindowUI.cpp:6177
void WINAPI XWnd_Redraw(HWINDOW hWindow, BOOL bUpdate)
窗口_重绘 重绘窗口.
Definition: WindowUI.cpp:6075
Edit 数据复制
Definition: XCGUI.h:2615
edit_data_copy_style_ * pStyle
样式数组
Definition: XCGUI.h:2621
int nStyleCount
样式数量
Definition: XCGUI.h:2619
UINT hFont_image_obj
句柄(字体,图片,UI对象), 使用UINT目的当64位时可以节约4字节内存
Definition: XCGUI.h:2605
BOOL bColor
是否使用颜色
Definition: XCGUI.h:2609
COLORREF color
颜色
Definition: XCGUI.h:2607
Edit 样式信息
Definition: XCGUI.h:2587
HXCGUI hFont_image_obj
句柄(字体,图片,UI对象)
Definition: XCGUI.h:2593
USHORT type
样式类型
Definition: XCGUI.h:2589
BOOL bColor
是否使用颜色
Definition: XCGUI.h:2597
COLORREF color
颜色
Definition: XCGUI.h:2595

程序截图