Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自定义窗口图标和创建 UNICODE 窗口 #25

Merged
merged 6 commits into from
Jun 26, 2020

Conversation

chirsz-ever
Copy link
Collaborator

  • 增加函数 ege::seticon,支持通过传入图标资源 ID 设置 EGE 窗口图标。
  • 允许在 ege::initgraph 之前调用 ege::setcaptionege::seticon
  • 增加初始化选项 INIT_UNICODE,可由使用者选择创建 Unicode 窗口
  • 将一些函数调用由宏改为显式调用 ANSI/UNICODE 版本

通过传入图标资源 ID 设置 EGE 窗口图标
- 可在 `ege::initgraph` 之前调用 `ege::setcaption` 或 `ege::seticon`
- 永远创建 Unicode 窗口
- `_graph_setting` 使用 `calloc` 分配堆内存,默认清零
- `_graph_setting` 增加 `has_init` 与 `windows_icon` 成员
- `_graph_setting` 中 `windows_class_name` 和 `windows_caption`
  类型改为 `LPCWSTR`,宽字符串,`windows_class_name` 是静态字符串,
  `windows_caption` 是有所有权的堆上字符串
允许使用者自定义创建 UNICODE 窗口还是 ANSI 窗口
将注册窗口类放到了主进程中
增加了工具函数 `w2mb` 将宽字符串转换为 ANSI 字符串
Copy link
Owner

@wysaid wysaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

大概有这些……你先看看?

src/egegapi.cpp Outdated Show resolved Hide resolved
src/egegapi.cpp Outdated Show resolved Hide resolved
src/graphics.cpp Outdated Show resolved Hide resolved
- 将 `graph_setting` 定义为静态全局变量
- 使用 `std::string` 管理字符串
@chirsz-ever
Copy link
Collaborator Author

还有一些需要重构的东西,放在下个PR吧

@wysaid wysaid merged commit 3262ad2 into wysaid:master Jun 26, 2020
@chirsz-ever chirsz-ever deleted the add-set-icon branch June 26, 2020 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants