Compare commits
3 Commits
b71f601088
...
26-2-25-2
| Author | SHA1 | Date | |
|---|---|---|---|
| 269412b371 | |||
| 78fa2665b0 | |||
| cf51900c96 |
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"permissions": {
|
"permissions": {
|
||||||
"allow": [
|
"allow": [
|
||||||
"Bash(cmake:*)"
|
"mcp__ide__getDiagnostics"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
# EditorConfig helps maintain consistent coding styles
|
|
||||||
# https://editorconfig.org
|
|
||||||
|
|
||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
|
||||||
charset = utf-8-bom
|
|
||||||
end_of_line = crlf
|
|
||||||
insert_final_newline = true
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
|
|
||||||
[*.{cpp,h,hpp}]
|
|
||||||
indent_style = tab
|
|
||||||
|
|
||||||
[*.{json,xml,yml,yaml,md}]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
18
.gitignore
vendored
@@ -1,14 +1,20 @@
|
|||||||
|
################################################################################
|
||||||
|
# 此 .gitignore 文件已由 Microsoft(R) Visual Studio 自动创建。
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
ThirdParty/
|
||||||
|
_temp/
|
||||||
|
_bin/
|
||||||
|
.vs/
|
||||||
/build
|
/build
|
||||||
/build_x64
|
/build_x64
|
||||||
/build_x86
|
/example
|
||||||
/demo
|
/demo
|
||||||
/_temp
|
|
||||||
/_bin
|
|
||||||
/lib
|
/lib
|
||||||
/temp
|
|
||||||
/bin
|
|
||||||
/.vs
|
/.vs
|
||||||
|
/.vscode
|
||||||
*.db
|
*.db
|
||||||
*.gitignore
|
*.gitignore
|
||||||
*.gitattributes
|
*.gitattributes
|
||||||
*.tlog
|
*.exe
|
||||||
|
*.pdb
|
||||||
14
.vscode/settings.json
vendored
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"files.encoding": "utf8",
|
|
||||||
"files.autoGuessEncoding": false,
|
|
||||||
"editorconfig.enable": true,
|
|
||||||
"[cpp]": {
|
|
||||||
"files.encoding": "utf8-bom"
|
|
||||||
},
|
|
||||||
"[h]": {
|
|
||||||
"files.encoding": "utf8-bom"
|
|
||||||
},
|
|
||||||
"[c]": {
|
|
||||||
"files.encoding": "utf8-bom"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
169
CLAUDE.md
@@ -2,114 +2,97 @@
|
|||||||
|
|
||||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||||
|
|
||||||
## Project Overview
|
## 项目概述
|
||||||
|
|
||||||
EzUI is a Windows desktop UI framework built on Direct2D. It provides a C++ API for creating modern Windows applications with custom controls, layouts, and styling.
|
EzUI 是一个基于原生 Win32 消息机制和 Direct2D 的 C++ 桌面 UI 框架,提供类似 Web 前端的 CSS 样式系统和弹性布局。
|
||||||
|
|
||||||
## Build Commands
|
## 构建命令
|
||||||
|
|
||||||
The project uses CMake for building. Prebuilt libraries exist in `lib/` for both x64 and x86 architectures.
|
|
||||||
|
|
||||||
### Build Static Library (EzUI)
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Generate and build Debug x64
|
# 生成 Visual Studio 项目(推荐)
|
||||||
cmake -G "Visual Studio 17 2022" -A x64 -S . -B build/x64
|
cmake -S . -B build_x86 -A Win32 # 32位 VS 项目
|
||||||
cmake --build build/x64 --config Debug
|
cmake -S . -B build_x64 -A x64 # 64位 VS 项目
|
||||||
|
|
||||||
# Generate and build Release x64
|
# 或使用现有的批处理脚本
|
||||||
cmake -G "Visual Studio 17 2022" -A x64 -S . -B build/x64
|
build_x86.bat # 生成 32 位项目并打开
|
||||||
cmake --build build/x64 --config Release
|
build_x64.bat # 生成 64 位项目并打开
|
||||||
|
|
||||||
# Or use build.bat to build all configurations at once
|
|
||||||
build.bat
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Build Demos
|
CMake 构建:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Build demos (from demo/ directory)
|
cmake -B build
|
||||||
cd demo
|
cmake --build build
|
||||||
mkdir build && cd build
|
|
||||||
cmake ..
|
|
||||||
cmake --build . --config Debug/Release
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Key demo projects in `demo/`:
|
静态库/动态库切换:
|
||||||
- `helloWorld` - Basic controls demo
|
```bash
|
||||||
- `QQ` - QQ-style login UI demo
|
cmake -B build -DBUILD_SHARED_LIBS=ON # 动态库
|
||||||
- `kugou` - Kugou music player demo
|
cmake -B build -DBUILD_SHARED_LIBS=OFF # 静态库(默认)
|
||||||
- `TableViewDemo` - TableView control demo
|
|
||||||
|
|
||||||
## Architecture
|
|
||||||
|
|
||||||
### Core Classes
|
|
||||||
|
|
||||||
- **Window** ([include/EzUI/Window.h](include/EzUI/Window.h)) - Top-level window, inherits from Object, manages HWND, handles message loop
|
|
||||||
- **Control** ([include/EzUI/Control.h](include/EzUI/Control.h)) - Base class for all UI elements, contains m_controls (child collection), Style/HoverStyle/ActiveStyle/DisabledStyle
|
|
||||||
- **Application** ([include/EzUI/Application.h](include/EzUI/Application.h)) - Manages message loop, resource loading, high DPI
|
|
||||||
|
|
||||||
### Layout System
|
|
||||||
|
|
||||||
- **HLayout** - Horizontal layout container
|
|
||||||
- **VLayout** - Vertical layout container
|
|
||||||
- Uses DockStyle (None, Horizontal, Vertical, Fill) for child control positioning
|
|
||||||
- Layout state machine: None → Pend → Layouting → None
|
|
||||||
|
|
||||||
### Rendering
|
|
||||||
|
|
||||||
- **DXRender** (Direct2D) handles all graphics
|
|
||||||
- Paint pipeline: OnPaintBefore → OnBackgroundPaint → OnForePaint → OnBorderPaint → OnChildPaint
|
|
||||||
- Uses PushLayer/PopLayer for clipping regions
|
|
||||||
- Color uses BGRA format internally
|
|
||||||
|
|
||||||
### Control Hierarchy
|
|
||||||
|
|
||||||
```
|
|
||||||
Object
|
|
||||||
├── Control (base for all widgets)
|
|
||||||
│ ├── Window (top-level, owns HWND)
|
|
||||||
│ ├── BorderlessWindow
|
|
||||||
│ ├── LayeredWindow
|
|
||||||
│ ├── PopupWindow
|
|
||||||
│ ├── Label
|
|
||||||
│ ├── Button
|
|
||||||
│ ├── TextBox
|
|
||||||
│ ├── ComboBox
|
|
||||||
│ ├── CheckBox
|
|
||||||
│ ├── RadioButton
|
|
||||||
│ ├── PictureBox
|
|
||||||
│ ├── ProgressBar
|
|
||||||
│ ├── Menu
|
|
||||||
│ ├── ScrollBar / HScrollBar / VScrollBar
|
|
||||||
│ ├── HLayout / VLayout
|
|
||||||
│ ├── HListView / VListView / TileListView / PagedListView
|
|
||||||
│ ├── TreeView
|
|
||||||
│ ├── TableView
|
|
||||||
│ └── TabLayout
|
|
||||||
└── IFrame (container frame)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Event System
|
## 核心架构
|
||||||
|
|
||||||
Events defined in [include/EzUI/EzUI.h](include/EzUI/EzUI.h):
|
### 窗口类型 (继承层次)
|
||||||
- Mouse: OnMouseDown, OnMouseUp, OnMouseMove, OnMouseEnter, OnMouseLeave, OnMouseWheel, OnMouseDoubleClick
|
- `Window` - 经典带边框窗口
|
||||||
- Keyboard: OnKeyDown, OnKeyUp, OnKeyChar
|
- `BorderlessWindow` - 无边框带阴影窗口
|
||||||
- Focus: OnFocus, OnKillFocus
|
- `LayeredWindow` - 分层透明窗口,支持异形
|
||||||
- Paint: OnPaint
|
- `PopupWindow` - 失焦自动关闭的弹出窗口
|
||||||
- Layout: OnMove, OnSize
|
|
||||||
|
|
||||||
ControlState enum: None, Static, Disabled, Checked, Hover, Active
|
### 控件系统
|
||||||
|
所有控件继承自 `Control` 基类,核心控件包括:
|
||||||
|
- 基础控件:`Label`, `Button`, `TextBox`, `PictureBox`
|
||||||
|
- 选择控件:`CheckBox`, `RadioButton`, `ComboBox`
|
||||||
|
- 布局容器:`HLayout`, `VLayout`, `HListView`, `VListView`, `TileListView`, `TabLayout`
|
||||||
|
- 功能控件:`ScrollBar`, `Menu`, `NotifyIcon`, `ProgressBar`, `TreeView`, `Spacer`, `TableView`, `IFrame`
|
||||||
|
|
||||||
### Key Patterns
|
### 布局系统
|
||||||
|
- **尺寸优先级**:比例尺寸 (`SetRateWidth/Height`) > 绝对尺寸 (`SetFixedSize`) > 控件内容大小
|
||||||
|
- **自动布局**:`SetAutoWidth/Height` 让控件根据内容自动调整大小
|
||||||
|
- **停靠布局**:`SetDockStyle` 支持 Fill/Vertical/Horizontal 停靠
|
||||||
|
- **布局状态**:`TryPendLayout`/`ResumeLayout` 批量添加控件后统一布局
|
||||||
|
|
||||||
1. **Thread Safety**: Use `BeginInvoke()` and `Invoke()` for cross-thread UI updates (uses hidden message window)
|
### 样式与渲染
|
||||||
2. **Memory Management**: Controls can be parented - parent deletes children. Use `Attach()` / `Detach()` for resource management
|
- `UIManager` - UI 样式与资源管理,支持 XML 布局加载
|
||||||
3. **Styling**: ControlStyle supports inheritance. Use SetStyleSheet() for CSS-like styling
|
- `UISelector` - CSS 选择器匹配系统
|
||||||
4. **XML Loading**: Window::LoadXml() loads UI from XML files
|
- `Direct2DRender` - Direct2D 绘图实现
|
||||||
|
- `RenderTypes` - 颜色、对齐方式等绘图类型
|
||||||
|
|
||||||
### File Organization
|
### 事件系统
|
||||||
|
- 支持事件冒泡机制,可实现事件捕获与穿透
|
||||||
|
- `NotifyFlags` 控制控件哪些事件需要通知窗口
|
||||||
|
- `Event` 枚举定义所有事件类型,支持位运算组合
|
||||||
|
- Debug 模式下按 F11 可查看布局信息和控件边界
|
||||||
|
|
||||||
- `include/EzUI/` - Public headers
|
### 线程模型
|
||||||
- `sources/` - Implementation files
|
- UI 线程:`Application::Run` 启动消息循环
|
||||||
- `lib/` - Prebuilt static libraries (EzUI_Debug/Release_{Win32,x64}.lib)
|
- 跨线程调用:`BeginInvoke`(异步)/ `Invoke`(同步)
|
||||||
|
- 全局隐藏窗口 `__EzUI_MessageWnd` 用于线程通讯
|
||||||
|
|
||||||
|
### 动画系统
|
||||||
|
- `Animation` 类支持类似 Qt 的过渡动画
|
||||||
|
- 可用于控件属性(位置、大小、透明度等)的平滑过渡
|
||||||
|
|
||||||
|
### 资源管理
|
||||||
|
- 控件树内存由父控件自动管理:`Attach`/`Detach`
|
||||||
|
- 图片资源通过 `PtrManager` 自动释放
|
||||||
|
- XML 布局加载后由 `UIManager` 管理生命周期
|
||||||
|
- `ResPackage.exe` 工具用于打包资源文件
|
||||||
|
|
||||||
|
## Demo 示例
|
||||||
|
|
||||||
|
Demo 位于 `demo/` 目录:
|
||||||
|
- `helloWorld` - 基础 HelloWorld 示例
|
||||||
|
- `QQ` - 仿 QQ 登录界面
|
||||||
|
- `kugou` - 仿酷狗音乐播放器(需要 VLC 解码库)
|
||||||
|
|
||||||
|
Demo 新版位于 `demoEx/` 目录:
|
||||||
|
- `Adminstor` - 用户管理 界面示例
|
||||||
|
|
||||||
|
## 开发约定
|
||||||
|
|
||||||
|
- 头文件位于 `include/EzUI/` 目录
|
||||||
|
- 源文件位于 `sources/` 目录
|
||||||
|
- 一切皆控件,纯代码组合 UI
|
||||||
|
- 使用 CSS 驱动视觉,结构与样式分离
|
||||||
|
- 中文注释,中文沟通
|
||||||
|
- 每次编码完毕无需编译,让用户自行编译验证
|
||||||
|
|||||||
116
CMakeLists.txt
@@ -1,76 +1,50 @@
|
|||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.0...9.0)
|
||||||
|
|
||||||
|
if(UNIX)
|
||||||
|
add_compile_options(-finput-charset=UTF-8)
|
||||||
|
add_compile_options(-fexec-charset=UTF-8)
|
||||||
|
elseif(WIN32)
|
||||||
|
add_compile_options(/utf-8)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(tag $<IF:$<CONFIG:Debug>,Debug,Release>)
|
||||||
|
|
||||||
|
#让所有项目都使用UNICODE
|
||||||
|
add_definitions(-D_UNICODE -DUNICODE)
|
||||||
|
|
||||||
project(EzUI)
|
project(EzUI)
|
||||||
|
|
||||||
# Set C++ standard
|
file(GLOB src ./include/EzUI/*.* ./sources/*.* )
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
# 添加一个选项,供用户选择构建静态库或动态库
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
option(BUILD_SHARED_LIBS "Build shared library instead of static library" OFF)
|
||||||
|
if(BUILD_SHARED_LIBS)
|
||||||
|
add_library(EzUI SHARED ${src})
|
||||||
|
else()
|
||||||
|
add_library(EzUI STATIC ${src})
|
||||||
|
target_compile_definitions(EzUI PUBLIC EZUI_STATIC)
|
||||||
|
endif()
|
||||||
|
target_include_directories(EzUI PRIVATE ./include/EzUI)
|
||||||
|
set_target_properties(EzUI PROPERTIES LINKER_LANGUAGE CXX)
|
||||||
|
|
||||||
# Set available configurations
|
# 定义函数: 添加资源打包任务并关联到指定项目
|
||||||
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
|
function(add_resource_package TARGET_NAME INPUT_DIR OUTPUT_FILE)
|
||||||
|
set (ProjectName ${TARGET_NAME}_EzUI_ResourcePackager)
|
||||||
|
# 定义始终运行的伪目标
|
||||||
|
add_custom_target(
|
||||||
|
${ProjectName} # 更简洁的目标命名
|
||||||
|
COMMAND ${CMAKE_SOURCE_DIR}/ResPackage.exe -package ${CMAKE_CURRENT_SOURCE_DIR}/${INPUT_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${OUTPUT_FILE}
|
||||||
|
COMMENT "Packaging resources for ${TARGET_NAME}..."
|
||||||
|
)
|
||||||
|
# 将目标归类到专用文件夹
|
||||||
|
set_target_properties(${ProjectName} PROPERTIES
|
||||||
|
FOLDER "CMakePredefinedTargets" # 在VS中归类到指定文件夹
|
||||||
|
)
|
||||||
|
# 主目标依赖伪目标
|
||||||
|
add_dependencies(${TARGET_NAME} ${ProjectName})
|
||||||
|
endfunction()
|
||||||
|
|
||||||
# Output directory for libraries - directly to lib/
|
#添加子项目
|
||||||
# Use per-configuration output directories for Visual Studio generators
|
option(BUILD_DEMO "Build demo projects" ON)
|
||||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/lib)
|
if(BUILD_DEMO)
|
||||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/lib)
|
add_subdirectory(./demo)
|
||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/lib)
|
endif()
|
||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/lib)
|
|
||||||
|
|
||||||
# Include directories - sources use #include "Control.h" style
|
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/include/EzUI)
|
|
||||||
|
|
||||||
# Source files
|
|
||||||
file(GLOB SOURCES
|
|
||||||
${CMAKE_SOURCE_DIR}/sources/*.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create static library
|
|
||||||
add_library(EzUI STATIC ${SOURCES})
|
|
||||||
|
|
||||||
# Preprocessor definition for static library
|
|
||||||
target_compile_definitions(EzUI PRIVATE EZUI_STATIC)
|
|
||||||
|
|
||||||
# Additional system libraries required
|
|
||||||
target_link_libraries(EzUI PRIVATE
|
|
||||||
gdiplus.lib
|
|
||||||
dwrite.lib
|
|
||||||
d2d1.lib
|
|
||||||
Windowscodecs.lib
|
|
||||||
shlwapi.lib
|
|
||||||
imm32.lib
|
|
||||||
)
|
|
||||||
|
|
||||||
# Windows-specific settings
|
|
||||||
add_definitions(-D_UNICODE)
|
|
||||||
add_definitions(-DUNICODE)
|
|
||||||
add_definitions(-DWIN32_LEAN_AND_MEAN)
|
|
||||||
|
|
||||||
# Force UTF-8 encoding for source files to avoid encoding issues
|
|
||||||
# when editing in VSCode and building in VS2022
|
|
||||||
add_compile_options(/utf-8)
|
|
||||||
|
|
||||||
# Set runtime library: MTD for Debug, MT for Release
|
|
||||||
# This ensures static linking to the C/C++ runtime
|
|
||||||
set_target_properties(EzUI PROPERTIES
|
|
||||||
# Debug: MultiThreadedDebug (MTD)
|
|
||||||
# Release: MultiThreaded (MT)
|
|
||||||
DEBUG_POSTFIX ""
|
|
||||||
)
|
|
||||||
|
|
||||||
# Set output name based on configuration and platform
|
|
||||||
# Debug|Win32 -> EzUI_Debug_Win32.lib
|
|
||||||
# Debug|x64 -> EzUI_Debug_x64.lib
|
|
||||||
# Release|Win32 -> EzUI_Release_Win32.lib
|
|
||||||
# Release|x64 -> EzUI_Release_x64.lib
|
|
||||||
set_target_properties(EzUI PROPERTIES
|
|
||||||
OUTPUT_NAME_DEBUG "EzUI_Debug_$(Platform)"
|
|
||||||
OUTPUT_NAME_RELEASE "EzUI_Release_$(Platform)"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Explicitly set runtime library per configuration
|
|
||||||
# Debug: MTD (MultiThreadedDebug) - static
|
|
||||||
# Release: MT (MultiThreaded) - static
|
|
||||||
target_compile_options(EzUI PRIVATE
|
|
||||||
$<$<CONFIG:Debug>:/MTd>
|
|
||||||
$<$<CONFIG:Release>:/MT>
|
|
||||||
)
|
|
||||||
|
|||||||
199
README.md
Normal file
@@ -0,0 +1,199 @@
|
|||||||
|
# EzUI
|
||||||
|
|
||||||
|
**EzUI** 是一个基于原生 Win32 消息机制和 Direct2D 的高性能桌面 UI 框架,具备强大的弹性布局、伪类样式支持和控件系统,目标是提供如 Web 前端般灵活、直观的界面开发体验。
|
||||||
|
|
||||||
|
> 🚀 支持高 DPI、分层窗口、响应式布局、CSS 风格皮肤、GIF 动画、控件组合与继承机制。未来将支持跨平台 2D 图形库扩展。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✨ 框架特色
|
||||||
|
|
||||||
|
- 🪱 **基于 Win32 消息机制**:轻量、无依赖,逻辑控件系统拦截并下发鼠标键盘消息
|
||||||
|
- 🎨 **2D 图形绘制**:当前基于 Direct2D 绘图,具备高性能、高分辨率适配能力。
|
||||||
|
- 🧹 **弹性布局系统**:支持自动宽高、自适应布局,开发体验类比前端 Flex 设计。
|
||||||
|
- 🎭 **伪类 CSS 支持**:支持 `hover`、`active`、`checked` 等状态样式,类选择器、ID 选择器、组合选择器等完整选择器系统。
|
||||||
|
- 🌟 **控件组合系统**:Label、Button、TextBox、CheckBox、RadioButton 等丰富控件可自由组合构建 UI。
|
||||||
|
- 💡 **事件系统**:支持事件冒泡机制,可实现事件捕获与穿透。
|
||||||
|
- 🧩 **高 DPI 适配**:框架自动处理 DPI 缩放与坐标换算,支持多显示器高分屏。
|
||||||
|
- 🪪 **多种窗口类型支持**:
|
||||||
|
- `Window`:经典边框窗口 windows自动发送`WM_PAINT`消息绘制
|
||||||
|
- `BorderlessWindow`:无边框、带阴影 windows自动发送`WM_PAINT`消息绘制
|
||||||
|
- `LayeredWindow`:分层透明窗口,支持异形与实时重绘 手动发送 `WM_PAINT`消息进行绘制
|
||||||
|
- `PopupWindow`:失焦自动关闭的弹出窗口,适用于菜单等
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📆 快速开始
|
||||||
|
|
||||||
|
### 1. 下载源码
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/NewYoungCode/EzUI.git
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. 安装 CMake
|
||||||
|
|
||||||
|
请前往 [CMake 官网](https://cmake.org/download/) 下载安装。
|
||||||
|
|
||||||
|
### 3. 构建与运行
|
||||||
|
|
||||||
|
- 构建 32 位项目:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
build.bat
|
||||||
|
```
|
||||||
|
|
||||||
|
- 构建 64 位项目:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
build64.bat
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📀 使用说明
|
||||||
|
|
||||||
|
### 🏁 程序入口
|
||||||
|
|
||||||
|
请在 `WinMain` 函数中创建 `Application` 实例并调用 `app.Exec()` 以启动消息循环:
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
#include <Windows.h>
|
||||||
|
#include "EzUI/UIManager.h"
|
||||||
|
#include "Ezui/Window.h"
|
||||||
|
#include "Ezui/Application.h"
|
||||||
|
|
||||||
|
using namespace ezui;
|
||||||
|
|
||||||
|
class TestForm :public Window {
|
||||||
|
private:
|
||||||
|
UIManager umg;//ui管理器
|
||||||
|
public:
|
||||||
|
TestForm() :Window(800, 600) {
|
||||||
|
//umg.LoadXmlFile("res/form.htm");//从文件中加载xml界面
|
||||||
|
umg.LoadXmlData("<vbox> <label text=\"hello world\"></label> </vbox>");//从内存中加载布局
|
||||||
|
umg.SetupUI(this);//设置ui
|
||||||
|
}
|
||||||
|
virtual ~TestForm() {
|
||||||
|
}
|
||||||
|
virtual void OnClose(bool& bClose) override {
|
||||||
|
int result = ::MessageBoxW(frm.Hwnd(), L"要退出程序吗?", L"提示", MB_YESNO | MB_ICONQUESTION);
|
||||||
|
if (result == IDYES) {
|
||||||
|
Application::Exit(0);//当窗口关闭时 整个程序退出
|
||||||
|
} else {
|
||||||
|
bClose=false; // 用户点击了“否” 此标志设置为false将不会关闭
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//程序入口;
|
||||||
|
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||||
|
_In_opt_ HINSTANCE hPrevInstance,
|
||||||
|
_In_ LPWSTR lpCmdLine,
|
||||||
|
_In_ int nCmdShow)
|
||||||
|
{
|
||||||
|
|
||||||
|
Application app;
|
||||||
|
|
||||||
|
TestForm testForm;
|
||||||
|
testForm.SetText(L"我是测试窗口");
|
||||||
|
testForm.Show(nCmdShow);
|
||||||
|
|
||||||
|
return app.Exec();
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
### 🧱 控件与组件列表(部分)
|
||||||
|
|
||||||
|
- `Application`:EzUI 应用入口与消息循环控制器
|
||||||
|
- `Window`:经典 Win32 边框窗口
|
||||||
|
- `BorderlessWindow`:无边框带阴影窗口
|
||||||
|
- `LayeredWindow`:支持透明和异形的分层窗口
|
||||||
|
- `PopupWindow`:失焦自动关闭的弹出窗口
|
||||||
|
- `Control`:所有控件基础类,封装鼠标命中、事件分发和重绘逻辑
|
||||||
|
- `Label`:文字标签控件
|
||||||
|
- `Button`:标准按钮控件
|
||||||
|
- `TextBox`:文本输入框
|
||||||
|
- `CheckBox` / `RadioButton`:复选框 / 单选框控件
|
||||||
|
- `PictureBox`:图片显示控件,支持 GIF
|
||||||
|
- `ComboBox`:下拉框控件
|
||||||
|
- `Menu`:菜单支持
|
||||||
|
- `NotifyIcon`:托盘图标支持
|
||||||
|
- `ScrollBar` / `HScrollBar` / `VScrollBar`:滚动条组件
|
||||||
|
- `HLayout` / `VLayout`:水平/垂直布局容器
|
||||||
|
- `HListView` / `VListView`:横向/纵向列表视图容器
|
||||||
|
- `TileListView`:瓦片式列表视图
|
||||||
|
- `TabLayout`:选项卡切换容器
|
||||||
|
- `Spacer`:空隙组件,占位用
|
||||||
|
- `ShadowBox`:为无边框窗口提供窗口阴影
|
||||||
|
- `IFrame`:内嵌页面控件,功能类似 Web 前端中的 `<iframe>`
|
||||||
|
- `UIDef`:框架内使用的宏定义集合
|
||||||
|
- `UIManager`:UI 样式与资源统一管理
|
||||||
|
- `UISelector`:选择器匹配系统,实现类选择器、链式查询控件
|
||||||
|
- `UIString` / `tinystr.h` / `tinyxml.h`:字符串处理与 XML 配置解析支持
|
||||||
|
- `RenderTypes`:绘图相关类型定义(颜色、对齐方式等)
|
||||||
|
- `Direct2DRender`:Direct2D 绘图实现类
|
||||||
|
- `Bitmap`:图像资源封装
|
||||||
|
- `Resource.h`:自定义资源管理类(非 VS rc 文件),用于手动加载与管理框架资源
|
||||||
|
- `Timer` / `Task`:定时与异步任务处理辅助类
|
||||||
|
- `EzUI.h`:框架主接口头文件,定义事件类、枚举、全局资源等核心结构
|
||||||
|
- `Animation.h`:类似于QT的那种过渡动画
|
||||||
|
|
||||||
|
### 🎨 样式示例
|
||||||
|
|
||||||
|
```css
|
||||||
|
#submitBtn {
|
||||||
|
width: 100px; /*静态样式时支持调整大小*/
|
||||||
|
height: 30px; /*静态样式时支持调整大小*/
|
||||||
|
background-color: #0078d7;
|
||||||
|
}
|
||||||
|
|
||||||
|
#submitBtn:hover {
|
||||||
|
background-color: #005a9e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.classA .classB { /*多选择器*/
|
||||||
|
color:#ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
label{ /*标签选择器*/
|
||||||
|
color:#ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.check:checked {
|
||||||
|
border:1px;
|
||||||
|
border-radius:10px;
|
||||||
|
border-color: #005a9e;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔧 调试技巧
|
||||||
|
|
||||||
|
- 在 Debug 模式下运行时,按下 `F11` 可实时查看布局信息,高亮显示控件边界。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🧬 开发理念
|
||||||
|
|
||||||
|
- **“一切皆控件”**:无 UI 描述文件,纯代码式组件组合;
|
||||||
|
- **“CSS 驱动视觉”**:结构和样式分离;
|
||||||
|
- **“面向前端思维”**:布局、交互风格向 Web 靠拟;
|
||||||
|
- **“跨平台可拟扩”**:绘图模块可替换(未来可能会使用跨平台图形库);
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📖 学习 & 技术支持
|
||||||
|
|
||||||
|
- 视频教程:https://space.bilibili.com/240269358/video
|
||||||
|
- QQ:718987717
|
||||||
|
- QQ群:758485934
|
||||||
|
- 邮箱:[19980103ly@gmail.com]/[19980103ly@gmail.com]
|
||||||
|
- 微信:wx19980103yon
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📄 License
|
||||||
|
|
||||||
|
|
||||||
81
build.bat
@@ -1,81 +0,0 @@
|
|||||||
@echo off
|
|
||||||
chcp 65001 >nul
|
|
||||||
setlocal
|
|
||||||
|
|
||||||
echo ========================================
|
|
||||||
echo EzUI Static Library Build Script
|
|
||||||
echo VS2022 + CMake
|
|
||||||
echo ========================================
|
|
||||||
echo.
|
|
||||||
|
|
||||||
REM Check if CMake is available
|
|
||||||
where cmake >nul 2>&1
|
|
||||||
if %ERRORLEVEL% neq 0 (
|
|
||||||
echo Error: CMake not found. Please install CMake.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
REM Get the directory of this script
|
|
||||||
set "SCRIPT_DIR=%~dp0"
|
|
||||||
cd /d "%SCRIPT_DIR%"
|
|
||||||
|
|
||||||
REM Clean previous build
|
|
||||||
echo [1/4] Cleaning previous build...
|
|
||||||
if exist "build" rmdir /s /q build
|
|
||||||
if exist "lib\*.lib" del /q "lib\*.lib"
|
|
||||||
if exist "lib\*.pdb" del /q "lib\*.pdb"
|
|
||||||
|
|
||||||
REM Generate and build Win32
|
|
||||||
echo.
|
|
||||||
echo [2/4] Building Win32...
|
|
||||||
cmake -G "Visual Studio 17 2022" -A Win32 -S . -B build\Win32
|
|
||||||
if %ERRORLEVEL% neq 0 (
|
|
||||||
echo Error: CMake generation failed for Win32
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
cmake --build build\Win32 --config Debug
|
|
||||||
if %ERRORLEVEL% neq 0 (
|
|
||||||
echo Error: Build failed for Win32 Debug
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
cmake --build build\Win32 --config Release
|
|
||||||
if %ERRORLEVEL% neq 0 (
|
|
||||||
echo Error: Build failed for Win32 Release
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
REM Generate and build x64
|
|
||||||
echo.
|
|
||||||
echo [3/4] Building x64...
|
|
||||||
cmake -G "Visual Studio 17 2022" -A x64 -S . -B build\x64
|
|
||||||
if %ERRORLEVEL% neq 0 (
|
|
||||||
echo Error: CMake generation failed for x64
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
cmake --build build\x64 --config Debug
|
|
||||||
if %ERRORLEVEL% neq 0 (
|
|
||||||
echo Error: Build failed for x64 Debug
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
cmake --build build\x64 --config Release
|
|
||||||
if %ERRORLEVEL% neq 0 (
|
|
||||||
echo Error: Build failed for x64 Release
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
REM Show results
|
|
||||||
echo.
|
|
||||||
echo [4/4] Build completed!
|
|
||||||
echo.
|
|
||||||
echo Generated libraries:
|
|
||||||
dir /b lib\*.lib
|
|
||||||
echo.
|
|
||||||
echo ========================================
|
|
||||||
echo Build Successful!
|
|
||||||
echo ========================================
|
|
||||||
|
|
||||||
endlocal
|
|
||||||
4
build_x64.bat
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
chcp 65001
|
||||||
|
@echo off
|
||||||
|
cmake -S . -B build_x64 -A x64 -DBUILD_EZUI=OFF
|
||||||
|
pause
|
||||||
4
build_x86.bat
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
chcp 65001
|
||||||
|
@echo off
|
||||||
|
cmake -S . -B build_x86 -A Win32 -DBUILD_EZUI=OFF
|
||||||
|
pause
|
||||||
24
clean.bat
@@ -1,24 +0,0 @@
|
|||||||
@echo off
|
|
||||||
chcp 65001 >nul
|
|
||||||
|
|
||||||
echo Cleaning EzUI build artifacts...
|
|
||||||
|
|
||||||
REM Remove build directory
|
|
||||||
if exist "build" (
|
|
||||||
rmdir /s /q build
|
|
||||||
echo Removed: build\
|
|
||||||
)
|
|
||||||
|
|
||||||
REM Remove lib files
|
|
||||||
if exist "lib\*.lib" (
|
|
||||||
del /q lib\*.lib
|
|
||||||
echo Removed: lib\*.lib
|
|
||||||
)
|
|
||||||
|
|
||||||
if exist "lib\*.pdb" (
|
|
||||||
del /q lib\*.pdb
|
|
||||||
echo Removed: lib\*.pdb
|
|
||||||
)
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo Clean completed!
|
|
||||||
@@ -93,11 +93,3 @@ set_property(TARGET QQ PROPERTY FOLDER "demo")
|
|||||||
COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/kugou/extract${ARCH_NAME}.bat" "$<TARGET_FILE_DIR:kugou>"
|
COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/kugou/extract${ARCH_NAME}.bat" "$<TARGET_FILE_DIR:kugou>"
|
||||||
COMMENT "Running extract.bat to conditionally extract dll.zip"
|
COMMENT "Running extract.bat to conditionally extract dll.zip"
|
||||||
)
|
)
|
||||||
|
|
||||||
# TableView Demo - LayeredWindow + VLayout + TableView + 右键菜单
|
|
||||||
project(TableViewDemo)
|
|
||||||
file(GLOB src TableViewDemo/*.*)
|
|
||||||
add_executable(TableViewDemo WIN32 ${src})
|
|
||||||
target_include_directories(TableViewDemo PRIVATE ${include})
|
|
||||||
target_link_libraries(TableViewDemo PRIVATE EzUI)
|
|
||||||
set_property(TARGET TableViewDemo PROPERTY FOLDER "demo")
|
|
||||||
|
|||||||
BIN
demo/QQ/QQ.res
31
demoEx/Adminstor/Adminstor.sln
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.14.36811.4 d17.14
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Adminstor", "Adminstor\Adminstor.vcxproj", "{EE06DEDC-52B5-4B5D-8B52-7FEB02D77E6B}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{EE06DEDC-52B5-4B5D-8B52-7FEB02D77E6B}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{EE06DEDC-52B5-4B5D-8B52-7FEB02D77E6B}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{EE06DEDC-52B5-4B5D-8B52-7FEB02D77E6B}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{EE06DEDC-52B5-4B5D-8B52-7FEB02D77E6B}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{EE06DEDC-52B5-4B5D-8B52-7FEB02D77E6B}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{EE06DEDC-52B5-4B5D-8B52-7FEB02D77E6B}.Release|x64.Build.0 = Release|x64
|
||||||
|
{EE06DEDC-52B5-4B5D-8B52-7FEB02D77E6B}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{EE06DEDC-52B5-4B5D-8B52-7FEB02D77E6B}.Release|x86.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {AC1EAB6C-7DC1-484D-92AE-6736232936CA}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
204
demoEx/Adminstor/Adminstor/Adminstor.vcxproj
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
<?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>{ee06dedc-52b5-4b5d-8b52-7feb02d77e6b}</ProjectGuid>
|
||||||
|
<RootNamespace>Adminstor</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>..\ThirdParty\hp-socket-6.0.7\Include;..\ThirdParty\sqlite3mc\include;..\ThirdParty\openssl\14x\x86\include;..\ThirdParty;..\..\..\include;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>..\ThirdParty\hp-socket-6.0.7\lib;..\ThirdParty\sqlite3mc\lib;..\ThirdParty\openssl\14x\x86\lib;..\..\..\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>..\ThirdParty\hp-socket-6.0.7\Include;..\ThirdParty\sqlite3mc\include;..\ThirdParty\openssl\14x\x86\include;..\ThirdParty;..\..\..\include;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>..\ThirdParty\hp-socket-6.0.7\lib;..\ThirdParty\sqlite3mc\lib;..\ThirdParty\openssl\14x\x86\lib;..\..\..\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>..\ThirdParty\hp-socket-6.0.7\Include;..\ThirdParty\sqlite3mc\include;..\ThirdParty\openssl\14x\x64\include;..\ThirdParty;..\..\..\include;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>..\ThirdParty\hp-socket-6.0.7\lib;..\ThirdParty\sqlite3mc\lib;..\ThirdParty\openssl\14x\x64\lib;..\..\..\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>..\ThirdParty\hp-socket-6.0.7\Include;..\ThirdParty\sqlite3mc\include;..\ThirdParty\openssl\14x\x64\include;..\ThirdParty;..\..\..\include;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>..\ThirdParty\hp-socket-6.0.7\lib;..\ThirdParty\sqlite3mc\lib;..\ThirdParty\openssl\14x\x64\lib;..\..\..\lib;$(LibraryPath)</LibraryPath>
|
||||||
|
<TargetName>$(ProjectName)_$(Configuration)_$(Platform)</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>HPSOCKET_STATIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>EzUI_$(Configuration)_$(Platform).lib;HPSocket_$(Configuration)_$(Platform).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>HPSOCKET_STATIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>EzUI_$(Configuration)_$(Platform).lib;HPSocket_$(Configuration)_$(Platform).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>HPSOCKET_STATIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>EzUI_$(Configuration)_$(Platform).lib;HPSocket_$(Configuration)_$(Platform).lib;sqlite3mc_$(Configuration)_$(Platform).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>HPSOCKET_STATIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>EzUI_$(Configuration)_$(Platform).lib;HPSocket_$(Configuration)_$(Platform).lib;sqlite3mc_$(Configuration)_$(Platform).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="framework.h" />
|
||||||
|
<ClInclude Include="mainForm.h" />
|
||||||
|
<ClInclude Include="NetworkClient.h" />
|
||||||
|
<ClInclude Include="pch.h" />
|
||||||
|
<ClInclude Include="Resource.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="Main.cpp" />
|
||||||
|
<ClCompile Include="mainForm.cpp" />
|
||||||
|
<ClCompile Include="pch.cpp">
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="DemoUi.ico" />
|
||||||
|
<Image Include="small.ico" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="DemoUi.rc" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
55
demoEx/Adminstor/Adminstor/Adminstor.vcxproj.filters
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" 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>
|
||||||
|
<ClInclude Include="framework.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Resource.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="pch.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="mainForm.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="Main.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="pch.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="mainForm.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="small.ico">
|
||||||
|
<Filter>资源文件</Filter>
|
||||||
|
</Image>
|
||||||
|
<Image Include="DemoUi.ico">
|
||||||
|
<Filter>资源文件</Filter>
|
||||||
|
</Image>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="DemoUi.rc">
|
||||||
|
<Filter>资源文件</Filter>
|
||||||
|
</ResourceCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
4
demoEx/Adminstor/Adminstor/Adminstor.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>
|
||||||
BIN
demoEx/Adminstor/Adminstor/DemoUi.aps
Normal file
BIN
demoEx/Adminstor/Adminstor/DemoUi.ico
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
demoEx/Adminstor/Adminstor/DemoUi.rc
Normal file
15
demoEx/Adminstor/Adminstor/Main.cpp
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#include "pch.h"
|
||||||
|
#include "mainForm.h"
|
||||||
|
|
||||||
|
int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow)
|
||||||
|
{
|
||||||
|
//app类
|
||||||
|
Application app(hInstance);
|
||||||
|
app.EnableHighDpi();//启用高DPI
|
||||||
|
|
||||||
|
//创建
|
||||||
|
mainForm nainFrm;
|
||||||
|
nainFrm.Show();
|
||||||
|
|
||||||
|
return app.Exec();//进行消息循环
|
||||||
|
}
|
||||||
103
demoEx/Adminstor/Adminstor/NetworkClient.h
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "pch.h"
|
||||||
|
#include "HPSocket-SSL.h"
|
||||||
|
|
||||||
|
// SSL证书配置
|
||||||
|
static const char* g_lpszPemCert = R"(-----BEGIN CERTIFICATE-----
|
||||||
|
MIIElTCCAn2gAwIBAgIUdQCiE198je6YcO36MbHHQJkuvvYwDQYJKoZIhvcNAQEL
|
||||||
|
BQAwXjELMAkGA1UEBhMCQ04xEDAOBgNVBAgMB0JlaWppbmcxEDAOBgNVBAcMB0Jl
|
||||||
|
aWppbmcxDzANBgNVBAoMBk15c2VsZjELMAkGA1UECwwCSVQxDTALBgNVBAMMBE15
|
||||||
|
Q0EwIBcNMjYwMjIzMTIwMzM4WhgPMjA5MzA4MjAxMjAzMzhaMGUxCzAJBgNVBAYT
|
||||||
|
AkNOMRAwDgYDVQQIDAdCZWlqaW5nMRAwDgYDVQQHDAdCZWlqaW5nMRIwEAYDVQQK
|
||||||
|
DAlNeUNvbXBhbnkxCzAJBgNVBAsMAklUMREwDwYDVQQDDAhNeUNsaWVudDCCASIw
|
||||||
|
DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALc43ZqrQkgGZRPfVOCW+wJ1fox9
|
||||||
|
CiKkmUIWTgRaJTwYy18f4WNjQxB69LBkQXJFeU3M8urM7485iIOyAMgT4hJNu/lm
|
||||||
|
RgK0b2A6i8INqh0KlgM02fqmpwW+/XPyzR7I0a7/ph9zfzz+hVjm/k8GHnArCwEu
|
||||||
|
Z0Ii8MH7T0rgzEPZIIKokBb5OeZo3BS8RmE1HemSQGxEHfcRSa1mygW5Kujv9AK5
|
||||||
|
DQZJ2UgnArGsPawe7sQQFAbV59pThxCb8EFmZ44qfpoPTK7Ki0HiE12cIa4DBKe4
|
||||||
|
xb2IZOcpE1r94zT9TdXye+VPj9y2lckM8TLSEH7eHr+BNhir9PSRVas6KMcCAwEA
|
||||||
|
AaNCMEAwHQYDVR0OBBYEFFQndGIMOfspC0uS2AbS69DAelvBMB8GA1UdIwQYMBaA
|
||||||
|
FOU/8+1LOIrynX9cOJ/MBpuzrkGMMA0GCSqGSIb3DQEBCwUAA4ICAQAGy9ST0Ajt
|
||||||
|
FzRFT4fX7IXj4gMBWN+GF9yWWCmViEcWdSMQb6A6vwrqhUq2Y/VTbCLI0EZAHC3c
|
||||||
|
9+HFX24r9qUZvt5yYDQsb/PCBPGTArKd7Nk0wKIsWZp7oJ3I6n71zL4vb/0vSGaX
|
||||||
|
MQCizQmAziA4QcJOX4MnYnXPbMfEFbFOnIYMV3vjmRMUSqxkLPUMx/xy8vd9Jz9g
|
||||||
|
ribhd9ChxUXKxilTq2sEgASyFnNIYy0dZUcY272d4sAFRdCwL6B8EkUnqyg8LO4T
|
||||||
|
rxlr72hrbTUcghuyicYeQrQYHsKF5fn5b88Kj0DlD68S5pSztcCyy+ykmm83dM7F
|
||||||
|
ytS2VmUIondyApEATp3nkpdWI0M8+CWsdWS09yQuA340qeA3bwrptC6cWuqJSb9N
|
||||||
|
89MV4Anzx5J1hUIByxhpzZ7vnkogJ8hCHIwom7sLOVnBe8GDrIK3/E6ygs8+uOXY
|
||||||
|
zPIAdbqX7P4ZykJtHfDaBSyDstT9Y+tLjo1JVwAO5InLYGubb2B6YEJhlymLlx+I
|
||||||
|
mSA1UwnKHX14onP5hk9FdJKhf0UsL4VbTv/MFuS1/T0ttlCk9hK2WF6loorNqfQe
|
||||||
|
lMnFCbLM8yPEMj3fztu1rY2aa5hGfydLYdqd/XAn4DzWgrJ9gqgkYWZkeKPBMTob
|
||||||
|
xY7Di4RK6hKuv1eAWVYaW/0L/dSzoeSVKQ==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
)";
|
||||||
|
|
||||||
|
static const char* g_lpszPemKey = R"(-----BEGIN ENCRYPTED PRIVATE KEY-----
|
||||||
|
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
|
||||||
|
-----END ENCRYPTED PRIVATE KEY-----
|
||||||
|
)";
|
||||||
|
|
||||||
|
static const char* g_lpszCAPemCert = R"(-----BEGIN CERTIFICATE-----
|
||||||
|
MIIFnzCCA4egAwIBAgIUOyt7hlCJPl9mOO0BMEJd6cI8TiEwDQYJKoZIhvcNAQEL
|
||||||
|
BQAwXjELMAkGA1UEBhMCQ04xEDAOBgNVBAgMB0JlaWppbmcxEDAOBgNVBAcMB0Jl
|
||||||
|
aWppbmcxDzANBgNVBAoMBk15c2VsZjELMAkGA1UECwwCSVQxDTALBgNVBAMMBE15
|
||||||
|
Q0EwIBcNMjYwMjIzMTIwMjAyWhgPMjA5MzA4MjAxMjAyMDJaMF4xCzAJBgNVBAYT
|
||||||
|
AkNOMRAwDgYDVQQIDAdCZWlqaW5nMRAwDgYDVQQHDAdCZWlqaW5nMQ8wDQYDVQQK
|
||||||
|
DAZNeXNlbGYxCzAJBgNVBAsMAklUMQ0wCwYDVQQDDARNeUNBMIICIjANBgkqhkiG
|
||||||
|
9w0BAQEFAAOCAg8AMIICCgKCAgEAsolBAdfumyA8Iwae/LgIrPpZxhUfXVfS9XxV
|
||||||
|
8l7j5jdNT3A7jtzRqUxDU0dHVW5LPgsgB+bGaecFB97odCQUiM3bUbVNTEqwvtwW
|
||||||
|
4g7PdcQBVO+MmID1gqkAo49NOJiQWkH5fao0srvGENXN+orwwIeYTVDKwBd0RQ2w
|
||||||
|
53d22FlJZkYZB43JRVwPDHsWJiFAp7dUNux7HtwKrAUfZWFUwkbGcXqZqFPCw3ol
|
||||||
|
t11mIjHWMIwhVcozloaIQSQggCETFRGKY1TtfbnoPT4aIcJwTAJv7c9Dd9a7bZkO
|
||||||
|
+bcTJk0amLrnj051HKpMWofqUETA4GhHCKWxNF+Fbe5hYDxUtmh/2fJo2QCac/tY
|
||||||
|
6YtBoPEiXMfFGXDAEClr0T5b2AH/7J27xuaRjT5SP+LR+g1gphA/8Fcist8kp8PM
|
||||||
|
ar5D6S5raAoyTRvVZ0vfYuzm83SeyL3KlRi7idfQHmTqJB3KabuV+bxc3R+oKW6P
|
||||||
|
yoZBtRAyJU6wPteMSoRjj8Wv92TRf9VDlN/5KgsaYrdQDy0fbHFgUhffOf2+z8l7
|
||||||
|
FD/fe8S4epAd3HZgz+jymJpRUB/xHeTfs9gzbQxy2JkKgCNGG4nRCtsrKOnMFAhJ
|
||||||
|
x0d86m4vYin3lRwerI68+uhFc/VETERSDQFgVVXcZ+rxzstbFx8o72Kwg6n4jh3k
|
||||||
|
rK8cSf0CAwEAAaNTMFEwHQYDVR0OBBYEFOU/8+1LOIrynX9cOJ/MBpuzrkGMMB8G
|
||||||
|
A1UdIwQYMBaAFOU/8+1LOIrynX9cOJ/MBpuzrkGMMA8GA1UdEwEB/wQFMAMBAf8w
|
||||||
|
DQYJKoZIhvcNAQELBQADggIBACVBuslKJAdW7UlRGinZXxbrjMTyOzmPR9jqEc9o
|
||||||
|
51SzE5vX7SZqSdKoogx0T7UlvACSEgfPiz9mhuDxRnssi+gQ537y1dEihzKMReIp
|
||||||
|
sbL3vO82MtdfViOWi4ezBM+FdgtHn3LpQ9UsJoMyOPFCuOIn0yyp4AhtTO5eeSiF
|
||||||
|
q15eUZ6tFWNNdIYl6QBSsJG/zwXI92lYqrRPLHvS6A4BUyhdHX0d9L0sr8twRmfx
|
||||||
|
P3yHBCmRfDs8vE0oSm3+aS+C7g6CVF3qoG0NdOZd4z2JKjNjapPK4v3g0q3itjxt
|
||||||
|
ZJdC+suQFvMM6wymcXxL4hqE+lV+6E+uwV2+sQxQdS3qUOc81AxSGdfQg+6eZyWM
|
||||||
|
aeWwjpRGObQFqpcsrVF2mQWXH2Y3ZA9MbPoneej3ruUHM2c6wGhh3V4YF1mcKwaR
|
||||||
|
hYd+1GI8fAdibN/vWuNqe3iDtHwm3jYcRefIxTc5OXxHrYrS90jSdF3og2Pn1DJY
|
||||||
|
fSh8XsFLXXe1iY9L1ISzm6AT4/QOQQG6zoIZxNwHpdtH5N/5b5mrhVEYRciv+dn3
|
||||||
|
3/8du56xMT7oiBv7YR6+Rvv0C1+pu/MKFxxoBKHspt9kjV766yxER1vEepTet7N4
|
||||||
|
DZvWiYOptU12bP+R8wlwGnmTbhul7TnkQ91LUsCYhCprHKL+JHgeOPEQdpqAjVgq
|
||||||
|
ik2N
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
)";
|
||||||
|
|
||||||
|
static const int g_iVerifyMode = SSL_VM_PEER;
|
||||||
|
static const char* g_lpszKeyPassword = "151AnryUBW9658Aa7553";
|
||||||
18
demoEx/Adminstor/Adminstor/Resource.h
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
//{{NO_DEPENDENCIES}}
|
||||||
|
// Microsoft Visual C++ 生成的包含文件。
|
||||||
|
// 供 DemoUi.rc 使用
|
||||||
|
//
|
||||||
|
#define IDI_SMALL 101
|
||||||
|
#define IDD_INPUT 102
|
||||||
|
#define IDC_EDIT1 1000
|
||||||
|
|
||||||
|
// Next default values for new objects
|
||||||
|
//
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
#define _APS_NEXT_RESOURCE_VALUE 104
|
||||||
|
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||||
|
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||||
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
67
demoEx/Adminstor/Adminstor/framework.h
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
|
// 注意顺序:winsock2.h -> ws2tcpip.h -> iphlpapi.h -> windows.h
|
||||||
|
#include <winsock2.h>
|
||||||
|
#include <ws2tcpip.h>
|
||||||
|
#include <iphlpapi.h>
|
||||||
|
#include <windows.h>
|
||||||
|
#include <TlHelp32.h>
|
||||||
|
#include <shellapi.h>
|
||||||
|
|
||||||
|
#include <mutex>
|
||||||
|
#include <regex>
|
||||||
|
#include <iostream>
|
||||||
|
#include <vector>
|
||||||
|
#include <codecvt>
|
||||||
|
#include <fstream>
|
||||||
|
#include <filesystem>
|
||||||
|
#include <string>
|
||||||
|
#include <conio.h>
|
||||||
|
#include <locale>
|
||||||
|
|
||||||
|
#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/Animation.h"
|
||||||
|
#include "EzUI/TableView.h"
|
||||||
|
#include "EzUI/Menu.h"
|
||||||
|
|
||||||
|
#include <HPSocket.h>
|
||||||
|
#include <HPSocket-SSL.h>
|
||||||
|
|
||||||
|
#include <sqlite3.h>
|
||||||
|
#include <sqlite3mc.h>
|
||||||
|
|
||||||
|
// 包含 nlohmann 库
|
||||||
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
|
// OpenSSL Headers
|
||||||
|
#include <openssl/ssl.h>
|
||||||
|
#include <openssl/err.h>
|
||||||
|
#include <openssl/x509.h>
|
||||||
|
#include <openssl/x509v3.h>
|
||||||
|
#include <openssl/bio.h>
|
||||||
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
|
// Link libraries
|
||||||
|
#pragma comment(lib, "shell32.lib")
|
||||||
|
#pragma comment(lib, "ole32.lib")
|
||||||
|
#pragma comment(lib, "gdi32.lib")
|
||||||
|
#pragma comment(lib, "advapi32.lib")
|
||||||
|
#pragma comment(lib, "user32.lib")
|
||||||
|
#pragma comment(lib, "ws2_32.lib")
|
||||||
|
#pragma comment(lib, "libssl.lib")
|
||||||
|
#pragma comment(lib, "libcrypto.lib")
|
||||||
|
#pragma comment(lib, "crypt32.lib")
|
||||||
238
demoEx/Adminstor/Adminstor/mainForm.cpp
Normal file
@@ -0,0 +1,238 @@
|
|||||||
|
#include "pch.h"
|
||||||
|
#include "mainForm.h"
|
||||||
|
|
||||||
|
// 发送数据成功后的处理
|
||||||
|
EnHandleResult mainForm::OnSend(ITcpClient* pSender, CONNID dwConnID, const BYTE* pData, int iLength)
|
||||||
|
{
|
||||||
|
return HR_OK;
|
||||||
|
}
|
||||||
|
// 接收数据后的处理
|
||||||
|
EnHandleResult mainForm::OnReceive(ITcpClient* pSender, CONNID dwConnID, const BYTE* pData, int iLength)
|
||||||
|
{
|
||||||
|
return HR_OK;
|
||||||
|
}
|
||||||
|
// 连接关闭后的处理
|
||||||
|
EnHandleResult mainForm::OnClose(ITcpClient* pSender, CONNID dwConnID, EnSocketOperation enOperation, int iErrorCode)
|
||||||
|
{
|
||||||
|
std::cout << "连接已关闭!" << std::endl;
|
||||||
|
// 设置连接状态为未连接
|
||||||
|
m_Connected.store(false, std::memory_order_release);
|
||||||
|
|
||||||
|
Button* btnAdminConnect = (Button*)FindControl("btnAdminConnect");
|
||||||
|
if (btnAdminConnect) {
|
||||||
|
btnAdminConnect->SetText(L"❌");
|
||||||
|
// 设置背景颜色为 #FF7774 (红色)
|
||||||
|
btnAdminConnect->Style.BackColor = Color(255, 119, 116);
|
||||||
|
isInitSSLContext = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return HR_OK;
|
||||||
|
}
|
||||||
|
// 连接成功后的处理
|
||||||
|
EnHandleResult mainForm::OnConnect(ITcpClient* pSender, CONNID dwConnID)
|
||||||
|
{
|
||||||
|
TCHAR szAddress[100]; // 存储地址的缓冲区
|
||||||
|
int iAddressLen = sizeof(szAddress) / sizeof(TCHAR);
|
||||||
|
USHORT usPort;
|
||||||
|
pSender->GetLocalAddress(szAddress, iAddressLen, usPort);
|
||||||
|
|
||||||
|
// 设置连接状态为已连接
|
||||||
|
m_Connected.store(true, std::memory_order_release);
|
||||||
|
|
||||||
|
Button* btnAdminConnect = (Button*)FindControl("btnAdminConnect");
|
||||||
|
if (btnAdminConnect) {
|
||||||
|
btnAdminConnect->SetText(L"🔃");
|
||||||
|
btnAdminConnect->Style.BackColor = Color(0, 185, 107);
|
||||||
|
}
|
||||||
|
return HR_OK;
|
||||||
|
}
|
||||||
|
// SSL握手完成后的处理
|
||||||
|
EnHandleResult mainForm::OnHandShake(ITcpClient* pSender, CONNID dwConnID)
|
||||||
|
{
|
||||||
|
std::cout << "SSL握手完成!" << std::endl;
|
||||||
|
return HR_OK;
|
||||||
|
}
|
||||||
|
// 开始连接服务器
|
||||||
|
bool mainForm::startConnection(const LPCTSTR& lpszAddress, USHORT usPort)
|
||||||
|
{
|
||||||
|
if (m_Connected.load(std::memory_order_acquire)) return true;
|
||||||
|
|
||||||
|
if (!isInitSSLContext) {
|
||||||
|
// 初始化SSL证书
|
||||||
|
if (!m_Client->SetupSSLContextByMemory(g_iVerifyMode, g_lpszPemCert, g_lpszPemKey, g_lpszKeyPassword, g_lpszCAPemCert)) {
|
||||||
|
std::cout << "SSL上下文设置失败!" << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 启动连接
|
||||||
|
if (!m_Client->Start(lpszAddress, usPort, FALSE)) {
|
||||||
|
std::cout << "连接服务器失败!错误码: " << m_Client->GetLastError() << std::endl;
|
||||||
|
m_Client->CleanupSSLContext();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
isInitSSLContext = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// 断开连接服务器
|
||||||
|
void mainForm::stopConnection()
|
||||||
|
{
|
||||||
|
if (!m_Connected.load(std::memory_order_acquire) || !m_Client->HasStarted()) return;
|
||||||
|
m_Client->Stop();
|
||||||
|
}
|
||||||
|
// 发送字符串数据
|
||||||
|
bool mainForm::sendData(const std::string& strData)
|
||||||
|
{
|
||||||
|
if (!m_Connected.load(std::memory_order_acquire)) return false;
|
||||||
|
|
||||||
|
return m_Client->Send(reinterpret_cast<const BYTE*>(strData.data()), static_cast<int>(strData.size()));
|
||||||
|
}
|
||||||
|
// 发送二进制数据
|
||||||
|
bool mainForm::sendData(const std::vector<uint8_t>& sendData)
|
||||||
|
{
|
||||||
|
if (!m_Connected.load(std::memory_order_acquire)) return false;
|
||||||
|
|
||||||
|
return m_Client->Send(sendData.data(), static_cast<int>(sendData.size()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void mainForm::OnNotify(Control* sender, EventArgs& args)
|
||||||
|
{
|
||||||
|
UIString btnName = sender->Name; // 控件id
|
||||||
|
Event eventType = args.EventType; // 事件类型
|
||||||
|
|
||||||
|
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") { //管理页面的连接按钮按下
|
||||||
|
Button* btnAdminConnect = (Button*)FindControl("btnAdminConnect");
|
||||||
|
TextBox* textAdminIP = (TextBox*)FindControl("editAdminIP");
|
||||||
|
|
||||||
|
// 先连接
|
||||||
|
if (!m_Connected.load(std::memory_order_acquire)) {
|
||||||
|
// 目前未连接,开始连接
|
||||||
|
if (!isInitSSLContext)
|
||||||
|
m_Client->CleanupSSLContext();
|
||||||
|
startConnection(textAdminIP->GetText().unicode().c_str(), 5556);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (btnName == "btnAdminTemp") { //管理页面的测试按钮
|
||||||
|
TextBox* textAdmin = (TextBox*)FindControl("textAdminOutput"); //获取输出框
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ezui::OnMouseDoubleClick: //鼠标双击
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (args.EventType == Event::OnMouseDown) {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
__super::OnNotify(sender, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
void mainForm::OnClose(bool& close)
|
||||||
|
{
|
||||||
|
// 断开网络连接
|
||||||
|
|
||||||
|
Application::Exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
mainForm::mainForm() : LayeredWindow(1500, 750), m_Connected(false), m_Client(this)
|
||||||
|
{
|
||||||
|
// 如果是debug模式则创建控制台窗口用于输出调试信息
|
||||||
|
#ifdef _DEBUG
|
||||||
|
AllocConsole();
|
||||||
|
FILE* fp = nullptr;
|
||||||
|
freopen_s(&fp, "CONOUT$", "w", stdout);
|
||||||
|
freopen_s(&fp, "CONOUT$", "w", stderr);
|
||||||
|
// 设置控制台UTF-8编码
|
||||||
|
SetConsoleOutputCP(CP_UTF8);
|
||||||
|
std::cout << "调试模式控制台已启动!" << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
SetResizable(true); // 启用窗口大小调整
|
||||||
|
SetMiniSize(Size(800, 550)); // 设置最小尺寸
|
||||||
|
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);
|
||||||
|
|
||||||
|
// 初始化设置表格各项属性
|
||||||
|
TableView* tableView = (TableView*)FindControl("tableViewAdmin"); //获取表格控件
|
||||||
|
if (tableView) {
|
||||||
|
tableView->SelectedRowBackColor = Color(200, 230, 255); // 设置选中行背景色
|
||||||
|
//tableView->SetColumnType(5, ezui::CellType::CheckBox);
|
||||||
|
tableView->SetColumnType(0, ezui::CellType::ReadOnly); //设置第1列为只读类型
|
||||||
|
tableView->SetColumnType(2, ezui::CellType::ComboBox); //设置第3列为下拉列表类型
|
||||||
|
tableView->SetColumnComboItems(2, { L"禁止", L"开通" , L"验机" }); //设置第3列下拉列表内容
|
||||||
|
tableView->SetDefaultTextAlign(Align::MiddleCenter); //设置默认对齐方式
|
||||||
|
tableView->SetColumnTextAlign(7, Align::MiddleLeft); //设置机器码列对齐
|
||||||
|
tableView->SetColumnTextAlign(8, Align::MiddleLeft); //设置列对齐
|
||||||
|
tableView->SetColumnTextAlign(9, Align::MiddleLeft); //设置列对齐
|
||||||
|
|
||||||
|
//设置列宽
|
||||||
|
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 (size_t 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;
|
||||||
|
|
||||||
|
};
|
||||||
|
// 单元格内容变化回调(内容变化时立即触发)
|
||||||
|
tableView->CellValueChanged = [](int row, int col, const UIString& newValue) {
|
||||||
|
std::cout << "单元格内容变化回调: " << newValue.ansi() << std::endl;
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
mainForm::~mainForm()
|
||||||
|
{
|
||||||
|
}
|
||||||
43
demoEx/Adminstor/Adminstor/mainForm.h
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "pch.h"
|
||||||
|
#include "NetworkClient.h"
|
||||||
|
|
||||||
|
using namespace ezui;
|
||||||
|
|
||||||
|
// 主窗口
|
||||||
|
class mainForm : public LayeredWindow, public CTcpClientListener
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
//ui管理类
|
||||||
|
UIManager umg;
|
||||||
|
|
||||||
|
// hp-socket 网络通信类
|
||||||
|
virtual EnHandleResult OnSend(ITcpClient* pSender, CONNID dwConnID, const BYTE* pData, int iLength);
|
||||||
|
virtual EnHandleResult OnReceive(ITcpClient* pSender, CONNID dwConnID, const BYTE* pData, int iLength);
|
||||||
|
virtual EnHandleResult OnClose(ITcpClient* pSender, CONNID dwConnID, EnSocketOperation enOperation, int iErrorCode);
|
||||||
|
virtual EnHandleResult OnConnect(ITcpClient* pSender, CONNID dwConnID);
|
||||||
|
virtual EnHandleResult OnHandShake(ITcpClient* pSender, CONNID dwConnID);
|
||||||
|
|
||||||
|
// 开始网络连接
|
||||||
|
bool startConnection(const LPCTSTR& lpszAddress, USHORT serverPort);
|
||||||
|
// 断开网络连接
|
||||||
|
void stopConnection();
|
||||||
|
// 是否已连接服务器
|
||||||
|
bool IsConnected() const { return m_Connected.load(std::memory_order_acquire); }
|
||||||
|
// 发送字符串数据
|
||||||
|
bool sendData(const std::string& strData);
|
||||||
|
// 发送二进制数据
|
||||||
|
bool sendData(const std::vector<uint8_t>& sendData);
|
||||||
|
|
||||||
|
//
|
||||||
|
CSSLClientPtr m_Client; // SSL客户端对象
|
||||||
|
std::atomic<bool> m_Connected{ false }; // 是否已连接服务器
|
||||||
|
bool isInitSSLContext = false; // 是否已初始化SSL上下文
|
||||||
|
protected:
|
||||||
|
virtual void OnNotify(Control* sender, EventArgs& args)override;//重载事件通知
|
||||||
|
virtual void OnClose(bool& close)override;//当窗口关闭的时候
|
||||||
|
public:
|
||||||
|
mainForm();
|
||||||
|
virtual ~mainForm();
|
||||||
|
};
|
||||||
|
|
||||||
1
demoEx/Adminstor/Adminstor/pch.cpp
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#include "pch.h"
|
||||||
2
demoEx/Adminstor/Adminstor/pch.h
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "framework.h"
|
||||||
BIN
demoEx/Adminstor/Adminstor/small.ico
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
demoEx/Adminstor/_bin/res/check.png
Normal file
|
After Width: | Height: | Size: 784 B |
BIN
demoEx/Adminstor/_bin/res/check_1.png
Normal file
|
After Width: | Height: | Size: 938 B |
BIN
demoEx/Adminstor/_bin/res/close.png
Normal file
|
After Width: | Height: | Size: 496 B |
BIN
demoEx/Adminstor/_bin/res/close1.png
Normal file
|
After Width: | Height: | Size: 309 B |
BIN
demoEx/Adminstor/_bin/res/close2.png
Normal file
|
After Width: | Height: | Size: 394 B |
BIN
demoEx/Adminstor/_bin/res/close3.png
Normal file
|
After Width: | Height: | Size: 404 B |
BIN
demoEx/Adminstor/_bin/res/down.png
Normal file
|
After Width: | Height: | Size: 510 B |
BIN
demoEx/Adminstor/_bin/res/head.png
Normal file
|
After Width: | Height: | Size: 76 KiB |
71
demoEx/Adminstor/_bin/res/loginForm.htm
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
<vlayout id="mainLayout" action="move">
|
||||||
|
|
||||||
|
<!-- 标题栏 -->
|
||||||
|
<hbox height="20" margin-top="5" action="move">
|
||||||
|
<spacer></spacer>
|
||||||
|
<!-- 退出按钮 -->
|
||||||
|
<button id="btnExit" size="20,20" action="close" style="background-image: url(res/close.png)"></button>
|
||||||
|
<spacer width="10"></spacer>
|
||||||
|
</hbox>
|
||||||
|
|
||||||
|
<!-- 头像 -->
|
||||||
|
<!--<spacer height="40"></spacer>-->
|
||||||
|
<label margin-top="30" id="headImg" size="80,80" action="move"></label>
|
||||||
|
|
||||||
|
<!-- 账号输入框 -->
|
||||||
|
<hbox margin-top="25" size="258,42" style="border-radius:5px;background-color:white;">
|
||||||
|
<input id="user" halign="center" placeholder="输入账号" />
|
||||||
|
</hbox>
|
||||||
|
|
||||||
|
<!-- 密码输入框 -->
|
||||||
|
<hbox margin-top="10" size="258,42" style="border-radius:5px;background-color:white;">
|
||||||
|
<input passwordchar="*" id="pwd" halign="center" placeholder="输入密码" />
|
||||||
|
</hbox>
|
||||||
|
|
||||||
|
<!-- 协议勾选 -->
|
||||||
|
<hbox size="258,42" margin-top="10" style="font-size:12px">
|
||||||
|
<checkbox size="18,18" id="ckbox"></checkbox>
|
||||||
|
<label width="auto" text="我已阅读并同意"></label>
|
||||||
|
<button url="www.baidu.com" width="auto" style="color: #2D77E5;cursor:pointer" text="服务协议"></button>
|
||||||
|
<label width="auto" text="和"></label>
|
||||||
|
<button url="www.bing.com" width="auto" style="color: #2D77E5" text="隐私保护指引" title="OOO"></button>
|
||||||
|
</hbox>
|
||||||
|
|
||||||
|
<!-- 登陆按钮 -->
|
||||||
|
<button margin-top="15" size="258,38" id="btnLogin" text="登录" visible="true"> </button>
|
||||||
|
|
||||||
|
<!-- 离线模式按钮 -->
|
||||||
|
<button margin-top="15" size="258,38" id="btnOffLine" text="离线进入" style="background-color: #0099FF; color: white; border-radius: 8px" visible="true"> </button>
|
||||||
|
|
||||||
|
</vlayout>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#mainLayout {
|
||||||
|
background-color: #E8F0FF;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#headImg {
|
||||||
|
background-image: url(res/head.png);
|
||||||
|
border-radius: 80px;
|
||||||
|
border: 2px solid white;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ckbox {
|
||||||
|
background-image: url(res/check.png);
|
||||||
|
}
|
||||||
|
#ckbox:checked {
|
||||||
|
background-image: url(res/check_1.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
#btnLogin {
|
||||||
|
background-color: #0099FF;
|
||||||
|
color: white;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
/*登录按钮鼠标悬浮时候的外观*/
|
||||||
|
#btnLogin:hover {
|
||||||
|
background-color: #008DEB;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
279
demoEx/Adminstor/_bin/res/mainForm.htm
Normal file
@@ -0,0 +1,279 @@
|
|||||||
|
<vlayout id="mainLayout" action="move">
|
||||||
|
<!-- 标题栏 -->
|
||||||
|
<hbox id="titleMain" height="30" margin-top="1" action="title">
|
||||||
|
<label margin-left="5" id="userImg" size="35,35" style="background-image: url(res/head.png); border-radius: 20px; border: 2px solid white; "></label>
|
||||||
|
<spacer></spacer>
|
||||||
|
<!-- 最小化按钮 -->
|
||||||
|
<button id="btnMinMain" size="20,20" style="background-color: #F5F5F5; font-size: 25px " text="-"></button>
|
||||||
|
<spacer width="4"></spacer>
|
||||||
|
<!-- 最大化按钮 -->
|
||||||
|
<button id="btnMaxMain" size="20,20" style="background-color: #F5F5F5; font-size: 14px " text="🗖"></button>
|
||||||
|
<spacer width="4"></spacer>
|
||||||
|
<!-- 退出按钮 -->
|
||||||
|
<button id="btnExitMain" size="20,20" style="background-color: #F5F5F5; font-size: 22px " text="×"></button>
|
||||||
|
<spacer width="5"></spacer>
|
||||||
|
</hbox>
|
||||||
|
|
||||||
|
<!-- 主界面区 -->
|
||||||
|
<hbox id="uiMain" margin-top="5">
|
||||||
|
<!-- 侧边栏 -->
|
||||||
|
<vlayout id="sideBar" width="40" style="background-color: #F5F5F5;">
|
||||||
|
<button class="sideButton" id="btnAdmin" margin-left="5" size="40,40" style="background-color: transparent; border-radius: 30px; font-size: 12px; " text="管理"></button>
|
||||||
|
<button class="sideButton" id="btnTools" margin-left="5" size="40,40" style="background-color: transparent; border-radius: 30px; font-size: 12px; " text="工具"></button>
|
||||||
|
<spacer></spacer>
|
||||||
|
<button class="sideButton" id="btnAbout" margin-left="5" size="40,40" style="background-color: transparent; border-radius: 30px; font-size: 12px; " text="关于"></button>
|
||||||
|
</vlayout>
|
||||||
|
<!-- 内容区,使用tablayout 选项卡布局-->
|
||||||
|
<tablayout id="mainTab" flex="0" style="background-color: #FFFFFF; border-radius: 5px;">
|
||||||
|
<!-- 第一个选项卡(管理) 垂直布局 -->
|
||||||
|
<vlayout id="mainTabAdmin" padding="10">
|
||||||
|
<spacer height="10"></spacer>
|
||||||
|
<!-- 第二层横向布局,IP输入框、搜搜框等 -->
|
||||||
|
<hlayout id="mainTabAdmin_Hlay" height="30">
|
||||||
|
<spacer width="10"></spacer>
|
||||||
|
<!-- 连接按钮 -->
|
||||||
|
<button id="btnAdminConnect" size="25,25" text="❌" style="color: #FFFFFF; background-color: #FF7774; border-radius: 3px; " />
|
||||||
|
<!-- IP输入框 -->
|
||||||
|
<textbox class="adminEdit" id="editAdminIP" text="127.0.0.1" margin-left="5" height="30" halign="center" placeholder="服务器地址" width="130" />
|
||||||
|
<spacer width="10"></spacer>
|
||||||
|
<!-- 测试按钮 -->
|
||||||
|
<button class="adminButtons" id="btnAdminTemp" size="60,30" text="测试" />
|
||||||
|
<spacer></spacer>
|
||||||
|
<!-- 搜索框 -->
|
||||||
|
<textbox class="adminEdit" height="30" halign="center" id="editAdminSerch" placeholder="搜索任意内容" width="150" />
|
||||||
|
<!-- 搜索按钮 -->
|
||||||
|
<button class="adminButtons" margin-left="3" id="btnAdminSerch" size="25,25" text="🔍" style="border-radius: 5px; " />
|
||||||
|
<spacer></spacer>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 第三层垂直布局 表格区域 -->
|
||||||
|
<vlayout id="mainTabAdmin_excelArea" margin-left="10px" margin-right="10px" margin-top="10px" style="border: 1px solid #808080; border-radius: 1px;">
|
||||||
|
<!-- 表格 -->
|
||||||
|
<tableview id="tableViewAdmin" headers="UidKey,IP,许可,本地期限,用户,备注,QQ,机器码,本地MD5,Ani路径集,购买详情,通用,女圣职,女鬼剑,魔枪,守护,暗夜,全职2觉,弓箭,待定1,待定2,待定3,待定4,待定5,待定6,待定7,待定8,待定9" header-height="35" first-column-type="check" first-column-width="40" cell-border-style="solid" cell-border-color="#cccccc" selected-row-back-color="#add8e6" cellfontsize="16"/>
|
||||||
|
<!-- 总体为水平布局,分为左右 -->
|
||||||
|
<hlayout height="150" style="border: 1px solid #808080; border-radius: 1px;">
|
||||||
|
<!-- 左边部分,再次分为上下 -->
|
||||||
|
<vlayout padding="5">
|
||||||
|
<tilelist padding="5">
|
||||||
|
<!-- UidKey -->
|
||||||
|
<hlayout size="180,25" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="Key:" width="40"></label>
|
||||||
|
<edit class="adminUserEdit" readonly="true" id="adminUserUidKey" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 许可 -->
|
||||||
|
<hlayout size="100,25" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="许可:" width="40"></label>
|
||||||
|
<!-- <edit class="adminUserEdit" readonly="true" text="默认" id="adminUserLisence" width="auto"></edit> -->
|
||||||
|
<select class="adminUserEdit" item="禁止, 默认, 验机" index="0" width="60"></select>
|
||||||
|
</hlayout>
|
||||||
|
<!-- ip -->
|
||||||
|
<hlayout size="155,25" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="IP:" width="40"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserIP" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 用户 -->
|
||||||
|
<hlayout size="155,25" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="用户:" width="40"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserName" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 备注 -->
|
||||||
|
<hlayout size="155,25" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="备注:" width="40"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserRemark" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 机器码 -->
|
||||||
|
<hlayout size="250,25" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="机器码:" width="40"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserMac" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 文件MD5 -->
|
||||||
|
<hlayout size="230,25" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="MD5:" width="40"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserMD5" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
</tilelist>
|
||||||
|
<!-- 总体为水平布局,左边还有个上下布局 -->
|
||||||
|
<hlayout>
|
||||||
|
<!-- 购买详情 -->
|
||||||
|
<hlayout height="auto" width="130" padding="5" margin-left="5" margin-right="10" margin-top="5" margin-bottom="10">
|
||||||
|
<label class="adminUserLable" text="购买:" width="40"></label>
|
||||||
|
<edit multiline="true" id="adminUserPurchased" width="auto" style="border: 1px solid #808080; border-radius: 2px; font-size: 10px; "></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- QQ -->
|
||||||
|
<hlayout height="auto" width="130" padding="5" margin-left="5" margin-right="10" margin-top="5" margin-bottom="10">
|
||||||
|
<label class="adminUserLable" text="QQ:" width="40"></label>
|
||||||
|
<edit multiline="true" id="adminUserQQ" width="auto" style="border: 1px solid #808080; border-radius: 2px; font-size: 10px; "></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- ani路径集 -->
|
||||||
|
<hlayout height="auto" padding="5" margin-left="5" margin-right="10" margin-top="5" margin-bottom="10">
|
||||||
|
<label class="adminUserLable" text="ani路径集:" width="80"></label>
|
||||||
|
<edit multiline="true" class="adminUserEdit" id="adminUserPaths" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
</hlayout>
|
||||||
|
</vlayout>
|
||||||
|
<!-- 右边部分,流式布局,子布局需要指定宽高 -->
|
||||||
|
<tilelist padding="5" style="border: 1px solid #808080; border-radius: 1px;">
|
||||||
|
<!-- 本地dnfdev.bin使用期限 -->
|
||||||
|
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="本地期限:" width="70"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserFileTime" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 基础功能期限 -->
|
||||||
|
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="基础期限:" width="70"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserCommonTime" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 女圣职期限 -->
|
||||||
|
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="女圣期限:" width="70"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserATPriestTime" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 女鬼剑期限 -->
|
||||||
|
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="女鬼期限:" width="70"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserATSwordmanTime" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 魔枪期限 -->
|
||||||
|
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="魔枪期限:" width="70"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserDemoniclancerTime" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 守护期限 -->
|
||||||
|
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="守护期限:" width="70"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserKnightTime" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 弓箭期限 -->
|
||||||
|
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="弓箭期限:" width="70"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserArcherTime" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 暗夜期限 -->
|
||||||
|
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="暗夜期限:" width="70"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserThiefTime" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 全职2觉期限 -->
|
||||||
|
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="二觉期限:" width="70"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserSkill2ndTime" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 待定1期限 -->
|
||||||
|
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="待定1期限:" width="70"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserTemp1Time" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 待定2期限 -->
|
||||||
|
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="待定2期限:" width="70"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserTemp2Time" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 待定3期限 -->
|
||||||
|
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="待定3期限:" width="70"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserTemp3Time" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 待定4期限 -->
|
||||||
|
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="待定4期限:" width="70"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserTemp4Time" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 待定5期限 -->
|
||||||
|
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="待定5期限:" width="70"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserTemp5Time" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 待定6期限 -->
|
||||||
|
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="待定6期限:" width="70"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserTemp6Time" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 待定7期限 -->
|
||||||
|
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="待定7期限:" width="70"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserTemp7Time" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 待定8期限 -->
|
||||||
|
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="待定8期限:" width="70"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserTemp8Time" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
<!-- 待定9期限 -->
|
||||||
|
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
|
||||||
|
<label class="adminUserLable" text="待定9期限:" width="70"></label>
|
||||||
|
<edit class="adminUserEdit" id="adminUserTemp9Time" width="auto"></edit>
|
||||||
|
</hlayout>
|
||||||
|
</tilelist>
|
||||||
|
</hlayout>
|
||||||
|
</vlayout>
|
||||||
|
<!-- 第四 输出框区域 -->
|
||||||
|
<textbox id="textAdminOutput" padding="5,5" margin-left="10px" valign="top" halign="left" readonly="true" multiline="true" margin-right="10px" margin-bottom="15px" height="100" style="border: 1px solid #808080; border-radius: 2px; font-size: 12px; background-color: #FAFAFA; " text=""></textbox>
|
||||||
|
</vlayout>
|
||||||
|
<!-- 第二个选项卡 垂直布局 -->
|
||||||
|
<vlayout id="mainTabTools" title="设置" padding="10">
|
||||||
|
<label text="这是工具页面"></label>
|
||||||
|
</vlayout>
|
||||||
|
</tablayout>
|
||||||
|
</hbox>
|
||||||
|
</vlayout>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#mainLayout {
|
||||||
|
background-color: #F5F5F5;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*侧边栏按钮:鼠标悬浮时候的外观*/
|
||||||
|
.sideButton:hover {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
/*侧边栏按钮:激活时候的外观*/
|
||||||
|
.sideButton:active {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*连接按钮:鼠标悬浮时候的外观*/
|
||||||
|
#btnAdminConnect:hover {
|
||||||
|
background-color: #29CE86;
|
||||||
|
}
|
||||||
|
/*连接按钮:激活时候的外观*/
|
||||||
|
#btnAdminConnect:active {
|
||||||
|
background-color: #31D690;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*业务区域按钮*/
|
||||||
|
.adminButtons {
|
||||||
|
color: #FFFFFF;
|
||||||
|
background-color: #00B96B;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
/*业务区域按钮:鼠标悬浮时候的外观*/
|
||||||
|
.adminButtons:hover {
|
||||||
|
background-color: #29CE86;
|
||||||
|
}
|
||||||
|
/*业务区域按钮:激活时候的外观*/
|
||||||
|
.adminButtons:active {
|
||||||
|
background-color: #31D690;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*管理界面中编辑框:*/
|
||||||
|
.adminEdit {
|
||||||
|
border: 1px solid #808080;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*管理界面中用户各属性的label:*/
|
||||||
|
.adminUserLable {
|
||||||
|
font-family: Arial;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
/*管理界面中用户各属性的编辑框:*/
|
||||||
|
.adminUserEdit {
|
||||||
|
border: 1px solid #808080;
|
||||||
|
border-radius: 2px;
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
BIN
demoEx/Adminstor/_bin/res/min1.png
Normal file
|
After Width: | Height: | Size: 146 B |
BIN
demoEx/Adminstor/_bin/res/min2.png
Normal file
|
After Width: | Height: | Size: 146 B |
BIN
demoEx/Adminstor/_bin/res/min3.png
Normal file
|
After Width: | Height: | Size: 146 B |
BIN
demoEx/Adminstor/_bin/res/setting.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |