Files
EzUI/CLAUDE.md
2026-01-24 22:42:46 +08:00

52 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## 项目概述
EzUI 是一个基于原生 Win32 消息机制和 Direct2D 的 C++ 桌面 UI 框架,提供类似 Web 前端的 CSS 样式系统和弹性布局。
## 构建命令
```bash
build.bat # 构建 32 位版本
build64.bat # 构建 64 位版本
```
或使用 CMake 直接构建:
```bash
cmake -B build
cmake --build build
```
## 核心架构
### 窗口类型 (继承层次)
- `Window` - 经典边框窗口
- `BorderlessWindow` - 无边框带阴影窗口
- `LayeredWindow` - 分层透明窗口,支持异形
- `PopupWindow` - 失焦自动关闭的弹出窗口
### 控件系统
所有控件继承自 `Control` 基类,核心控件包括:
- 基础控件:`Label`, `Button`, `TextBox`, `PictureBox`
- 选择控件:`CheckBox`, `RadioButton`, `ComboBox`
- 布局容器:`HLayout`, `VLayout`, `HListView`, `VListView`, `TileListView`, `TabLayout`
- 功能控件:`ScrollBar`, `Menu`, `NotifyIcon`, `ProgressBar`
### 样式与渲染
- `UIManager` - UI 样式与资源管理,支持 XML 布局加载
- `UISelector` - CSS 选择器匹配系统
- `Direct2DRender` - Direct2D 绘图实现
- `RenderTypes` - 颜色、对齐方式等绘图类型
### 事件系统
支持事件冒泡机制可实现事件捕获与穿透。Debug 模式下按 F11 可查看布局信息和控件边界。
## 开发约定
- 头文件位于 `include/EzUI/` 目录
- 源文件位于 `sources/` 目录
- 一切皆控件,纯代码组合 UI
- 使用 CSS 驱动视觉,结构与样式分离