Compare commits
14 Commits
26-1
...
ab7ee978e7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab7ee978e7 | ||
|
|
e22a779dda | ||
|
|
dcdbf051d0 | ||
|
|
bcb56200c1 | ||
|
|
0811c0eabb | ||
|
|
415d9ab518 | ||
|
|
76be13001f | ||
|
|
814f42120c | ||
|
|
4fe4749826 | ||
|
|
2ff880c267 | ||
|
|
abcfc78596 | ||
|
|
bcbf890ebd | ||
|
|
9fe2fe5874 | ||
|
|
1be1ecbbf2 |
63
.gitattributes
vendored
63
.gitattributes
vendored
@@ -1,63 +0,0 @@
|
|||||||
###############################################################################
|
|
||||||
# Set default behavior to automatically normalize line endings.
|
|
||||||
###############################################################################
|
|
||||||
* text=auto
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# Set default behavior for command prompt diff.
|
|
||||||
#
|
|
||||||
# This is need for earlier builds of msysgit that does not have it on by
|
|
||||||
# default for csharp files.
|
|
||||||
# Note: This is only used by command line
|
|
||||||
###############################################################################
|
|
||||||
#*.cs diff=csharp
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# Set the merge driver for project and solution files
|
|
||||||
#
|
|
||||||
# Merging from the command prompt will add diff markers to the files if there
|
|
||||||
# are conflicts (Merging from VS is not affected by the settings below, in VS
|
|
||||||
# the diff markers are never inserted). Diff markers may cause the following
|
|
||||||
# file extensions to fail to load in VS. An alternative would be to treat
|
|
||||||
# these files as binary and thus will always conflict and require user
|
|
||||||
# intervention with every merge. To do so, just uncomment the entries below
|
|
||||||
###############################################################################
|
|
||||||
#*.sln merge=binary
|
|
||||||
#*.csproj merge=binary
|
|
||||||
#*.vbproj merge=binary
|
|
||||||
#*.vcxproj merge=binary
|
|
||||||
#*.vcproj merge=binary
|
|
||||||
#*.dbproj merge=binary
|
|
||||||
#*.fsproj merge=binary
|
|
||||||
#*.lsproj merge=binary
|
|
||||||
#*.wixproj merge=binary
|
|
||||||
#*.modelproj merge=binary
|
|
||||||
#*.sqlproj merge=binary
|
|
||||||
#*.wwaproj merge=binary
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# behavior for image files
|
|
||||||
#
|
|
||||||
# image files are treated as binary by default.
|
|
||||||
###############################################################################
|
|
||||||
#*.jpg binary
|
|
||||||
#*.png binary
|
|
||||||
#*.gif binary
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# diff behavior for common document formats
|
|
||||||
#
|
|
||||||
# Convert binary document formats to text before diffing them. This feature
|
|
||||||
# is only available from the command line. Turn it on by uncommenting the
|
|
||||||
# entries below.
|
|
||||||
###############################################################################
|
|
||||||
#*.doc diff=astextplain
|
|
||||||
#*.DOC diff=astextplain
|
|
||||||
#*.docx diff=astextplain
|
|
||||||
#*.DOCX diff=astextplain
|
|
||||||
#*.dot diff=astextplain
|
|
||||||
#*.DOT diff=astextplain
|
|
||||||
#*.pdf diff=astextplain
|
|
||||||
#*.PDF diff=astextplain
|
|
||||||
#*.rtf diff=astextplain
|
|
||||||
#*.RTF diff=astextplain
|
|
||||||
18
.gitignore
vendored
18
.gitignore
vendored
@@ -1,7 +1,11 @@
|
|||||||
build/*
|
/build
|
||||||
build64/*
|
/demo
|
||||||
_temp/
|
/_temp
|
||||||
_bin/
|
/_bin
|
||||||
temp/
|
/temp
|
||||||
bin/
|
/bin
|
||||||
.vs/
|
/.vs
|
||||||
|
*.db
|
||||||
|
*.gitignore
|
||||||
|
*.gitattributes
|
||||||
|
*.tlog
|
||||||
47
CLAUDE.md
47
CLAUDE.md
@@ -9,20 +9,27 @@ EzUI 是一个基于原生 Win32 消息机制和 Direct2D 的 C++ 桌面 UI 框
|
|||||||
## 构建命令
|
## 构建命令
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
build.bat # 构建 32 位静态库
|
build_x86.bat # 构建 32 位静态库
|
||||||
build64.bat # 构建 64 位静态库
|
build_x64.bat # 构建 64 位静态库
|
||||||
```
|
```
|
||||||
|
|
||||||
CMake 构建:
|
CMake 构建:
|
||||||
```bash
|
```bash
|
||||||
cmake -B build
|
cmake -B build # 默认静态库
|
||||||
cmake --build build
|
cmake --build build
|
||||||
```
|
|
||||||
|
|
||||||
静态库/动态库切换:
|
# 动态库
|
||||||
```bash
|
cmake -B build -DBUILD_SHARED_LIBS=ON
|
||||||
cmake -B build -DBUILD_SHARED_LIBS=ON # 动态库
|
|
||||||
cmake -B build -DBUILD_SHARED_LIBS=OFF # 静态库(默认)
|
# 仅构建库(不构建 demo)
|
||||||
|
cmake -B build -DBUILD_DEMO=OFF
|
||||||
|
|
||||||
|
# 编译为静态库
|
||||||
|
cmake --build build/vs2022_x86 --target EzUI --config Debug
|
||||||
|
cmake --build build/vs2022_x86 --target EzUI --config Release
|
||||||
|
cmake --build build/vs2022_x64 --target EzUI --config Debug
|
||||||
|
cmake --build build/vs2022_x64 --target EzUI --config Release
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 核心架构
|
## 核心架构
|
||||||
@@ -37,8 +44,11 @@ cmake -B build -DBUILD_SHARED_LIBS=OFF # 静态库(默认)
|
|||||||
所有控件继承自 `Control` 基类,核心控件包括:
|
所有控件继承自 `Control` 基类,核心控件包括:
|
||||||
- 基础控件:`Label`, `Button`, `TextBox`, `PictureBox`
|
- 基础控件:`Label`, `Button`, `TextBox`, `PictureBox`
|
||||||
- 选择控件:`CheckBox`, `RadioButton`, `ComboBox`
|
- 选择控件:`CheckBox`, `RadioButton`, `ComboBox`
|
||||||
- 布局容器:`HLayout`, `VLayout`, `HListView`, `VListView`, `TileListView`, `TabLayout`
|
- 数据控件:`TableView`, `TreeView`, `ListView` 系列
|
||||||
- 功能控件:`ScrollBar`, `Menu`, `NotifyIcon`, `ProgressBar`, `TreeView`, `Spacer`
|
- 布局容器:`HLayout`, `VLayout`, `HListView`, `VListView`, `TileListView`, `TabLayout`, `PagedListView`
|
||||||
|
- 功能控件:`ScrollBar`, `Menu`, `NotifyIcon`, `ProgressBar`, `Spacer`, `IFrame`, `ShadowBox`
|
||||||
|
- 表格控件:`TableView`
|
||||||
|
- 动画:`Animation` - 类似 Qt 的过渡动画系统
|
||||||
|
|
||||||
### 布局系统
|
### 布局系统
|
||||||
- **尺寸优先级**:比例尺寸 (`SetRateWidth/Height`) > 绝对尺寸 (`SetFixedSize`) > 控件内容大小
|
- **尺寸优先级**:比例尺寸 (`SetRateWidth/Height`) > 绝对尺寸 (`SetFixedSize`) > 控件内容大小
|
||||||
@@ -51,6 +61,8 @@ cmake -B build -DBUILD_SHARED_LIBS=OFF # 静态库(默认)
|
|||||||
- `UISelector` - CSS 选择器匹配系统
|
- `UISelector` - CSS 选择器匹配系统
|
||||||
- `Direct2DRender` - Direct2D 绘图实现
|
- `Direct2DRender` - Direct2D 绘图实现
|
||||||
- `RenderTypes` - 颜色、对齐方式等绘图类型
|
- `RenderTypes` - 颜色、对齐方式等绘图类型
|
||||||
|
- `UIDef` - 框架内使用的宏定义集合
|
||||||
|
- `EzUI.h` - 框架主接口头文件,定义事件类、枚举、全局资源等核心结构
|
||||||
|
|
||||||
### 事件系统
|
### 事件系统
|
||||||
- 支持事件冒泡机制,可实现事件捕获与穿透
|
- 支持事件冒泡机制,可实现事件捕获与穿透
|
||||||
@@ -67,6 +79,18 @@ cmake -B build -DBUILD_SHARED_LIBS=OFF # 静态库(默认)
|
|||||||
- 控件树内存由父控件自动管理:`Attach`/`Detach`
|
- 控件树内存由父控件自动管理:`Attach`/`Detach`
|
||||||
- 图片资源通过 `PtrManager` 自动释放
|
- 图片资源通过 `PtrManager` 自动释放
|
||||||
- XML 布局加载后由 `UIManager` 管理生命周期
|
- XML 布局加载后由 `UIManager` 管理生命周期
|
||||||
|
- `add_resource_package` 函数支持资源打包为 `.res` 文件
|
||||||
|
|
||||||
|
### 调试技巧
|
||||||
|
- 在 Debug 模式下运行时,按下 `F11` 可实时查看布局信息,高亮显示控件边界
|
||||||
|
|
||||||
|
## Demo 项目
|
||||||
|
|
||||||
|
- `helloWorld` - 基础示例
|
||||||
|
- `QQ` - 仿 QQ 登录界面(含资源打包)
|
||||||
|
- `kugou` - 酷狗音乐播放器(含 VLC 依赖和资源打包)
|
||||||
|
- `ResPackage` - 资源打包工具
|
||||||
|
- `Adminstor` / `DemoUi` - 管理界面示例
|
||||||
|
|
||||||
## 开发约定
|
## 开发约定
|
||||||
|
|
||||||
@@ -74,4 +98,5 @@ cmake -B build -DBUILD_SHARED_LIBS=OFF # 静态库(默认)
|
|||||||
- 源文件位于 `sources/` 目录
|
- 源文件位于 `sources/` 目录
|
||||||
- 一切皆控件,纯代码组合 UI
|
- 一切皆控件,纯代码组合 UI
|
||||||
- 使用 CSS 驱动视觉,结构与样式分离
|
- 使用 CSS 驱动视觉,结构与样式分离
|
||||||
- 中文注释,中文沟通
|
- XML 解析使用 `tinyxml` 库
|
||||||
|
|
||||||
|
|||||||
@@ -44,4 +44,7 @@ function(add_resource_package TARGET_NAME INPUT_DIR OUTPUT_FILE)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
#添加子项目
|
#添加子项目
|
||||||
#add_subdirectory(./demo) # 暂时注释掉,只编译库
|
option(BUILD_DEMO "Build demo projects" ON)
|
||||||
|
if(BUILD_DEMO)
|
||||||
|
add_subdirectory(./demo)
|
||||||
|
endif()
|
||||||
|
|||||||
13
README.md
13
README.md
@@ -184,16 +184,3 @@ label{ /*标签选择器*/
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 📖 学习 & 技术支持
|
|
||||||
|
|
||||||
- 视频教程:https://space.bilibili.com/240269358/video
|
|
||||||
- QQ:718987717
|
|
||||||
- QQ群:758485934
|
|
||||||
- 邮箱:[19980103ly@gmail.com]/[19980103ly@gmail.com]
|
|
||||||
- 微信:wx19980103yon
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📄 License
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -177,12 +177,14 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="framework.h" />
|
<ClInclude Include="framework.h" />
|
||||||
<ClInclude Include="loginForm.h" />
|
<ClInclude Include="loginForm.h" />
|
||||||
|
<ClInclude Include="mainForm.h" />
|
||||||
<ClInclude Include="pch.h" />
|
<ClInclude Include="pch.h" />
|
||||||
<ClInclude Include="Resource.h" />
|
<ClInclude Include="Resource.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="DemoUi.cpp" />
|
<ClCompile Include="DemoUi.cpp" />
|
||||||
<ClCompile Include="loginForm.cpp" />
|
<ClCompile Include="loginForm.cpp" />
|
||||||
|
<ClCompile Include="mainForm.cpp" />
|
||||||
<ClCompile Include="pch.cpp">
|
<ClCompile Include="pch.cpp">
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||||
|
|||||||
@@ -27,6 +27,9 @@
|
|||||||
<ClInclude Include="loginForm.h">
|
<ClInclude Include="loginForm.h">
|
||||||
<Filter>头文件</Filter>
|
<Filter>头文件</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="mainForm.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="DemoUi.cpp">
|
<ClCompile Include="DemoUi.cpp">
|
||||||
@@ -38,6 +41,9 @@
|
|||||||
<ClCompile Include="loginForm.cpp">
|
<ClCompile Include="loginForm.cpp">
|
||||||
<Filter>源文件</Filter>
|
<Filter>源文件</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="mainForm.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Image Include="small.ico">
|
<Image Include="small.ico">
|
||||||
|
|||||||
BIN
demo/Adminstor/Adminstor/DemoUi.aps
Normal file
BIN
demo/Adminstor/Adminstor/DemoUi.aps
Normal file
Binary file not shown.
@@ -7,7 +7,6 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance
|
|||||||
Application app(hInstance);
|
Application app(hInstance);
|
||||||
app.EnableHighDpi();//启用高DPI
|
app.EnableHighDpi();//启用高DPI
|
||||||
|
|
||||||
|
|
||||||
//创建登录创建
|
//创建登录创建
|
||||||
loginForm loginFrm;
|
loginForm loginFrm;
|
||||||
loginFrm.Show();
|
loginFrm.Show();
|
||||||
|
|||||||
Binary file not shown.
@@ -1,14 +1,7 @@
|
|||||||
//{{NO_DEPENDENCIES}}
|
//{{NO_DEPENDENCIES}}
|
||||||
// Microsoft Visual C++ generated include file.
|
// Microsoft Visual C++ 生成的包含文件。
|
||||||
// Used by DemoUi.rc
|
// 供 DemoUi.rc 使用
|
||||||
|
|
||||||
// <20>¶<EFBFBD><C2B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>Ĭ<EFBFBD><C4AC>ֵ
|
|
||||||
//
|
//
|
||||||
#ifdef APSTUDIO_INVOKED
|
#define IDI_SMALL 101
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#define IDD_INPUT 102
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
#define IDC_EDIT1 1000
|
||||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
|
||||||
#include "ezui/Application.h" //app类
|
#include "ezui/Application.h" //app类
|
||||||
#include "EzUI/Window.h" //基础窗口类
|
#include "EzUI/Window.h" //基础窗口类
|
||||||
#include "EzUI/Button.h" //按钮
|
#include "EzUI/Button.h" //按钮
|
||||||
@@ -18,4 +17,8 @@
|
|||||||
#include "EzUI/TileListView.h"//瓦片列表
|
#include "EzUI/TileListView.h"//瓦片列表
|
||||||
#include "EzUI/LayeredWindow.h"//分层窗口类-可以异型透明窗口
|
#include "EzUI/LayeredWindow.h"//分层窗口类-可以异型透明窗口
|
||||||
#include "ezui/UIManager.h"//ui管理类(使用xml生成控件)
|
#include "ezui/UIManager.h"//ui管理类(使用xml生成控件)
|
||||||
|
#include "EzUI/Animation.h"
|
||||||
|
#include "EzUI/TableView.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "loginForm.h"
|
#include "loginForm.h"
|
||||||
|
#include "mainForm.h"
|
||||||
|
|
||||||
void loginForm::OnNotify(Control* sender, EventArgs& args)
|
void loginForm::OnNotify(Control* sender, EventArgs& args)
|
||||||
{
|
{
|
||||||
@@ -8,22 +9,31 @@ void loginForm::OnNotify(Control* sender, EventArgs& args)
|
|||||||
TextBox* editUser = (TextBox*)FindControl("user");
|
TextBox* editUser = (TextBox*)FindControl("user");
|
||||||
TextBox* editpwd = (TextBox*)FindControl("pwd");
|
TextBox* editpwd = (TextBox*)FindControl("pwd");
|
||||||
CheckBox* ckbox = (CheckBox*)FindControl("ckbox");
|
CheckBox* ckbox = (CheckBox*)FindControl("ckbox");
|
||||||
if (!ckbox->GetCheck()) {
|
/*if (!ckbox->GetCheck()) {
|
||||||
::MessageBoxW(Hwnd(), L"<EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD>Э<EFBFBD>鲢<EFBFBD><EFBFBD>ѡ!", L"<EFBFBD><EFBFBD>ʾ", MB_OK);
|
::MessageBoxW(Hwnd(), L"请阅读协议并勾选!", L"提示", MB_OK);
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
UIString user = editUser->GetText();
|
UIString user = editUser->GetText();
|
||||||
UIString pwd = editpwd->GetText();
|
UIString pwd = editpwd->GetText();
|
||||||
if (user == "718987717" && pwd == "123456") {
|
|
||||||
::MessageBoxW(Hwnd(), L"<EFBFBD><EFBFBD>¼<EFBFBD>ɹ<EFBFBD>!", L"<EFBFBD><EFBFBD>ʾ", MB_OK);
|
Hide(); // 隐藏登录窗口
|
||||||
}
|
static mainForm mainForm;
|
||||||
else {
|
mainForm.Show(); // 显示主界面
|
||||||
::MessageBoxW(Hwnd(), L"<EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!", L"<EFBFBD><EFBFBD>ʾ", MB_OK);
|
|
||||||
}
|
//if (user == "ad" && pwd == "123") {
|
||||||
|
// ::MessageBoxW(Hwnd(), L"登录成功!", L"提示", MB_OK);
|
||||||
|
// Hide(); // 隐藏登录窗口
|
||||||
|
// static mainForm mainForm;
|
||||||
|
// mainForm.Show(); // 显示主界面
|
||||||
|
//}
|
||||||
|
//else {
|
||||||
|
// ::MessageBoxW(Hwnd(), L"用户名或密码错误!", L"提示", MB_OK);
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
if (sender->Name == "btnExit") {
|
if (sender->Name == "btnExit") {
|
||||||
Application::Exit();
|
Application::Exit();
|
||||||
}
|
}
|
||||||
|
// 打开链接
|
||||||
if (!sender->GetAttribute("url").empty()) {
|
if (!sender->GetAttribute("url").empty()) {
|
||||||
::ShellExecuteA(0, "open", sender->GetAttribute("url").c_str(), "", "", SW_SHOW);
|
::ShellExecuteA(0, "open", sender->GetAttribute("url").c_str(), "", "", SW_SHOW);
|
||||||
}
|
}
|
||||||
@@ -38,8 +48,12 @@ void loginForm::OnClose(bool& close)
|
|||||||
|
|
||||||
loginForm::loginForm() :LayeredWindow(320, 448)
|
loginForm::loginForm() :LayeredWindow(320, 448)
|
||||||
{
|
{
|
||||||
umg.LoadXml("res/loginForm.htm");//<EFBFBD><EFBFBD><EFBFBD><EFBFBD>xml<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀؼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ
|
umg.LoadXml("res/loginForm.htm");//加载xml里面的控件与样式
|
||||||
umg.SetupUI(this);
|
umg.SetupUI(this);
|
||||||
|
|
||||||
|
// 通过资源ID加载图标 (在 app.rc 中定义 IDI_SMALL=101)
|
||||||
|
HICON hIco = (HICON)::LoadImageW(GetModuleHandleW(nullptr), MAKEINTRESOURCEW(IDI_SMALL), IMAGE_ICON, 32, 32, 0);
|
||||||
|
if (hIco) SetIcon(hIco);
|
||||||
}
|
}
|
||||||
|
|
||||||
loginForm::~loginForm()
|
loginForm::~loginForm()
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
|
||||||
using namespace ezui;
|
using namespace ezui;
|
||||||
|
|
||||||
using Form = LayeredWindow; //֧<><D6A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><CDB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>Ӱ)
|
//using Form = LayeredWindow; //支持异形透明窗口(带阴影)
|
||||||
//using Form = BorderlessWindow; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޱ߿<EFBFBD>(<28><><EFBFBD><EFBFBD>Ӱ)
|
//using Form = BorderlessWindow; //常规无边框窗口(带阴影)
|
||||||
//using Form = Window; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
//using Form = Window; //标准窗口(带系统标题栏)
|
||||||
|
|
||||||
// <EFBFBD><EFBFBD>½<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
// 登陆窗口
|
||||||
class loginForm :public Form
|
class loginForm :public LayeredWindow
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
//ui<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
//ui管理类
|
||||||
UIManager umg;
|
UIManager umg;
|
||||||
protected:
|
protected:
|
||||||
virtual void OnNotify(Control* sender, EventArgs& args)override;//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>֪ͨ
|
virtual void OnNotify(Control* sender, EventArgs& args)override;//重载事件通知
|
||||||
virtual void OnClose(bool& close)override;//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڹرյ<EFBFBD>ʱ<EFBFBD><EFBFBD>
|
virtual void OnClose(bool& close)override;//当窗口关闭的时候
|
||||||
public:
|
public:
|
||||||
loginForm();
|
loginForm();
|
||||||
virtual ~loginForm();
|
virtual ~loginForm();
|
||||||
|
|||||||
183
demo/Adminstor/Adminstor/mainForm.cpp
Normal file
183
demo/Adminstor/Adminstor/mainForm.cpp
Normal file
@@ -0,0 +1,183 @@
|
|||||||
|
#include "pch.h"
|
||||||
|
#include "mainForm.h"
|
||||||
|
|
||||||
|
|
||||||
|
void mainForm::OnNotify(Control* sender, EventArgs& args)
|
||||||
|
{
|
||||||
|
UIString btnName = sender->Name; // 控件id
|
||||||
|
Event eventType = args.EventType; // 事件类型
|
||||||
|
|
||||||
|
// 针对管理界面的表格控件
|
||||||
|
//if (btnName == "tableViewAdmin") {
|
||||||
|
// switch (eventType)
|
||||||
|
// {
|
||||||
|
// case 8: break;
|
||||||
|
// case Event::OnMouseUp://鼠标抬起
|
||||||
|
// {
|
||||||
|
// TableView* tableView = (TableView*)FindControl("tableViewAdmin"); //获取表格控件
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// default:
|
||||||
|
// std::cout << "表格事件:" << (long long)eventType << std::endl;
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
switch (eventType)
|
||||||
|
{
|
||||||
|
case ezui::OnMouseDown: //鼠标按下
|
||||||
|
{
|
||||||
|
if (btnName == "btnExitMain") { //退出
|
||||||
|
int result = ::MessageBoxW(Hwnd(), L"要退出程序吗?", L"提示", MB_YESNO | MB_ICONQUESTION);
|
||||||
|
if (result == IDYES)
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
else if (btnName == "btnMinMain") { //最小化
|
||||||
|
this->ShowMinimized();
|
||||||
|
}
|
||||||
|
else if (btnName == "btnMaxMain") { //最大化|还原
|
||||||
|
if (this->IsMaximized()) {
|
||||||
|
this->ShowNormal();
|
||||||
|
// 修改控件文字
|
||||||
|
Button* btnMax = (Button*)FindControl("btnMaxMain");
|
||||||
|
btnMax->SetText(L"🗖");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this->ShowMaximized();
|
||||||
|
// 修改控件文字
|
||||||
|
Button* btnMax = (Button*)FindControl("btnMaxMain");
|
||||||
|
btnMax->SetText(L"🗗");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (btnName == "btnAdmin") { //到管理页面 获取 mainTab ,设置页面为0
|
||||||
|
TabLayout* mainTab = (TabLayout*)FindControl("mainTab");
|
||||||
|
mainTab->SetPageIndex(0);
|
||||||
|
mainTab->Invalidate();
|
||||||
|
}
|
||||||
|
else if (btnName == "btnTools") { //到工具页面 获取 mainTab ,设置页面为1
|
||||||
|
TabLayout* mainTab = (TabLayout*)FindControl("mainTab");
|
||||||
|
mainTab->SetPageIndex(1);
|
||||||
|
mainTab->Invalidate();
|
||||||
|
}
|
||||||
|
else if (btnName == "btnAdminConnect") { //管理页面的连接按钮按下,先获取 btnAdminConnect 按钮,设置为不可用,修改文字为“连接中...”
|
||||||
|
Button* btnAdminConnect = (Button*)FindControl("btnAdminConnect");
|
||||||
|
btnAdminConnect->SetText(L"🔄");
|
||||||
|
btnAdminConnect->Style.BackColor = Color(0, 185, 107);
|
||||||
|
}
|
||||||
|
else if (btnName == "btnAdminTemp") { //管理页面的测试按钮
|
||||||
|
TextBox* textAdmin = (TextBox*)FindControl("textAdminOutput"); //获取输出框
|
||||||
|
if (textAdmin) {
|
||||||
|
textAdmin->Insert(L"\n测试成功!",true);
|
||||||
|
textAdmin->GetScrollBar()->ScrollTo(1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
TableView* tableView = (TableView*)FindControl("tableViewAdmin"); //获取表格控件
|
||||||
|
if (tableView){
|
||||||
|
int rowCount = tableView->GetRowCount(); //总行数
|
||||||
|
// 表格增加一行数据
|
||||||
|
tableView->InsertRow(rowCount);
|
||||||
|
tableView->SetRowData(rowCount, { L"uid" + std::to_wstring(rowCount), L"192.168.200.131\n127.0.0" , L"", L"2026-02-25"});
|
||||||
|
tableView->SetCellChecked(rowCount, 5, true);
|
||||||
|
tableView->SetCellComboIndex(rowCount, 2, 0);
|
||||||
|
|
||||||
|
// 改变单元格颜色
|
||||||
|
/*CellStyle style = tableView->GetCellStyle(1, 1);
|
||||||
|
style.SetBackColor(Color(200, 230, 155));
|
||||||
|
tableView->SetCellStyle(1, 1, style);*/
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ezui::OnMouseDoubleClick: //鼠标双击
|
||||||
|
{
|
||||||
|
//if (btnName == "titleMain") { //标题布局
|
||||||
|
// if (this->IsMaximized()) {
|
||||||
|
// this->ShowNormal();
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// this->ShowMaximized();
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
__super::OnNotify(sender, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
void mainForm::OnClose(bool& close)
|
||||||
|
{
|
||||||
|
Application::Exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
void mainForm::OnMouseUp(ezui::MouseButton mbtn, const ezui::Point& point)
|
||||||
|
{
|
||||||
|
if (mbtn == ezui::MouseButton::Right) {
|
||||||
|
// 右键弹起处理(可实现右键单击)
|
||||||
|
TableView* tableView = (TableView*)FindControl("tableViewAdmin"); //获取表格控件
|
||||||
|
if (tableView) {
|
||||||
|
//表格
|
||||||
|
int pRow = tableView->GetHoverRow(); //当前行号
|
||||||
|
int pCol = tableView->GetHoverCol(); //当前列号
|
||||||
|
if (pRow < 0 || pCol < 0) return; // 说明不在表格区域内
|
||||||
|
|
||||||
|
UIString celContent = tableView->GetData(pRow, pCol);
|
||||||
|
//std::cout << "单元格内容: " << celContent.ansi() << std::endl;
|
||||||
|
std::cout << "行列号为 (" << pRow << ", " << pCol << ") 当前列宽: " << tableView->GetColumnWidth(pCol) << std::endl;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ezui::Window::OnMouseUp(mbtn, point);
|
||||||
|
}
|
||||||
|
|
||||||
|
// UI初始化
|
||||||
|
mainForm::mainForm() :LayeredWindow(1500, 750)
|
||||||
|
{
|
||||||
|
SetResizable(true); // 启用窗口大小调整
|
||||||
|
SetMiniSize(Size(600, 450)); // 设置最小尺寸
|
||||||
|
umg.LoadXml("res/mainForm.htm");//加载xml里面的控件与样式
|
||||||
|
umg.SetupUI(this);
|
||||||
|
|
||||||
|
// 通过资源ID加载图标 (在 app.rc 中定义 IDI_SMALL=101)
|
||||||
|
HICON hIco = (HICON)::LoadImageW(GetModuleHandleW(nullptr), MAKEINTRESOURCEW(IDI_SMALL), IMAGE_ICON, 32, 32, 0);
|
||||||
|
if (hIco) SetIcon(hIco);
|
||||||
|
|
||||||
|
// 如果是debug模式则创建控制台窗口用于输出调试信息
|
||||||
|
#ifdef _DEBUG
|
||||||
|
AllocConsole();
|
||||||
|
FILE* fp = nullptr;
|
||||||
|
freopen_s(&fp, "CONOUT$", "w", stdout);
|
||||||
|
freopen_s(&fp, "CONOUT$", "w", stderr);
|
||||||
|
std::cout << "调试模式控制台已启动!" << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// 初始化设置表格各项属性
|
||||||
|
TableView* tableView = (TableView*)FindControl("tableViewAdmin"); //获取表格控件
|
||||||
|
if (tableView) {
|
||||||
|
tableView->SelectedRowBackColor = Color(200, 230, 255); // 设置选中行背景色
|
||||||
|
//tableView->SetColumnType(5, ezui::CellType::CheckBox);
|
||||||
|
tableView->SetColumnType(2, ezui::CellType::ComboBox); //设置第3列为下拉列表类型
|
||||||
|
tableView->SetColumnComboItems(2, { L"默认", L"禁止" , L"验机" }); //设置第3列下拉列表内容
|
||||||
|
tableView->SetDefaultTextAlign(Align::MiddleCenter); //设置默认对齐方式
|
||||||
|
|
||||||
|
//设置列宽
|
||||||
|
std::vector<int> withs = {60, 130, 55, 95, 85, 85, 105, 70, 75, 80, 80, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95 };
|
||||||
|
for(int i = 0; i < withs.size(); i++)
|
||||||
|
tableView->SetColumnWidth(i, withs[i]);
|
||||||
|
|
||||||
|
// 单元格编辑完成(编辑结束时触发,提供旧值与新值)
|
||||||
|
tableView->CellEditFinished = [](int row, int col, const UIString& oldValue, const UIString& newValue) {
|
||||||
|
//std::cout << "完成编辑单元格内容: " << newValue.ansi() << ", " << oldValue.ansi() << std::endl;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
mainForm::~mainForm()
|
||||||
|
{
|
||||||
|
}
|
||||||
23
demo/Adminstor/Adminstor/mainForm.h
Normal file
23
demo/Adminstor/Adminstor/mainForm.h
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "pch.h"
|
||||||
|
|
||||||
|
using namespace ezui;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 主窗口
|
||||||
|
class mainForm :public LayeredWindow
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
protected:
|
||||||
|
virtual void OnNotify(Control* sender, EventArgs& args)override;//重载事件通知
|
||||||
|
virtual void OnClose(bool& close)override;//当窗口关闭的时候
|
||||||
|
virtual void OnMouseUp(ezui::MouseButton mbtn, const ezui::Point& point) override; // 鼠标抬起
|
||||||
|
public:
|
||||||
|
//ui管理类
|
||||||
|
UIManager umg;
|
||||||
|
mainForm();
|
||||||
|
virtual ~mainForm();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
@@ -1 +1 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "framework.h"
|
#include "framework.h"
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 97 KiB |
@@ -32,6 +32,7 @@ namespace ezui {
|
|||||||
|
|
||||||
VListView m_list;
|
VListView m_list;
|
||||||
int m_index = -1;
|
int m_index = -1;
|
||||||
|
int m_pendingIndex = -1; // 延迟设置的索引(用于XML属性解析)
|
||||||
void Init();
|
void Init();
|
||||||
protected:
|
protected:
|
||||||
virtual void OnLayout()override;
|
virtual void OnLayout()override;
|
||||||
@@ -47,5 +48,7 @@ namespace ezui {
|
|||||||
//添加一个item并返回新item的下标
|
//添加一个item并返回新item的下标
|
||||||
int AddItem(const UIString& text);
|
int AddItem(const UIString& text);
|
||||||
void RemoveItem(int index);
|
void RemoveItem(int index);
|
||||||
|
//设置属性
|
||||||
|
virtual void SetAttribute(const UIString& key, const UIString& value)override;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
495
demo/Adminstor/ThirdParty/EzUI/include/EzUI/TableView.h
vendored
Normal file
495
demo/Adminstor/ThirdParty/EzUI/include/EzUI/TableView.h
vendored
Normal file
@@ -0,0 +1,495 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "Control.h"
|
||||||
|
#include "Label.h"
|
||||||
|
#include "TextBox.h"
|
||||||
|
#include "CheckBox.h"
|
||||||
|
#include "ComboBox.h"
|
||||||
|
#include "VScrollBar.h"
|
||||||
|
#include "HScrollBar.h"
|
||||||
|
#include <functional>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
namespace ezui {
|
||||||
|
|
||||||
|
// 第一列类型枚举
|
||||||
|
enum class FirstColumnType {
|
||||||
|
TextBox, // 空白文本框(默认)
|
||||||
|
Index, // 不可编辑的序号(从1开始)
|
||||||
|
CheckBox // 选择框
|
||||||
|
};
|
||||||
|
|
||||||
|
// 单元格类型枚举
|
||||||
|
enum class CellType {
|
||||||
|
TextBox, // 文本框(默认)
|
||||||
|
CheckBox, // 选择框
|
||||||
|
ComboBox, // 下拉选择框
|
||||||
|
ReadOnly // 不可编辑(可选中复制但不能修改)
|
||||||
|
};
|
||||||
|
|
||||||
|
// 边框类型(复用框架的 StrokeStyle)
|
||||||
|
// StrokeStyle::None - 无边框
|
||||||
|
// StrokeStyle::Solid - 实线
|
||||||
|
// StrokeStyle::Dash - 虚线
|
||||||
|
|
||||||
|
// 排序方向
|
||||||
|
enum class SortOrder {
|
||||||
|
None, // 未排序
|
||||||
|
Ascending, // 升序
|
||||||
|
Descending // 降序
|
||||||
|
};
|
||||||
|
|
||||||
|
// 单元格独立样式(用于单独设置某个单元格的样式)
|
||||||
|
struct CellStyle {
|
||||||
|
Color BorderColor;
|
||||||
|
StrokeStyle BorderStyle = StrokeStyle::None;
|
||||||
|
Color BackColor;
|
||||||
|
Color ForeColor;
|
||||||
|
TextAlign Align = TextAlign::TopLeft;
|
||||||
|
bool HasBorderColor = false;
|
||||||
|
bool HasBorderStyle = false;
|
||||||
|
bool HasBackColor = false;
|
||||||
|
bool HasForeColor = false;
|
||||||
|
bool HasTextAlign = false;
|
||||||
|
|
||||||
|
void SetBorderColor(const Color& color) {
|
||||||
|
BorderColor = color;
|
||||||
|
HasBorderColor = true;
|
||||||
|
}
|
||||||
|
void SetBorderStyle(StrokeStyle style) {
|
||||||
|
BorderStyle = style;
|
||||||
|
HasBorderStyle = true;
|
||||||
|
}
|
||||||
|
void SetBackColor(const Color& color) {
|
||||||
|
BackColor = color;
|
||||||
|
HasBackColor = true;
|
||||||
|
}
|
||||||
|
void SetForeColor(const Color& color) {
|
||||||
|
ForeColor = color;
|
||||||
|
HasForeColor = true;
|
||||||
|
}
|
||||||
|
void SetTextAlign(ezui::TextAlign align) {
|
||||||
|
Align = align;
|
||||||
|
HasTextAlign = true;
|
||||||
|
}
|
||||||
|
void Reset() {
|
||||||
|
HasBorderColor = false;
|
||||||
|
HasBorderStyle = false;
|
||||||
|
HasBackColor = false;
|
||||||
|
HasForeColor = false;
|
||||||
|
HasTextAlign = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 单元格数据
|
||||||
|
struct CellData {
|
||||||
|
UIString Text; // 单元格文本内容
|
||||||
|
bool Checked = false; // 用于 CheckBox 类型
|
||||||
|
int ComboIndex = -1; // 用于 ComboBox 类型,选中的索引
|
||||||
|
CellStyle Style; // 单元格独立样式
|
||||||
|
};
|
||||||
|
|
||||||
|
// 列信息
|
||||||
|
struct ColumnInfo {
|
||||||
|
UIString HeaderText; // 表头文字
|
||||||
|
int Width = 100; // 列宽
|
||||||
|
CellType Type = CellType::TextBox; // 单元格类型
|
||||||
|
std::vector<UIString> ComboItems; // 下拉选项(仅 ComboBox 类型有效)
|
||||||
|
SortOrder CurrentSort = SortOrder::None; // 当前排序状态
|
||||||
|
TextAlign CellTextAlign = TextAlign::TopLeft; // 该列的默认对齐方式
|
||||||
|
};
|
||||||
|
|
||||||
|
class UI_EXPORT TableView : public Control {
|
||||||
|
private:
|
||||||
|
// 滚动条
|
||||||
|
VScrollBar m_vScrollBar;
|
||||||
|
HScrollBar m_hScrollBar;
|
||||||
|
|
||||||
|
// 数据存储
|
||||||
|
std::vector<ColumnInfo> m_columns; // 列信息
|
||||||
|
std::vector<std::vector<CellData>> m_data; // 二维数据 [row][col]
|
||||||
|
std::vector<int> m_rowHeights; // 每行高度
|
||||||
|
std::vector<bool> m_rowChecked; // 每行的选中状态(第一列为CheckBox时使用)
|
||||||
|
|
||||||
|
// 第一列配置
|
||||||
|
FirstColumnType m_firstColumnType = FirstColumnType::TextBox;
|
||||||
|
int m_firstColumnWidth = 50; // 第一列宽度
|
||||||
|
|
||||||
|
// 表头配置
|
||||||
|
int m_headerHeight = 30; // 表头高度
|
||||||
|
bool m_headerSelectAll = false; // 表头全选状态
|
||||||
|
|
||||||
|
// 默认行高
|
||||||
|
int m_defaultRowHeight = 30;
|
||||||
|
|
||||||
|
// 统一单元格样式
|
||||||
|
int m_cellBorderSize = 1;
|
||||||
|
StrokeStyle m_cellBorderStyle = StrokeStyle::Solid;
|
||||||
|
Color m_cellBorderColor = Color::LightGray;
|
||||||
|
Color m_cellBackColor = Color::White;
|
||||||
|
Color m_cellForeColor = Color::Black;
|
||||||
|
int m_cellFontSize = 14;
|
||||||
|
std::wstring m_cellFontFamily = L"Microsoft YaHei";
|
||||||
|
TextAlign m_cellTextAlign = TextAlign::TopLeft; // 默认对齐方式
|
||||||
|
std::vector<TextAlign> m_rowTextAlign; // 每行的对齐方式(未设置时使用默认值)
|
||||||
|
|
||||||
|
// 表头样式
|
||||||
|
Color m_headerBackColor = Color(0xFFE0E0E0);
|
||||||
|
Color m_headerForeColor = Color::Black;
|
||||||
|
|
||||||
|
// 滚动偏移
|
||||||
|
int m_scrollOffsetX = 0;
|
||||||
|
int m_scrollOffsetY = 0;
|
||||||
|
|
||||||
|
// 内容大小缓存(供GetContentSize使用)
|
||||||
|
mutable Size m_contentSize;
|
||||||
|
|
||||||
|
// 编辑状态
|
||||||
|
bool m_editing = false;
|
||||||
|
int m_editRow = -1;
|
||||||
|
int m_editCol = -1;
|
||||||
|
TextBox* m_editBox = nullptr;
|
||||||
|
ComboBox* m_editCombo = nullptr;
|
||||||
|
CheckBox* m_editCheck = nullptr;
|
||||||
|
|
||||||
|
// 列宽拖动
|
||||||
|
bool m_draggingColumn = false;
|
||||||
|
int m_dragColumnIndex = -1;
|
||||||
|
int m_dragStartX = 0;
|
||||||
|
int m_dragStartWidth = 0;
|
||||||
|
|
||||||
|
// 排序
|
||||||
|
int m_sortColumnIndex = -1;
|
||||||
|
|
||||||
|
// 鼠标悬停
|
||||||
|
int m_hoverRow = -1;
|
||||||
|
int m_hoverCol = -1;
|
||||||
|
|
||||||
|
// 双击检测
|
||||||
|
ULONGLONG m_lastClickTime = 0;
|
||||||
|
int m_lastClickRow = -1;
|
||||||
|
int m_lastClickCol = -1;
|
||||||
|
|
||||||
|
// 选中行(非CheckBox模式下,通过单击第一列选中的行)
|
||||||
|
int m_selectedRow = -1;
|
||||||
|
|
||||||
|
// 编辑前的原始值(用于编辑完成回调)
|
||||||
|
UIString m_editOriginalValue;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
// 计算总内容宽度
|
||||||
|
int GetContentWidth() const;
|
||||||
|
|
||||||
|
// 计算总内容高度
|
||||||
|
int GetContentHeight() const;
|
||||||
|
|
||||||
|
// 获取列起始X坐标(考虑滚动偏移)
|
||||||
|
int GetColumnX(int colIndex) const;
|
||||||
|
|
||||||
|
// 获取行起始Y坐标(考虑滚动偏移)
|
||||||
|
int GetRowY(int rowIndex) const;
|
||||||
|
|
||||||
|
// 根据坐标获取单元格位置
|
||||||
|
bool HitTestCell(const Point& pt, int* outRow, int* outCol) const;
|
||||||
|
|
||||||
|
// 根据坐标检测是否在列边界上(用于拖动调整列宽)
|
||||||
|
int HitTestColumnBorder(const Point& pt) const;
|
||||||
|
|
||||||
|
// 检测是否点击在垂直滚动条上
|
||||||
|
bool HitTestVScrollBar(const Point& pt);
|
||||||
|
|
||||||
|
// 检测是否点击在水平滚动条上
|
||||||
|
bool HitTestHScrollBar(const Point& pt);
|
||||||
|
|
||||||
|
// 绘制表头
|
||||||
|
void DrawHeader(PaintEventArgs& args);
|
||||||
|
|
||||||
|
// 绘制单元格
|
||||||
|
void DrawCells(PaintEventArgs& args);
|
||||||
|
|
||||||
|
// 绘制单个单元格
|
||||||
|
void DrawCell(PaintEventArgs& args, int row, int col, const Rect& cellRect);
|
||||||
|
|
||||||
|
// 绘制第一列
|
||||||
|
void DrawFirstColumn(PaintEventArgs& args, int row, const Rect& cellRect);
|
||||||
|
|
||||||
|
// 开始编辑单元格
|
||||||
|
void BeginEdit(int row, int col);
|
||||||
|
|
||||||
|
// 结束编辑
|
||||||
|
void EndEdit(bool save = true);
|
||||||
|
|
||||||
|
// 更新行高(根据内容)
|
||||||
|
void UpdateRowHeight(int row);
|
||||||
|
|
||||||
|
// 计算文本需要的行数
|
||||||
|
int CalculateTextLines(const UIString& text, int width) const;
|
||||||
|
|
||||||
|
// 刷新滚动条
|
||||||
|
void RefreshScrollBars();
|
||||||
|
|
||||||
|
// 滚动偏移处理
|
||||||
|
void OffsetX(int offset);
|
||||||
|
void OffsetY(int offset);
|
||||||
|
|
||||||
|
// 执行排序
|
||||||
|
void DoSort(int colIndex);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void OnPaint(PaintEventArgs& args) override;
|
||||||
|
virtual void OnChildPaint(PaintEventArgs& args) override;
|
||||||
|
virtual void OnLayout() override;
|
||||||
|
virtual void OnMouseMove(const MouseEventArgs& args) override;
|
||||||
|
virtual void OnMouseDown(const MouseEventArgs& args) override;
|
||||||
|
virtual void OnMouseUp(const MouseEventArgs& args) override;
|
||||||
|
virtual void OnMouseDoubleClick(const MouseEventArgs& args) override;
|
||||||
|
virtual void OnMouseWheel(const MouseEventArgs& args) override;
|
||||||
|
virtual void OnMouseLeave(const MouseEventArgs& args) override;
|
||||||
|
virtual void OnSize(const SizeEventArgs& args) override;
|
||||||
|
virtual void OnKeyDown(const KeyboardEventArgs& args) override;
|
||||||
|
virtual void OnKeyChar(const KeyboardEventArgs& args) override;
|
||||||
|
virtual const Size& GetContentSize() override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
// 选中行背景色(当第一列为CheckBox且被选中时使用,或者单击选中行时使用)
|
||||||
|
Color SelectedRowBackColor = Color(0xFFADD8E6); // 浅蓝色
|
||||||
|
|
||||||
|
/*
|
||||||
|
table->CellValueChanged = [](int row, int col, const UIString& value) {
|
||||||
|
// 处理内容变化
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
// 单元格内容变化回调(内容变化时立即触发)
|
||||||
|
// 参数: row, col, newValue
|
||||||
|
std::function<void(int, int, const UIString&)> CellValueChanged = nullptr;
|
||||||
|
|
||||||
|
/*
|
||||||
|
table->CellEditFinished = [](int row, int col, const UIString& oldValue, const UIString& newValue) {
|
||||||
|
// 处理内容变化
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
// 单元格编辑完成回调(编辑结束时触发,比如TextBox失去焦点或按Enter时)
|
||||||
|
// 参数: row, col, oldValue, newValue
|
||||||
|
std::function<void(int, int, const UIString&, const UIString&)> CellEditFinished = nullptr;
|
||||||
|
|
||||||
|
/*
|
||||||
|
tableView->RightClick= [tableView](int row, int col) {
|
||||||
|
// 处理内容变化
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
// 鼠标右键单击回调
|
||||||
|
// 参数: row, col (row=-1 表示点击在表头,col=-1 表示点击在第一列)
|
||||||
|
std::function<void(int, int)> RightClick = nullptr;
|
||||||
|
|
||||||
|
public:
|
||||||
|
TableView(Object* parentObject = nullptr);
|
||||||
|
virtual ~TableView();
|
||||||
|
|
||||||
|
// ============ 表头设置 ============
|
||||||
|
|
||||||
|
// 设置表头(传入表头名数组)
|
||||||
|
void SetHeaders(const std::vector<UIString>& headers);
|
||||||
|
|
||||||
|
// 获取表头数量(不包含第一列)
|
||||||
|
int GetColumnCount() const;
|
||||||
|
|
||||||
|
// 设置表头高度
|
||||||
|
void SetHeaderHeight(int height);
|
||||||
|
|
||||||
|
// 获取表头高度
|
||||||
|
int GetHeaderHeight() const;
|
||||||
|
|
||||||
|
// ============ 第一列设置 ============
|
||||||
|
|
||||||
|
// 设置第一列类型
|
||||||
|
void SetFirstColumnType(FirstColumnType type);
|
||||||
|
|
||||||
|
// 获取第一列类型
|
||||||
|
FirstColumnType GetFirstColumnType() const;
|
||||||
|
|
||||||
|
// 设置第一列宽度
|
||||||
|
void SetFirstColumnWidth(int width);
|
||||||
|
|
||||||
|
// 获取第一列宽度
|
||||||
|
int GetFirstColumnWidth() const;
|
||||||
|
|
||||||
|
// ============ 列设置 ============
|
||||||
|
|
||||||
|
// 设置某列宽度
|
||||||
|
void SetColumnWidth(int colIndex, int width);
|
||||||
|
|
||||||
|
// 获取某列宽度
|
||||||
|
int GetColumnWidth(int colIndex) const;
|
||||||
|
|
||||||
|
// 获取所有列宽
|
||||||
|
const std::vector<int> GetColumnWidths() const;
|
||||||
|
|
||||||
|
// 设置某列单元格类型
|
||||||
|
void SetColumnType(int colIndex, CellType type);
|
||||||
|
|
||||||
|
// 获取某列单元格类型
|
||||||
|
CellType GetColumnType(int colIndex) const;
|
||||||
|
|
||||||
|
// 设置某列的下拉选项(仅对 ComboBox 类型有效)
|
||||||
|
void SetColumnComboItems(int colIndex, const std::vector<UIString>& items);
|
||||||
|
|
||||||
|
// ============ 行设置 ============
|
||||||
|
|
||||||
|
// 获取行数
|
||||||
|
int GetRowCount() const;
|
||||||
|
|
||||||
|
// 添加行
|
||||||
|
void AddRow();
|
||||||
|
|
||||||
|
// 插入行
|
||||||
|
void InsertRow(int rowIndex);
|
||||||
|
|
||||||
|
// 删除行
|
||||||
|
void RemoveRow(int rowIndex);
|
||||||
|
|
||||||
|
// 清空所有行
|
||||||
|
void ClearRows();
|
||||||
|
|
||||||
|
// 添加列
|
||||||
|
void AddColumn(const UIString& headerText = L"", int width = 100);
|
||||||
|
|
||||||
|
// 插入列
|
||||||
|
void InsertColumn(int colIndex, const UIString& headerText = L"", int width = 100);
|
||||||
|
|
||||||
|
// 删除列
|
||||||
|
void RemoveColumn(int colIndex);
|
||||||
|
|
||||||
|
// 获取行高
|
||||||
|
int GetRowHeight(int rowIndex) const;
|
||||||
|
|
||||||
|
// 获取所有行高
|
||||||
|
const std::vector<int> GetRowHeights() const;
|
||||||
|
|
||||||
|
// 设置默认行高
|
||||||
|
void SetDefaultRowHeight(int height);
|
||||||
|
|
||||||
|
// ============ 数据操作 ============
|
||||||
|
|
||||||
|
// 设置单个单元格数据
|
||||||
|
void SetData(int row, int col, const UIString& value);
|
||||||
|
|
||||||
|
// 获取单个单元格数据
|
||||||
|
UIString GetData(int row, int col) const;
|
||||||
|
|
||||||
|
// 设置整行数据
|
||||||
|
void SetRowData(int row, const std::vector<UIString>& values);
|
||||||
|
|
||||||
|
// 获取整行数据
|
||||||
|
std::vector<UIString> GetRowData(int row) const;
|
||||||
|
|
||||||
|
// 获取整列数据
|
||||||
|
std::vector<UIString> GetColData(int col) const;
|
||||||
|
|
||||||
|
// 设置全部数据(二维数组)
|
||||||
|
void SetAllData(const std::vector<std::vector<UIString>>& data);
|
||||||
|
|
||||||
|
// 获取全部数据
|
||||||
|
std::vector<std::vector<UIString>> GetAllData() const;
|
||||||
|
|
||||||
|
// 设置单元格 CheckBox 状态
|
||||||
|
void SetCellChecked(int row, int col, bool checked);
|
||||||
|
|
||||||
|
// 获取单元格 CheckBox 状态
|
||||||
|
bool GetCellChecked(int row, int col) const;
|
||||||
|
|
||||||
|
// 设置单元格 ComboBox 选中索引
|
||||||
|
void SetCellComboIndex(int row, int col, int index);
|
||||||
|
|
||||||
|
// 获取单元格 ComboBox 选中索引
|
||||||
|
int GetCellComboIndex(int row, int col) const;
|
||||||
|
|
||||||
|
// ============ 行选中(第一列为CheckBox时) ============
|
||||||
|
|
||||||
|
// 设置某行选中状态
|
||||||
|
void SetRowChecked(int row, bool checked);
|
||||||
|
|
||||||
|
// 获取某行选中状态
|
||||||
|
bool GetRowChecked(int row) const;
|
||||||
|
|
||||||
|
// 获取所有选中的行索引
|
||||||
|
std::vector<int> GetCheckedRows() const;
|
||||||
|
|
||||||
|
// 获取当前选中的行(非CheckBox模式,通过单击第一列选中)
|
||||||
|
int GetSelectedRow() const;
|
||||||
|
|
||||||
|
// 设置当前选中的行(非CheckBox模式)
|
||||||
|
void SetSelectedRow(int row);
|
||||||
|
|
||||||
|
// 清除选中行(非CheckBox模式)
|
||||||
|
void ClearSelection();
|
||||||
|
|
||||||
|
// 全选
|
||||||
|
void SelectAll();
|
||||||
|
|
||||||
|
// 取消全选
|
||||||
|
void DeselectAll();
|
||||||
|
|
||||||
|
// ============ 样式设置 ============
|
||||||
|
|
||||||
|
// 设置统一单元格样式
|
||||||
|
void SetCellBorderSize(int size);
|
||||||
|
void SetCellBorderStyle(StrokeStyle style);
|
||||||
|
void SetCellBorderColor(const Color& color);
|
||||||
|
void SetCellBackColor(const Color& color);
|
||||||
|
void SetCellForeColor(const Color& color);
|
||||||
|
void SetCellFontSize(int size);
|
||||||
|
void SetCellFontFamily(const std::wstring& fontFamily);
|
||||||
|
|
||||||
|
// 设置单独单元格样式
|
||||||
|
void SetCellStyle(int row, int col, const CellStyle& style);
|
||||||
|
|
||||||
|
// 获取单独单元格样式
|
||||||
|
CellStyle GetCellStyle(int row, int col) const;
|
||||||
|
|
||||||
|
// 重置单独单元格样式(使用统一样式)
|
||||||
|
void ResetCellStyle(int row, int col);
|
||||||
|
|
||||||
|
// 设置表头样式
|
||||||
|
void SetHeaderBackColor(const Color& color);
|
||||||
|
void SetHeaderForeColor(const Color& color);
|
||||||
|
|
||||||
|
// ============ 对齐方式设置 ============
|
||||||
|
|
||||||
|
// 设置默认对齐方式(影响所有未单独设置对齐方式的单元格)
|
||||||
|
void SetDefaultTextAlign(TextAlign align);
|
||||||
|
|
||||||
|
// 设置某列的对齐方式
|
||||||
|
void SetColumnTextAlign(int colIndex, TextAlign align);
|
||||||
|
|
||||||
|
// 设置某行的对齐方式
|
||||||
|
void SetRowTextAlign(int rowIndex, TextAlign align);
|
||||||
|
|
||||||
|
// 设置单个单元格的对齐方式
|
||||||
|
void SetCellTextAlign(int row, int col, TextAlign align);
|
||||||
|
|
||||||
|
// 获取单元格的对齐方式(考虑优先级:单元格 > 行 > 列 > 默认)
|
||||||
|
TextAlign GetCellTextAlign(int row, int col) const;
|
||||||
|
|
||||||
|
// ============ 鼠标悬停信息 ============
|
||||||
|
|
||||||
|
// 获取鼠标当前悬停的行号(-1表示表头或未悬停在任何行)
|
||||||
|
int GetHoverRow() const;
|
||||||
|
|
||||||
|
// 获取鼠标当前悬停的列号(-1表示第一列或未悬停在任何列)
|
||||||
|
int GetHoverCol() const;
|
||||||
|
|
||||||
|
// 获取鼠标当前悬停的行列号(通过指针返回)
|
||||||
|
void GetHoverCell(int* outRow, int* outCol) const;
|
||||||
|
|
||||||
|
// ============ 滚动条 ============
|
||||||
|
|
||||||
|
virtual ScrollBar* GetVScrollBar();
|
||||||
|
virtual ScrollBar* GetHScrollBar();
|
||||||
|
|
||||||
|
// ============ 属性设置(XML支持) ============
|
||||||
|
|
||||||
|
virtual void SetAttribute(const UIString& key, const UIString& value) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
@@ -11,7 +11,8 @@ namespace ezui {
|
|||||||
VScrollBar m_vScrollbar;
|
VScrollBar m_vScrollbar;
|
||||||
int m_lastWidth = 0;
|
int m_lastWidth = 0;
|
||||||
int m_lastHeight = 0;
|
int m_lastHeight = 0;
|
||||||
bool m_multiLine = false;
|
bool m_autoWrap = false; // 是否允许文字超宽时自动换行
|
||||||
|
bool m_allowManualLineBreak = false; // 是否允许用户按Shift+Enter手动换行
|
||||||
std::wstring m_text;//文字
|
std::wstring m_text;//文字
|
||||||
Size m_fontBox;
|
Size m_fontBox;
|
||||||
bool m_down = false;//是否具有焦点中
|
bool m_down = false;//是否具有焦点中
|
||||||
@@ -39,12 +40,17 @@ namespace ezui {
|
|||||||
std::wstring m_placeholder;//placeholder懂得都懂 (在没有文字的情况下显示的文字)
|
std::wstring m_placeholder;//placeholder懂得都懂 (在没有文字的情况下显示的文字)
|
||||||
std::wstring m_passwordChar;
|
std::wstring m_passwordChar;
|
||||||
bool m_readOnly = false;//是否只读
|
bool m_readOnly = false;//是否只读
|
||||||
|
// 内边距(四边独立)
|
||||||
|
int m_padLeft = 6;
|
||||||
|
int m_padTop = 4;
|
||||||
|
int m_padRight = 6;
|
||||||
|
int m_padBottom = 4;
|
||||||
public:
|
public:
|
||||||
//文字对其方式(针对单行输入框有效)
|
//文字对其方式(针对单行输入框有效)
|
||||||
TextAlign TextAlign = TextAlign::MiddleLeft;
|
TextAlign TextAlign = TextAlign::MiddleLeft;
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
void InsertUnicode(const std::wstring& str);//插入unicode文字内部使用
|
void InsertUnicode(const std::wstring& str, bool isEnd = false);//插入unicode文字内部使用
|
||||||
bool DeleteRange();//删除选中内容
|
bool DeleteRange();//删除选中内容
|
||||||
bool GetSelectedRange(int* outPos, int* outCount);//获取当前被选中的区域 返回下标和个数
|
bool GetSelectedRange(int* outPos, int* outCount);//获取当前被选中的区域 返回下标和个数
|
||||||
bool Copy();//复制到剪切板
|
bool Copy();//复制到剪切板
|
||||||
@@ -69,28 +75,36 @@ namespace ezui {
|
|||||||
virtual void OnKillFocus(const KillFocusEventArgs& arg) override;
|
virtual void OnKillFocus(const KillFocusEventArgs& arg) override;
|
||||||
virtual void OnLayout();
|
virtual void OnLayout();
|
||||||
void Offset(int moveY);
|
void Offset(int moveY);
|
||||||
|
// 支持 TextBox 自身扩展样式属性(padding 系列)
|
||||||
|
virtual bool ApplyStyleProperty(const UIString& key, const UIString& value) override;
|
||||||
public:
|
public:
|
||||||
std::function<void(const UIString&)> TextChanged = NULL;
|
std::function<void(const UIString&)> TextChanged = NULL;
|
||||||
public:
|
public:
|
||||||
TextBox(Object* parentObject = NULL);
|
TextBox(Object* parentObject = NULL);
|
||||||
virtual ~TextBox();
|
virtual ~TextBox();
|
||||||
|
// 设置内边距 (兼容旧接口:水平=px, 垂直=py)
|
||||||
|
void SetPadding(int px, int py);
|
||||||
|
// 设置四边
|
||||||
|
void SetPadding4(int left, int top, int right, int bottom);
|
||||||
virtual void SetAttribute(const UIString& key, const UIString& value)override;
|
virtual void SetAttribute(const UIString& key, const UIString& value)override;
|
||||||
//获取焦点所在光标位置
|
//获取焦点所在光标位置
|
||||||
virtual Rect GetCareRect()override;
|
virtual Rect GetCareRect()override;
|
||||||
//分析字符串
|
//分析字符串
|
||||||
void Analysis();
|
void Analysis();
|
||||||
//在当前光标中插入文字
|
//在当前光标中插入文字
|
||||||
void Insert(const UIString& str);
|
void Insert(const UIString& str, bool isEnd = false);
|
||||||
//获取输入框文字
|
//获取输入框文字
|
||||||
const UIString GetText();
|
const UIString GetText();
|
||||||
//获取滚动条
|
//获取滚动条
|
||||||
virtual ScrollBar* GetScrollBar()override;
|
virtual ScrollBar* GetScrollBar()override;
|
||||||
//设置文字
|
//设置文字
|
||||||
void SetText(const UIString& text);
|
void SetText(const UIString& text);
|
||||||
//是否多行显示
|
//是否多行显示(兼容旧版:仅调用autoWrap参数)
|
||||||
bool IsMultiLine();
|
bool IsMultiLine();
|
||||||
//设置是否多行显示
|
//设置是否多行显示
|
||||||
void SetMultiLine(bool multiLine);
|
// autoWrap: 文字超宽时是否自动换行
|
||||||
|
// allowManualLineBreak: 是否允许用户按Shift+Enter手动换行
|
||||||
|
void SetMultiLine(bool autoWrap, bool allowManualLineBreak = false);
|
||||||
//设置为是否只读
|
//设置为是否只读
|
||||||
void SetReadOnly(bool bReadOnly);
|
void SetReadOnly(bool bReadOnly);
|
||||||
//是否为只读
|
//是否为只读
|
||||||
@@ -101,5 +115,7 @@ namespace ezui {
|
|||||||
void SetPlaceholderText(const UIString& text);
|
void SetPlaceholderText(const UIString& text);
|
||||||
//设置密码框占位符(建议单字符)
|
//设置密码框占位符(建议单字符)
|
||||||
void SetPasswordChar(const UIString& passwordChar);
|
void SetPasswordChar(const UIString& passwordChar);
|
||||||
|
// 设置焦点并初始化光标到指定位置(-1表示文本末尾)
|
||||||
|
void SetFocusAndCaret(int caretPos = -1);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include "ProgressBar.h"
|
#include "ProgressBar.h"
|
||||||
#include "Window.h"
|
#include "Window.h"
|
||||||
#include "ComboBox.h"
|
#include "ComboBox.h"
|
||||||
|
#include "TableView.h"
|
||||||
|
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
//主窗口中的内联页面类
|
//主窗口中的内联页面类
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "EzUI.h"
|
#include "EzUI.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Window.h"
|
#include "Window.h"
|
||||||
#include "Resource.h"
|
#include "Resource.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "EzUI.h"
|
#include "EzUI.h"
|
||||||
|
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Window.h"
|
#include "Window.h"
|
||||||
#include "ShadowBox.h"
|
#include "ShadowBox.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Label.h"
|
#include "Label.h"
|
||||||
|
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Label.h"
|
#include "Label.h"
|
||||||
|
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "TextBox.h"
|
#include "TextBox.h"
|
||||||
#include "Label.h"
|
#include "Label.h"
|
||||||
#include "VListView.h"
|
#include "VListView.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "EzUI.h"
|
#include "EzUI.h"
|
||||||
|
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "UIDef.h"
|
#include "UIDef.h"
|
||||||
#if USED_DIRECT2D
|
#if USED_DIRECT2D
|
||||||
#ifndef UI_EXPORT
|
#ifndef UI_EXPORT
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*/
|
/*/
|
||||||
Author:yang
|
Author:yang
|
||||||
Email:19980103ly@gmail.com/718987717@qq.com
|
Email:19980103ly@gmail.com/718987717@qq.com
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "EzUI.h"
|
#include "EzUI.h"
|
||||||
#include "UILoader.h"
|
#include "UILoader.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Control.h"
|
#include "Control.h"
|
||||||
|
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "PagedListView.h"
|
#include "PagedListView.h"
|
||||||
#include "HScrollBar.h"
|
#include "HScrollBar.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Control.h"
|
#include "Control.h"
|
||||||
#include "ScrollBar.h"
|
#include "ScrollBar.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Control.h"
|
#include "Control.h"
|
||||||
|
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "BorderlessWindow.h"
|
#include "BorderlessWindow.h"
|
||||||
#include "Bitmap.h"
|
#include "Bitmap.h"
|
||||||
#include "Task.h"
|
#include "Task.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "EzUI.h"
|
#include "EzUI.h"
|
||||||
|
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Menu.h"
|
#include "Menu.h"
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Control.h"
|
#include "Control.h"
|
||||||
|
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Control.h"
|
#include "Control.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Window.h"
|
#include "Window.h"
|
||||||
#include "BorderlessWindow.h"
|
#include "BorderlessWindow.h"
|
||||||
#include "LayeredWindow.h"
|
#include "LayeredWindow.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "CheckBox.h"
|
#include "CheckBox.h"
|
||||||
|
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "UIString.h"
|
#include "UIString.h"
|
||||||
|
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Control.h"
|
#include "Control.h"
|
||||||
#include "Animation.h"
|
#include "Animation.h"
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Window.h"
|
#include "Window.h"
|
||||||
#include "Bitmap.h"
|
#include "Bitmap.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Control.h"
|
#include "Control.h"
|
||||||
|
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Control.h"
|
#include "Control.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
#include "Animation.h"
|
#include "Animation.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "EzUI.h"
|
#include "EzUI.h"
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Control.h"
|
#include "Control.h"
|
||||||
#include "VScrollBar.h"
|
#include "VScrollBar.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "PagedListView.h"
|
#include "PagedListView.h"
|
||||||
#include "VScrollBar.h"
|
#include "VScrollBar.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "EzUI.h"
|
#include "EzUI.h"
|
||||||
#include "Task.h"
|
#include "Task.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "HListView.h"
|
#include "HListView.h"
|
||||||
#include "VListView.h"
|
#include "VListView.h"
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Control.h"
|
#include "Control.h"
|
||||||
#include "Spacer.h"
|
#include "Spacer.h"
|
||||||
#include "HLayout.h"
|
#include "HLayout.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "UILoader.h"
|
#include "UILoader.h"
|
||||||
|
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "UIDef.h"
|
#include "UIDef.h"
|
||||||
#include <codecvt>
|
#include <codecvt>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "EzUI.h"
|
#include "EzUI.h"
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
struct Style
|
struct Style
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Control.h"
|
#include "Control.h"
|
||||||
|
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "PagedListView.h"
|
#include "PagedListView.h"
|
||||||
#include "VScrollBar.h"
|
#include "VScrollBar.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Control.h"
|
#include "Control.h"
|
||||||
#include "ScrollBar.h"
|
#include "ScrollBar.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Control.h"
|
#include "Control.h"
|
||||||
#include "ScrollBar.h"
|
#include "ScrollBar.h"
|
||||||
#include "Spacer.h"
|
#include "Spacer.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
www.sourceforge.net/projects/tinyxml
|
www.sourceforge.net/projects/tinyxml
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
www.sourceforge.net/projects/tinyxml
|
www.sourceforge.net/projects/tinyxml
|
||||||
Original code by Lee Thomason (www.grinninglizard.com)
|
Original code by Lee Thomason (www.grinninglizard.com)
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ file(GLOB src ./ResPackage/*.*)
|
|||||||
add_executable(ResPackage WIN32 ${src} )
|
add_executable(ResPackage WIN32 ${src} )
|
||||||
target_include_directories(ResPackage PRIVATE ${include})
|
target_include_directories(ResPackage PRIVATE ${include})
|
||||||
target_link_libraries(ResPackage PRIVATE EzUI)
|
target_link_libraries(ResPackage PRIVATE EzUI)
|
||||||
|
set_property(TARGET ResPackage PROPERTY FOLDER "demo")
|
||||||
|
|
||||||
|
|
||||||
#仿QQ登录界面
|
#仿QQ登录界面
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "framework.h"
|
#include "framework.h"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
//{{NO_DEPENDENCIES}}
|
//{{NO_DEPENDENCIES}}
|
||||||
// Microsoft Visual C++ generated include file.
|
// Microsoft Visual C++ generated include file.
|
||||||
// Used by DemoUi.rc
|
// Used by DemoUi.rc
|
||||||
|
|
||||||
// <EFBFBD>¶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD>ֵ
|
// 新对象的下一组默认值
|
||||||
//
|
//
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|||||||
BIN
demo/QQ/QQ.APS
Normal file
BIN
demo/QQ/QQ.APS
Normal file
Binary file not shown.
195
demo/QQ/QQ.vcxproj
Normal file
195
demo/QQ/QQ.vcxproj
Normal file
@@ -0,0 +1,195 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<VCProjectVersion>17.0</VCProjectVersion>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<ProjectGuid>{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}</ProjectGuid>
|
||||||
|
<RootNamespace>QQ</RootNamespace>
|
||||||
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="Shared">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<OutDir>..\_bin\</OutDir>
|
||||||
|
<IntDir>..\_temp\$(Platform)$(Configuration)\$(ProjectName)\</IntDir>
|
||||||
|
<IncludePath>..\..\include;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>..\..\lib;$(LibraryPath)</LibraryPath>
|
||||||
|
<TargetName>$(ProjectName)_$(Configuration)_$(Platform)</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<OutDir>..\_bin\</OutDir>
|
||||||
|
<IntDir>..\_temp\$(Platform)$(Configuration)\$(ProjectName)\</IntDir>
|
||||||
|
<IncludePath>..\..\include;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>..\..\lib;$(LibraryPath)</LibraryPath>
|
||||||
|
<TargetName>$(ProjectName)_$(Configuration)_$(Platform)</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<OutDir>..\_bin\</OutDir>
|
||||||
|
<IntDir>..\_temp\$(Platform)$(Configuration)\$(ProjectName)\</IntDir>
|
||||||
|
<IncludePath>..\..\include;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>..\..\lib;$(LibraryPath)</LibraryPath>
|
||||||
|
<TargetName>$(ProjectName)_$(Configuration)_$(Platform)</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<OutDir>..\_bin\</OutDir>
|
||||||
|
<IntDir>..\_temp\$(Platform)$(Configuration)\$(ProjectName)\</IntDir>
|
||||||
|
<IncludePath>..\..\include;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>..\..\lib;$(LibraryPath)</LibraryPath>
|
||||||
|
<TargetName>$(ProjectName)_$(Configuration)_$(Platform)</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>EZUI_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>EzUI_$(Configuration)_$(Platform).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<ResourceCompile>
|
||||||
|
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ResourceCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>EZUI_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>EzUI_$(Configuration)_$(Platform).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<ResourceCompile>
|
||||||
|
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ResourceCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>EZUI_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>EzUI_$(Configuration)_$(Platform).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<ResourceCompile>
|
||||||
|
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ResourceCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>EZUI_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>EzUI_$(Configuration)_$(Platform).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<ResourceCompile>
|
||||||
|
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ResourceCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="loginForm.cpp" />
|
||||||
|
<ClCompile Include="main.cpp" />
|
||||||
|
<ClCompile Include="mainForm.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="loginForm.h" />
|
||||||
|
<ClInclude Include="mainForm.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="QQ.rc" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="res\head.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
46
demo/QQ/QQ.vcxproj.filters
Normal file
46
demo/QQ/QQ.vcxproj.filters
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="源文件">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="头文件">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="资源文件">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="loginForm.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="main.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="mainForm.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="loginForm.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="mainForm.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="QQ.rc">
|
||||||
|
<Filter>资源文件</Filter>
|
||||||
|
</ResourceCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="res\head.png">
|
||||||
|
<Filter>资源文件</Filter>
|
||||||
|
</Image>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
4
demo/QQ/QQ.vcxproj.user
Normal file
4
demo/QQ/QQ.vcxproj.user
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup />
|
||||||
|
</Project>
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "loginForm.h"
|
#include "loginForm.h"
|
||||||
|
#include "mainForm.h"
|
||||||
|
|
||||||
LoginForm::LoginForm() :LayeredWindow(320, 448)
|
LoginForm::LoginForm() :LayeredWindow(320, 448)
|
||||||
{
|
{
|
||||||
@@ -19,7 +20,10 @@ void LoginForm::OnNotify(Control* sender, EventArgs& args)
|
|||||||
UIString user = editUser->GetText();
|
UIString user = editUser->GetText();
|
||||||
UIString pwd = editpwd->GetText();
|
UIString pwd = editpwd->GetText();
|
||||||
if (user == "718987717" && pwd == "123456") {
|
if (user == "718987717" && pwd == "123456") {
|
||||||
::MessageBox(Hwnd(), L"登录成功!", L"提示", MB_OK);
|
// 登录成功,跳转到主界面
|
||||||
|
Hide(); // 隐藏登录窗口
|
||||||
|
static MainForm mainForm;
|
||||||
|
mainForm.Show(); // 显示主界面
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
::MessageBox(Hwnd(), L"用户名或密码错误!", L"提示", MB_OK);
|
::MessageBox(Hwnd(), L"用户名或密码错误!", L"提示", MB_OK);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ezui/Application.h" //app类
|
#include "ezui/Application.h" //app类
|
||||||
#include "EzUI/Window.h" //基础窗口类
|
#include "EzUI/Window.h" //基础窗口类
|
||||||
#include "EzUI/Button.h" //按钮
|
#include "EzUI/Button.h" //按钮
|
||||||
@@ -14,7 +14,6 @@
|
|||||||
#include "EzUI/LayeredWindow.h"//分层窗口类-可以异型透明窗口
|
#include "EzUI/LayeredWindow.h"//分层窗口类-可以异型透明窗口
|
||||||
#include "ezui/UIManager.h"//ui管理类(使用xml生成控件)
|
#include "ezui/UIManager.h"//ui管理类(使用xml生成控件)
|
||||||
|
|
||||||
#pragma comment(lib,"ezui.lib")
|
|
||||||
using namespace ezui;
|
using namespace ezui;
|
||||||
|
|
||||||
using Form = LayeredWindow; //支持异形透明窗口(带阴影)
|
using Form = LayeredWindow; //支持异形透明窗口(带阴影)
|
||||||
|
|||||||
38
demo/QQ/mainForm.cpp
Normal file
38
demo/QQ/mainForm.cpp
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
#include "mainForm.h"
|
||||||
|
|
||||||
|
void MainForm::OnNotify(Control* sender, EventArgs& args)
|
||||||
|
{
|
||||||
|
if (args.EventType == Event::OnMouseDown) {
|
||||||
|
if (sender->Name == "btnMin") {
|
||||||
|
SendMessage(Hwnd(), WM_SYSCOMMAND, SC_MINIMIZE, 0);
|
||||||
|
}
|
||||||
|
else if (sender->Name == "btnMax") {
|
||||||
|
if (IsZoomed(Hwnd())) {
|
||||||
|
SendMessage(Hwnd(), WM_SYSCOMMAND, SC_RESTORE, 0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
SendMessage(Hwnd(), WM_SYSCOMMAND, SC_MAXIMIZE, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (sender->Name == "btnClose") {
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
__super::OnNotify(sender, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainForm::OnClose(bool& close)
|
||||||
|
{
|
||||||
|
Application::Exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
MainForm::MainForm() : LayeredWindow(800, 600)
|
||||||
|
{
|
||||||
|
SetText(L"QQ主界面");
|
||||||
|
umg.LoadXml("res/mainForm.htm");
|
||||||
|
umg.SetupUI(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
MainForm::~MainForm()
|
||||||
|
{
|
||||||
|
}
|
||||||
35
demo/QQ/mainForm.h
Normal file
35
demo/QQ/mainForm.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "ezui/Application.h" //app类
|
||||||
|
#include "EzUI/Window.h" //基础窗口类
|
||||||
|
#include "EzUI/Button.h" //按钮
|
||||||
|
#include "EzUI/TextBox.h" //文本框
|
||||||
|
#include "EzUI/CheckBox.h" //复选框
|
||||||
|
#include "EzUI/PictureBox.h" //图片控件
|
||||||
|
#include "EzUI/TabLayout.h" //选项卡控件
|
||||||
|
#include "EzUI/VLayout.h" //垂直布局
|
||||||
|
#include "EzUI/HLayout.h"//水平布局
|
||||||
|
#include "EzUI/VListView.h"//垂直带滚动条列表
|
||||||
|
#include "EzUI/HListView.h"//水平带滚动条列表
|
||||||
|
#include "EzUI/TileListView.h"//瓦片列表
|
||||||
|
#include "EzUI/LayeredWindow.h"//分层窗口类-可以异型透明窗口
|
||||||
|
#include "ezui/UIManager.h"//ui管理类(使用xml生成控件)
|
||||||
|
#include "EzUI/LayeredWindow.h"
|
||||||
|
#include "EzUI/Label.h"
|
||||||
|
#include "EzUI/VLayout.h"
|
||||||
|
#include "EzUI/HLayout.h"
|
||||||
|
#include "EzUI/UIManager.h"
|
||||||
|
|
||||||
|
using namespace ezui;
|
||||||
|
|
||||||
|
// 主界面
|
||||||
|
class MainForm : public LayeredWindow
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
UIManager umg;
|
||||||
|
protected:
|
||||||
|
virtual void OnNotify(Control* sender, EventArgs& args) override;
|
||||||
|
virtual void OnClose(bool& close) override;
|
||||||
|
public:
|
||||||
|
MainForm();
|
||||||
|
virtual ~MainForm();
|
||||||
|
};
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 772 KiB After Width: | Height: | Size: 244 KiB |
18
demo/QQ/res/mainForm.htm
Normal file
18
demo/QQ/res/mainForm.htm
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<vlayout id="mainLayout" action="move">
|
||||||
|
<!-- 标题栏 -->
|
||||||
|
<hbox height="20" margin-top="5" action="move">
|
||||||
|
<spacer></spacer>
|
||||||
|
<!-- 退出按钮 -->
|
||||||
|
<button id="btnExitMain" size="20,20" style="background-image: url(res/close.png)"></button>
|
||||||
|
<spacer width="10"></spacer>
|
||||||
|
</hbox>
|
||||||
|
|
||||||
|
</vlayout>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#mainLayout {
|
||||||
|
background-color: #E8F0FF;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "FileSystem.h"
|
#include "FileSystem.h"
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
namespace File {
|
namespace File {
|
||||||
bool Exists(const UIString& filename) {
|
bool Exists(const UIString& filename) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "EzUI/EzUI.h"
|
#include "EzUI/EzUI.h"
|
||||||
#include "EzUI/UIString.h"
|
#include "EzUI/UIString.h"
|
||||||
namespace ezui {
|
namespace ezui {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "mainFrom.h"
|
#include "mainFrom.h"
|
||||||
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||||
_In_opt_ HINSTANCE hPrevInstance,
|
_In_opt_ HINSTANCE hPrevInstance,
|
||||||
_In_ LPWSTR lpCmdLine,
|
_In_ LPWSTR lpCmdLine,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "mainFrom.h"
|
#include "mainFrom.h"
|
||||||
#include "FileSystem.h"
|
#include "FileSystem.h"
|
||||||
|
|
||||||
const wchar_t* xml = LR"xml(
|
const wchar_t* xml = LR"xml(
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "EzUI/Application.h"
|
#include "EzUI/Application.h"
|
||||||
#include "EzUI/VLayout.h"
|
#include "EzUI/VLayout.h"
|
||||||
#include "EzUI/TextBox.h"
|
#include "EzUI/TextBox.h"
|
||||||
#include "EzUI/Button.h"
|
#include "EzUI/Button.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//WIN32 desktop application UI framework (2d graphical library:direct2d,后期可能会采用其他跨平台的2d图形库对整个UI框架进行跨平台)
|
//WIN32 desktop application UI framework (2d graphical library:direct2d,后期可能会采用其他跨平台的2d图形库对整个UI框架进行跨平台)
|
||||||
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "desktopLrcFrm.h"
|
#include "desktopLrcFrm.h"
|
||||||
|
|
||||||
HWND GetDeskTopWnd() {
|
HWND GetDeskTopWnd() {
|
||||||
HWND windowHandle = ::FindWindowW(L"Progman", L"Program Manager");
|
HWND windowHandle = ::FindWindowW(L"Progman", L"Program Manager");
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "lrcPanel.h"
|
#include "lrcPanel.h"
|
||||||
#include "VlcPlayer.h"
|
#include "VlcPlayer.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "mainFrm.h"
|
#include "mainFrm.h"
|
||||||
MainFrm::MainFrm() :Form(1020, 690)
|
MainFrm::MainFrm() :Form(1020, 690)
|
||||||
{
|
{
|
||||||
InitForm();
|
InitForm();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "widgets.h"
|
#include "widgets.h"
|
||||||
#include "vlcPlayer.h"
|
#include "vlcPlayer.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "vlcPlayer.h"
|
#include "vlcPlayer.h"
|
||||||
void* lock_cb(void* opaque, void** planes)
|
void* lock_cb(void* opaque, void** planes)
|
||||||
{
|
{
|
||||||
VlcPlayer* vp = (VlcPlayer*)opaque;
|
VlcPlayer* vp = (VlcPlayer*)opaque;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "EzUI/Control.h"
|
#include "EzUI/Control.h"
|
||||||
#include "EzUI/BorderlessWindow.h"
|
#include "EzUI/BorderlessWindow.h"
|
||||||
#include "EzUI/Label.h"
|
#include "EzUI/Label.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
base64.cpp and base64.h
|
base64.cpp and base64.h
|
||||||
base64 encoding and decoding with C++.
|
base64 encoding and decoding with C++.
|
||||||
More information at
|
More information at
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user