#pragma comment(lib, "XCGUI.lib")
#include "xcgui.h"
class CMyWindowMenu
{
public:
HWINDOW m_hWindow;
CMyWindowMenu()
{
Init();
}
void Init()
{
HELE hButton =
XBtn_Create(20, 50, 80, 20, L
"弹出菜单", m_hWindow);
}
int OnBtnClick(HELE hEventEle, BOOL *pbHandled)
{
RECT rcButton;
POINT pt = { rcButton.left,rcButton.bottom };
return 0;
}
int OnWndMenuPopup(HMENUX hMenu, BOOL *pbHandled)
{
XTRACE("menu-XWM_MENU_POPUP\n");
return 0;
}
int OnWndMenuPopupWnd(HMENUX hMenu,
menu_popupWnd_* pInfo, BOOL *pbHandled)
{
XTRACE(
"menu-XWM_MENU_POPUP_WND nParent=%d \n", pInfo->
nParentID);
return 0;
}
int OnWndMenuSelect(int nID, BOOL *pBool)
{
XTRACE("menu-XWM_MENU_SELECT item:%d\n", nID);
return 0;
}
int OnWndMenuExit(BOOL *pbHandled)
{
XTRACE("menu-XWM_MENU_EXIT exit \n");
return 0;
}
{
*pbHandled = TRUE;
return 0;
}
int OnWndMenuDrawItem(HDRAW hDraw,
menu_drawItem_* pInfo, BOOL *pbHandled)
{
*pbHandled = TRUE;
return 0;
}
};
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
CMyWindowMenu MyWindow;
return TRUE;
}
#define XE_BNCLICK
按钮点击事件.
Definition: XCGUI.h:939
@ window_style_default
窗口样式-控制按钮: 居中 图标, 标题, 关闭按钮, 最大化按钮, 最小化按钮
Definition: XCGUI.h:398
void WINAPI XEle_GetRect(HELE hEle, __out RECT *pRect)
元素_取坐标 获取元素坐标.
Definition: EleUI.cpp:3592
HIMAGE WINAPI XImage_LoadFile(const wchar_t *pFileName)
图片_加载从文件 加载图片从文件.
Definition: ImageFrame.cpp:1014
#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 注册元素事件,将类成员函数作为事件响应函数.函数不省略参数.
XWnd_RegEventCPP(hWindow, nEvent, memberFunction)
窗口_注册事件CPP 注册窗口事件,将类成员函数作为事件响应函数.函数省略参数窗口自身句柄hWindow.
#define XWM_MENU_EXIT
菜单退出
Definition: XCGUI.h:718
#define XWM_MENU_POPUP_WND
菜单弹出窗口
Definition: XCGUI.h:710
#define XWM_MENU_DRAWITEM
绘制菜单项事件, 启用该功能需要调用XMenu_EnableDrawItem().
Definition: XCGUI.h:726
#define XWM_MENU_POPUP
菜单弹出
Definition: XCGUI.h:706
#define XWM_MENU_SELECT
菜单选择
Definition: XCGUI.h:714
#define XWM_MENU_DRAW_BACKGROUND
绘制菜单背景, 启用该功能需要调用XMenu_EnableDrawBackground().
Definition: XCGUI.h:722
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
BOOL WINAPI XWnd_ShowWindow(HWINDOW hWindow, int nCmdShow)
@窗口_显示扩展 显示隐藏及控制窗口最大化还原等
Definition: WindowUI.cpp:6387