#pragma comment(lib, "XCGUI.lib")
#include "xcgui.h"
class CMyEditor
{
public:
HWINDOW m_hWindow;
HELE m_hEdit;
HFONTX m_hFont;
CMyEditor() {
Init();
}
void Init()
{
m_hFont = XFont_Create2(L"微软雅黑", 12);
int iStyle_const =
XEdit_AddStyle(m_hEdit, NULL, COLORREF_MAKE(189, 99, 179,255), TRUE);
int iStyle_fun =
XEdit_AddStyle(m_hEdit, NULL, COLORREF_MAKE(255, 128, 0,255), TRUE);
int iStyle_str =
XEdit_AddStyle(m_hEdit, NULL, COLORREF_MAKE(206, 145, 120,255), TRUE);
int iStyle_comment =
XEdit_AddStyle(m_hEdit, NULL, COLORREF_MAKE(67, 166, 74,255), TRUE);
int iStyle_key1 =
XEdit_AddStyle(m_hEdit, NULL, COLORREF_MAKE(86, 156, 214,255), TRUE);
int iStyle_key2 =
XEdit_AddStyle(m_hEdit, NULL, COLORREF_MAKE(200, 0, 0,255), TRUE);
XEditor_SetStyleConst(m_hEdit, iStyle_const);
XEditor_SetStyleFunction(m_hEdit, iStyle_fun);
XEditor_SetStyleString(m_hEdit, iStyle_str);
XEditor_SetStyleComment(m_hEdit, iStyle_comment);
XEditor_AddFunction(m_hEdit, LR"(HXCGUI XC_LoadLayout(const wchar_t *pFileName, HXCGUI hParent=NULL); //我是描述)");
XEditor_AddFunction(m_hEdit, LR"(HXCGUI XEle_RegEvent(const wchar_t *pFileName, HXCGUI hParent=NULL); //我是描述)");
XEditor_AddFunction(m_hEdit, LR"(HXCGUI XWnd_AdjustLayout(const wchar_t *pFileName, HXCGUI hParent=NULL); //我是描述)");
XEditor_AddFunction(m_hEdit, LR"(HXCGUI XWnd_ShowWindow(const wchar_t *pFileName, HXCGUI hParent=NULL); //我是描述)");
{\n\
XC_LoadLayout(\"layout.xml\",0);\n\
XE_BNCLICK;\n\
return 0;\n\
}\n");
}
};
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
CMyEditor MyWindow;
return 0;
}
BOOL WINAPI XEditor_SetRunRow(HELE hEle, int iRow)
@代码编辑框_置当前运行
Definition: EditorUI.cpp:5392
HELE WINAPI XEditor_Create(int x, int y, int cx, int cy, HXCGUI hParent)
@代码编辑框_创建
Definition: EditorUI.cpp:5312
BOOL WINAPI XEditor_SetBreakpoint(HELE hEle, int iRow, BOOL bActivate)
@代码编辑框_置断点
Definition: EditorUI.cpp:5361
void WINAPI XEditor_AddConst(HELE hEle, const wchar_t *pKey)
@代码编辑框_添加自动匹配字符串
Definition: EditorUI.cpp:5579
void WINAPI XEditor_AddFunction(HELE hEle, const wchar_t *pKey)
@代码编辑框_添加自动匹配函数
Definition: EditorUI.cpp:5589
void WINAPI XEditor_AddKeyword(HELE hEle, const wchar_t *pKey, int iStyle)
@代码编辑框_添加关键字 如果已存在,那么仅更新样式
Definition: EditorUI.cpp:5569
@ window_style_default
窗口样式-控制按钮: 居中 图标, 标题, 关闭按钮, 最大化按钮, 最小化按钮
Definition: XCGUI.h:398
void WINAPI XEdit_SetText(HELE hEle, const wchar_t *pString)
@编辑框_置文本
Definition: EditUI.cpp:6856
void WINAPI XEdit_EnableAutoWrap(HELE hEle, BOOL bEnable)
@编辑框_启用自动换行 启用自动换行
Definition: EditUI.cpp:6600
int WINAPI XEdit_AddStyle(HELE hEle, HXCGUI hFont_image_Obj, COLORREF color, BOOL bColor)
@编辑框_添加样式
Definition: EditUI.cpp:7047
void WINAPI XEle_SetTextColor(HELE hEle, COLORREF color)
元素_置文本颜色 设置文本颜色.
Definition: EleUI.cpp:4328
void WINAPI XEle_SetFont(HELE hEle, HFONTX hFontx)
元素_置字体 设置元素字体.
Definition: EleUI.cpp:4376
void WINAPI XEle_EnableKeyTab(HELE hEle, BOOL bEnable)
元素_启用接收TAB 启用接收Tab输入.
Definition: EleUI.cpp:4099
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
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