LayoutEle-布局元素

布局对象

示例代码:

#pragma comment(lib, "XCGUI.lib")
#include "xcgui.h"
class CMyWindowLayout
{
public:
HWINDOW m_hWindow;
HELE m_hLayoutEle;
CMyWindowLayout()
{
m_hLayoutEle = NULL;
Init();
}
void Init()
{
m_hWindow = XWnd_Create(0, 0, 500, 300, L"炫彩界面库窗口", NULL, window_style_default);
m_hLayoutEle = XLayout_Create(20, 40, 350, 100, m_hWindow);
XLayoutBox_SetSpace(m_hLayoutEle, 2);
XEle_SetPadding(m_hLayoutEle, 10, 10, 10, 10);
HELE hButton1 = XBtn_Create(0, 0, 60, 20, L"111", m_hLayoutEle);
HELE hButton2 = XBtn_Create(0, 0, 60, 20, L"222", m_hLayoutEle);
HELE hButton3 = XBtn_Create(0, 0, 60, 20, L"333", m_hLayoutEle);
HXCGUI hShapeText = XShapeText_Create(0, 0, 60, 20, L"ShapeText", m_hLayoutEle);
XWnd_AdjustLayout(m_hWindow);
XWnd_ShowWindow(m_hWindow, SW_SHOW);
}
};
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
XInitXCGUI(TRUE);
CMyWindowLayout MyWindow;
return 0;
}
@ layout_align_top
顶部
Definition: XCGUI.h:1611
@ layout_align_right
右侧
Definition: XCGUI.h:1613
@ window_style_default
窗口样式-控制按钮: 居中 图标, 标题, 关闭按钮, 最大化按钮, 最小化按钮
Definition: XCGUI.h:398
HELE WINAPI XBtn_Create(int x, int y, int cx, int cy, const wchar_t *pName, HXCGUI hParent)
按钮_创建 创建按钮元素
Definition: ButtonUI.cpp:1765
void WINAPI XEle_SetPadding(HELE hEle, int left, int top, int right, int bottom)
元素_置内填充大小 设置被填充大小.
Definition: EleUI.cpp:4253
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
void * HXCGUI
资源句柄
Definition: XCGUI.h:92
void WINAPI XLayoutBox_SetAlignH(HXCGUI hLayoutBox, layout_align_ nAlign)
@布局盒子_置水平对齐
Definition: LayoutEle.cpp:418
void WINAPI XLayoutBox_SetAlignV(HXCGUI hLayoutBox, layout_align_ nAlign)
@布局盒子_置垂直对齐
Definition: LayoutEle.cpp:428
void WINAPI XLayoutBox_SetSpace(HXCGUI hLayoutBox, int nSpace)
@布局盒子_置间距
Definition: LayoutEle.cpp:448
HELE WINAPI XLayout_Create(int x, int y, int cx, int cy, HXCGUI hParent)
布局_创建 创建布局元素.
Definition: LayoutEle.cpp:294
HXCGUI WINAPI XShapeText_Create(int x, int y, int cx, int cy, const wchar_t *pName, HXCGUI hParent)
形状文本_创建 创建形状对象文本.
Definition: Shape.cpp:1286
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