Skip to content

Latest commit

 

History

History
78 lines (56 loc) · 3.5 KB

File metadata and controls

78 lines (56 loc) · 3.5 KB

CCsample (Lightweight GDI UI Library)

Status Platform Language Style

[中文] | English


⚠️ 注意 / Note

[CN] 本项目已停止更新。这是一个早期的 C++ 自绘界面库尝试,代码仅供学习和参考。

[EN] This project is discontinued. It is an early experiment in C++ custom UI rendering. The code is for educational and archival purposes only.


📖 项目简介 (Project Description)

CCsample 是一个基于 Windows GDI 的极轻量级 C++ 自绘界面库演示。 它旨在提供一个不依赖 CRT (C Runtime)、体积极小且易于集成的 GUI 解决方案。整个核心类库代码量控制在 1500 行左右,视觉风格模仿了 Windows 8 的扁平化设计。

✨ 核心特性 (Features)

  • 纯 GDI 自绘:不使用标准的 Windows 控件,所有元素均为 GDI 绘制,通过逻辑处理点击区域。
  • NoCRT:不依赖 C 运行时库,极大地减小了编译体积,便于移植或在特殊环境下运行。
  • 极简设计
    • 核心类代码仅约 1500 行
    • Win8 风格:扁平化、简洁的视觉效果。
  • 支持控件
    • 文本绘制 (String)
    • 按钮 (Button)
    • 框架/容器 (Frame)
    • 输入框 (Edit)
    • 复选框 (Checkbox)
  • 布局系统:支持绝对定位 (Absolute Positioning),精确控制每个像素。

📂 目录结构 (基于截图)

  • GUI.sln: Visual Studio 解决方案文件。
  • GUI/: 源代码目录,包含核心 GDI 绘制逻辑与控件实现。
  • Files/: 资源文件或依赖文件。

📖 English Description

CCsample is a sample project demonstrating a super-lightweight, custom-drawn C++ GUI library based on Windows GDI. It was designed to provide a GUI solution that is NoCRT (does not rely on the C Runtime), extremely compact, and easy to integrate. The core class implementation is kept under 1500 lines of code, featuring a visual style mimicking the Windows 8 flat design.

✨ Key Features

  • Pure GDI Custom Drawing: Does not use standard Windows controls (User32 controls). All elements are rendered via GDI, with custom logic for hit-testing and interaction.
  • NoCRT: No dependency on the C Runtime Library. This results in a very small binary size and makes it suitable for environments where CRT is not desirable.
  • Minimalist Design:
    • Core class is approximately 1500 lines of code.
    • Win8 Style: Clean, flat visual aesthetics.
  • Supported Controls:
    • String/Text Rendering
    • Buttons
    • Frames (Containers)
    • Edit Boxes (Input)
    • Checkboxes
  • Layout: Supports Absolute Positioning for pixel-perfect control.

📂 Structure

  • GUI.sln: Visual Studio solution file.
  • GUI/: Source code directory containing the GDI rendering logic and control implementations.
  • Files/: Resources or auxiliary files.

⚖️ 免责声明 (Disclaimer)

本项目按“原样”提供,不包含任何形式的保证。作者不对使用本项目代码造成的任何后果负责。

This software is provided "as is", without warranty of any kind. The author is not responsible for any issues arising from the use of this code.