#pragma comment(lib, "XCGUI.lib")
#include "xcgui.h"
class CMyWindowLayout
{
public:
HWINDOW m_hWindow;
HELE m_hLayoutFrame;
CMyWindowLayout()
{
m_hLayoutFrame = NULL;
Init();
}
void Init()
{
XSView_SetBorderSize(m_hLayoutFrame, 10, 10, 10, 10);
int top = 10;
HELE hButton =
XBtn_Create(10, top, 400, 100, L
"导航条", m_hLayoutFrame); top += 110;
hButton =
XBtn_Create(10, top, 400, 100, L
"图标", m_hLayoutFrame); top += 110;
hButton =
XBtn_Create(10, top, 100, 180, L
"百度一下,你就知道", m_hLayoutFrame); top += 110;
hButton =
XBtn_Create(10, top, 100, 150, L
"4", m_hLayoutFrame); top += 110;
XLayoutItem_EnableFloat(hButton, TRUE);
AdjustLayout();
}
void Test()
{
XSView_SetBorderSize(m_hLayoutFrame, 5, 5, 5, 5);
int top = 10;
HELE hButton =
XBtn_Create(10, top, 400, 100, L
"1", m_hLayoutFrame); top += 110;
hButton =
XBtn_Create(10, top, 400, 100, L
"2", m_hLayoutFrame); top += 110;
hButton =
XBtn_Create(10, top, 400, 100, L
"3", m_hLayoutFrame); top += 110;
hButton =
XBtn_Create(10, top, 400, 100, L
"4", m_hLayoutFrame); top += 110;
}
void AdjustLayout()
{
RECT rect;
RECT rc = {20,50,00};
rc.right = rect.right - 20;
rc.bottom = rect.bottom - 20;
}
int OnWndSize(UINT nFlags, SIZE* pSize, BOOL* pbHandled)
{
AdjustLayout();
return 0;
}
};
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
CMyWindowLayout MyWindow;
return 0;
}
@ window_style_default
窗口样式-控制按钮: 居中 图标, 标题, 关闭按钮, 最大化按钮, 最小化按钮
Definition: XCGUI.h:398
int WINAPI XEle_SetRect(HELE hEle, RECT *pRect, BOOL bRedraw, int nFlags, UINT nAdjustNo)
元素_置坐标 设置元素坐标.
Definition: EleUI.cpp:3783
void WINAPI XC_ShowLayoutFrame(BOOL bShow)
炫彩_显示布局边界 显示布局对象边界.
Definition: Api.cpp:585
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
HELE WINAPI XLayoutFrame_Create(int x, int y, int cx, int cy, HXCGUI hParent)
@布局框架_创建
Definition: LayoutStack.cpp:173
XWnd_RegEventCPP(hWindow, nEvent, memberFunction)
窗口_注册事件CPP 注册窗口事件,将类成员函数作为事件响应函数.函数省略参数窗口自身句柄hWindow.
BOOL WINAPI XWnd_GetClientRect(HWINDOW hWindow, __out RECT *pRect)
窗口_取客户区坐标 获取窗口客户区坐标;如果是阴影窗口,那么不包含阴影部分.
Definition: WindowUI.cpp:6830
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