class CMyWindowMenu
{
public:
HWINDOW m_hWindow;
HELE m_hButton;
CMyWindowMenu()
{
Init();
}
void Init()
{
m_hButton =
XBtn_Create(20, 50, 80, 30, L
"弹出菜单", m_hWindow);
}
BOOL OnBtnClick(HELE hEventEle, BOOL *pbHandled)
{
RECT rcButton;
POINT pt = { rcButton.left,rcButton.bottom };
return 0;
}
{
*pbHandled = TRUE;
RECT rect;
return 0;
}
int OnWndMenuDrawItem(HDRAW hDraw,
menu_drawItem_* pInfo, BOOL *pbHandled)
{
*pbHandled = TRUE;
{
return 0;
}
{
XDraw_GradientFill2(hDraw, &pInfo->
rcItem, COLORREF_MAKE(63, 151, 216, 255), COLORREF_MAKE(48, 134, 198, 255), GRADIENT_FILL_RECT_V);
} else
{
{
}
}
{
POINT pt[3];
pt[0].x = pInfo->
rcItem.right - 12;
pt[0].y = pInfo->
rcItem.top + 5;
pt[1].x = pInfo->
rcItem.right - 12;
pt[1].y = pInfo->
rcItem.top + 15;
pt[2].x = pInfo->
rcItem.right - 7;
pt[2].y = pInfo->
rcItem.top + 10;
}
{
}
rc.left = leftWidth + 5;
const wchar_t *pText = pInfo->
pText;
{
if (pText)
{
}
} else
{
{
if (height >= 2 && iconWidth >= 2 && iconHeight >= 2)
{
int top = (height - iconHeight) / 2;
int left = (leftWidth - iconWidth) / 2;
if (top < 0) top = 0;
if (left < 0) left = 0;
}
}
if (pText)
{
}
}
return 0;
}
};
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
CMyWindowMenu MyWindow;
return TRUE;
}
#define XE_BNCLICK
按钮点击事件.
Definition: XCGUI.h:939
#define XE_MENU_DRAW_BACKGROUND
绘制菜单背景, 启用该功能需要调用XMenu_EnableDrawBackground().
Definition: XCGUI.h:927
#define XE_MENU_DRAWITEM
绘制菜单项事件, 启用该功能需要调用XMenu_EnableDrawItem().
Definition: XCGUI.h:931
@ window_style_default
窗口样式-控制按钮: 居中 图标, 标题, 关闭按钮, 最大化按钮, 最小化按钮
Definition: XCGUI.h:398
void WINAPI XDraw_DrawLine(HDRAW hDraw, int x1, int y1, int x2, int y2)
绘制_线条 绘制线条.
Definition: DrawDC.cpp:2916
void WINAPI XDraw_FillPolygon(HDRAW hDraw, in_buffer_ POINT *points, int nCount)
绘制_填充多边形 填充多边形.
Definition: DrawDC.cpp:3076
void WINAPI XDraw_FillRect(HDRAW hDraw, RECT *pRect)
@绘制_填充矩形
Definition: DrawDC.cpp:2633
void WINAPI XDraw_DrawText(HDRAW hDraw, const wchar_t *pString, int nCount, RECT *pRect)
@绘制_文本指定矩形
Definition: DrawDC.cpp:3331
void WINAPI XDraw_Image(HDRAW hDraw, HIMAGE hImageFrame, int x, int y)
绘制_图片 绘制图片.
Definition: DrawDC.cpp:3107
void WINAPI XDraw_SetTextAlign(HDRAW hDraw, int nFlags)
绘制_置文本对齐 设置文本对齐.
Definition: DrawDC.cpp:2556
void WINAPI XDraw_SetBrushColor(HDRAW hDraw, COLORREF color)
绘制_置画刷颜色 设置画刷颜色.
Definition: DrawDC.cpp:2536
void WINAPI XDraw_GradientFill2(HDRAW hDraw, RECT *pRect, COLORREF color1, COLORREF color2, int mode)
绘制_渐变填充2 渐变填充,从一种颜色过渡到另一种颜色.
Definition: DrawDC.cpp:2831
void WINAPI XEle_GetRect(HELE hEle, __out RECT *pRect)
元素_取坐标 获取元素坐标.
Definition: EleUI.cpp:3592
int WINAPI XImage_GetHeight(HIMAGE hImage)
图片_取高度 获取图片高度.
Definition: ImageFrame.cpp:1503
HIMAGE WINAPI XImage_LoadFile(const wchar_t *pFileName)
图片_加载从文件 加载图片从文件.
Definition: ImageFrame.cpp:1014
int WINAPI XImage_GetWidth(HIMAGE hImage)
图片_取宽度 获取图片宽度.
Definition: ImageFrame.cpp:1494
#define XC_ID_ERROR
ID错误
Definition: XCGUI.h:462
#define XC_ID_ROOT
根节点
Definition: XCGUI.h:461
void WINAPI XExitXCGUI()
炫彩_退出 退出界面库释放资源. 不可在dllmain()中卸载, 否则会死锁
Definition: App.cpp:572
void WINAPI XRunXCGUI()
炫彩_运行 运行消息循环,当炫彩窗口数量为0时退出.
Definition: App.cpp:564
BOOL WINAPI XInitXCGUI(BOOL bD2D)
炫彩_初始化 初始化界面库.
Definition: App.cpp:557
XEle_RegEventCPP1(hEle, nEvent, memberFunction)
元素_注册事件CPP1 注册元素事件,将类成员函数作为事件响应函数.函数不省略参数.
XEle_RegEventCPP(hEle, nEvent, memberFunction)
元素_注册事件CPP 注册元素事件,将类成员函数作为事件响应函数.函数省略元素自身句柄hEle.
BOOL WINAPI XWnd_GetClientRect(HWINDOW hWindow, __out RECT *pRect)
窗口_取客户区坐标 获取窗口客户区坐标;如果是阴影窗口,那么不包含阴影部分.
Definition: WindowUI.cpp:6830
HWND WINAPI XWnd_GetHWND(HWINDOW hWindow)
窗口_取HWND 获取HWND句柄.
Definition: WindowUI.cpp:6168
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_AdjustLayout(HWINDOW hWindow)
窗口_调整布局 调整窗口布局, 当窗口显示状态才有效.
Definition: WindowUI.cpp:6718
BOOL WINAPI XWnd_ShowWindow(HWINDOW hWindow, int nCmdShow)
@窗口_显示扩展 显示隐藏及控制窗口最大化还原等
Definition: WindowUI.cpp:6387