Compare commits
8 Commits
26-1
...
76be13001f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76be13001f | ||
|
|
814f42120c | ||
|
|
4fe4749826 | ||
|
|
2ff880c267 | ||
|
|
abcfc78596 | ||
|
|
bcbf890ebd | ||
|
|
9fe2fe5874 | ||
|
|
1be1ecbbf2 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -4,4 +4,6 @@ _temp/
|
||||
_bin/
|
||||
temp/
|
||||
bin/
|
||||
.vs/
|
||||
.vs/
|
||||
demo/
|
||||
*.lib
|
||||
16
CLAUDE.md
16
CLAUDE.md
@@ -9,20 +9,20 @@ EzUI 是一个基于原生 Win32 消息机制和 Direct2D 的 C++ 桌面 UI 框
|
||||
## 构建命令
|
||||
|
||||
```bash
|
||||
build.bat # 构建 32 位静态库
|
||||
build64.bat # 构建 64 位静态库
|
||||
build_x86.bat # 构建 32 位静态库
|
||||
build_x64.bat # 构建 64 位静态库
|
||||
```
|
||||
|
||||
CMake 构建:
|
||||
```bash
|
||||
cmake -B build
|
||||
cmake -B build # 默认静态库
|
||||
cmake --build build
|
||||
```
|
||||
|
||||
静态库/动态库切换:
|
||||
```bash
|
||||
cmake -B build -DBUILD_SHARED_LIBS=ON # 动态库
|
||||
cmake -B build -DBUILD_SHARED_LIBS=OFF # 静态库(默认)
|
||||
# 动态库
|
||||
cmake -B build -DBUILD_SHARED_LIBS=ON
|
||||
|
||||
# 仅构建库(不构建 demo)
|
||||
cmake -B build -DBUILD_DEMO=OFF
|
||||
```
|
||||
|
||||
## 核心架构
|
||||
|
||||
@@ -44,4 +44,7 @@ function(add_resource_package TARGET_NAME INPUT_DIR OUTPUT_FILE)
|
||||
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>
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="loginForm.h" />
|
||||
<ClInclude Include="mainForm.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="DemoUi.cpp" />
|
||||
<ClCompile Include="loginForm.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>
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
<ClInclude Include="loginForm.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="mainForm.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="DemoUi.cpp">
|
||||
@@ -38,6 +41,9 @@
|
||||
<ClCompile Include="loginForm.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mainForm.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<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);
|
||||
app.EnableHighDpi();//启用高DPI
|
||||
|
||||
|
||||
//创建登录创建
|
||||
loginForm loginFrm;
|
||||
loginFrm.Show();
|
||||
|
||||
Binary file not shown.
@@ -1,12 +1,15 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by DemoUi.rc
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ 生成的包含文件。
|
||||
// 供 DemoUi.rc 使用
|
||||
//
|
||||
#define IDD_INPUT 102
|
||||
#define IDC_EDIT1 1000
|
||||
|
||||
// <EFBFBD>¶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD>ֵ
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_RESOURCE_VALUE 104
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
#include "ezui/Application.h" //app类
|
||||
#include "EzUI/Window.h" //基础窗口类
|
||||
#include "EzUI/Button.h" //按钮
|
||||
@@ -18,4 +17,8 @@
|
||||
#include "EzUI/TileListView.h"//瓦片列表
|
||||
#include "EzUI/LayeredWindow.h"//分层窗口类-可以异型透明窗口
|
||||
#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 "mainForm.h"
|
||||
|
||||
void loginForm::OnNotify(Control* sender, EventArgs& args)
|
||||
{
|
||||
@@ -8,22 +9,31 @@ void loginForm::OnNotify(Control* sender, EventArgs& args)
|
||||
TextBox* editUser = (TextBox*)FindControl("user");
|
||||
TextBox* editpwd = (TextBox*)FindControl("pwd");
|
||||
CheckBox* ckbox = (CheckBox*)FindControl("ckbox");
|
||||
if (!ckbox->GetCheck()) {
|
||||
::MessageBoxW(Hwnd(), L"<EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD>Э<EFBFBD>鲢<EFBFBD><EFBFBD>ѡ!", L"<EFBFBD><EFBFBD>ʾ", MB_OK);
|
||||
/*if (!ckbox->GetCheck()) {
|
||||
::MessageBoxW(Hwnd(), L"请阅读协议并勾选!", L"提示", MB_OK);
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
UIString user = editUser->GetText();
|
||||
UIString pwd = editpwd->GetText();
|
||||
if (user == "718987717" && pwd == "123456") {
|
||||
::MessageBoxW(Hwnd(), L"<EFBFBD><EFBFBD>¼<EFBFBD>ɹ<EFBFBD>!", L"<EFBFBD><EFBFBD>ʾ", MB_OK);
|
||||
}
|
||||
else {
|
||||
::MessageBoxW(Hwnd(), L"<EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!", L"<EFBFBD><EFBFBD>ʾ", MB_OK);
|
||||
}
|
||||
|
||||
Hide(); // 隐藏登录窗口
|
||||
static mainForm mainForm;
|
||||
mainForm.Show(); // 显示主界面
|
||||
|
||||
//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") {
|
||||
Application::Exit();
|
||||
}
|
||||
// 打开链接
|
||||
if (!sender->GetAttribute("url").empty()) {
|
||||
::ShellExecuteA(0, "open", sender->GetAttribute("url").c_str(), "", "", SW_SHOW);
|
||||
}
|
||||
@@ -38,7 +48,7 @@ void loginForm::OnClose(bool& close)
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "pch.h"
|
||||
|
||||
using namespace ezui;
|
||||
|
||||
using Form = LayeredWindow; //֧<><D6A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><CDB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>Ӱ)
|
||||
//using Form = BorderlessWindow; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޱ߿<EFBFBD>(<28><><EFBFBD><EFBFBD>Ӱ)
|
||||
//using Form = Window; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
//using Form = LayeredWindow; //支持异形透明窗口(带阴影)
|
||||
//using Form = BorderlessWindow; //常规无边框窗口(带阴影)
|
||||
//using Form = Window; //标准窗口(带系统标题栏)
|
||||
|
||||
// <EFBFBD><EFBFBD>½<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
class loginForm :public Form
|
||||
// 登陆窗口
|
||||
class loginForm :public LayeredWindow
|
||||
{
|
||||
private:
|
||||
//ui<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//ui管理类
|
||||
UIManager umg;
|
||||
protected:
|
||||
virtual void OnNotify(Control* sender, EventArgs& args)override;//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>֪ͨ
|
||||
virtual void OnClose(bool& close)override;//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڹرյ<EFBFBD>ʱ<EFBFBD><EFBFBD>
|
||||
virtual void OnNotify(Control* sender, EventArgs& args)override;//重载事件通知
|
||||
virtual void OnClose(bool& close)override;//当窗口关闭的时候
|
||||
public:
|
||||
loginForm();
|
||||
virtual ~loginForm();
|
||||
|
||||
162
demo/Adminstor/Adminstor/mainForm.cpp
Normal file
162
demo/Adminstor/Adminstor/mainForm.cpp
Normal file
@@ -0,0 +1,162 @@
|
||||
#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"});
|
||||
// 获取表格指定位置数据
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ezui::OnMouseDoubleClick: //鼠标双击
|
||||
{
|
||||
//if (btnName == "titleMain") { //标题布局
|
||||
// if (this->IsMaximized()) {
|
||||
// this->ShowNormal();
|
||||
// }
|
||||
// else {
|
||||
// this->ShowMaximized();
|
||||
// }
|
||||
//}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (args.EventType == Event::OnMouseDown) {
|
||||
|
||||
|
||||
}
|
||||
__super::OnNotify(sender, args);
|
||||
}
|
||||
|
||||
void mainForm::OnClose(bool& close)
|
||||
{
|
||||
Application::Exit();
|
||||
}
|
||||
|
||||
mainForm::mainForm() :LayeredWindow(1000, 750)
|
||||
{
|
||||
SetResizable(true); // 启用窗口大小调整
|
||||
SetMiniSize(Size(600, 450)); // 设置最小尺寸
|
||||
umg.LoadXml("res/mainForm.htm");//加载xml里面的控件与样式
|
||||
umg.SetupUI(this);
|
||||
|
||||
AllocConsole();
|
||||
FILE* fp = nullptr;
|
||||
freopen_s(&fp, "CONOUT$", "w", stdout);
|
||||
freopen_s(&fp, "CONOUT$", "w", stderr);
|
||||
|
||||
|
||||
// 初始化设置表格各项属性
|
||||
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);
|
||||
tableView->SetColumnComboItems(2, { L"默认", L"禁止" , L"验机" });
|
||||
tableView->SetDefaultTextAlign(Align::MiddleCenter);
|
||||
|
||||
//设置列宽
|
||||
std::vector<int> withs = {60, 120, 50, 90, 85, 85, 100, 70, 70, 80, 80, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90};
|
||||
for(auto i=0;i< withs.size();i++)
|
||||
tableView->SetColumnWidth(i, withs[i]);
|
||||
|
||||
|
||||
// 鼠标右键单击的回调
|
||||
tableView->RightClick = [tableView](int row, int col) {
|
||||
int pRow = tableView->GetHoverRow(); //当前行号
|
||||
int pCol = tableView->GetHoverCol(); //当前列号
|
||||
UIString celContent = tableView->GetData(pRow, pCol);
|
||||
//std::cout << "单元格内容: " << celContent.ansi() << std::endl;
|
||||
std::cout << "当前列宽: " << tableView->GetColumnWidth(pCol) << std::endl;
|
||||
};
|
||||
|
||||
// 单元格编辑完成(编辑结束时触发,提供旧值与新值)
|
||||
tableView->CellEditFinished = [](int row, int col, const UIString& oldValue, const UIString& newValue) {
|
||||
std::cout << "单元格内容: " << newValue.ansi() << ", " << oldValue.ansi() << std::endl;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
mainForm::~mainForm()
|
||||
{
|
||||
}
|
||||
22
demo/Adminstor/Adminstor/mainForm.h
Normal file
22
demo/Adminstor/Adminstor/mainForm.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#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;//当窗口关闭的时候
|
||||
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"
|
||||
|
||||
480
demo/Adminstor/ThirdParty/EzUI/include/EzUI/TableView.h
vendored
Normal file
480
demo/Adminstor/ThirdParty/EzUI/include/EzUI/TableView.h
vendored
Normal file
@@ -0,0 +1,480 @@
|
||||
#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); // 浅蓝色
|
||||
|
||||
// 单元格内容变化回调(内容变化时立即触发)
|
||||
// 参数: row, col, newValue
|
||||
std::function<void(int, int, const UIString&)> CellValueChanged = nullptr;
|
||||
|
||||
// 单元格编辑完成回调(编辑结束时触发,比如TextBox失去焦点或按Enter时)
|
||||
// 参数: row, col, oldValue, newValue
|
||||
std::function<void(int, int, const UIString&, const UIString&)> CellEditFinished = nullptr;
|
||||
|
||||
// 鼠标右键单击回调
|
||||
// 参数: 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;
|
||||
int m_lastWidth = 0;
|
||||
int m_lastHeight = 0;
|
||||
bool m_multiLine = false;
|
||||
bool m_autoWrap = false; // 是否允许文字超宽时自动换行
|
||||
bool m_allowManualLineBreak = false; // 是否允许用户按Shift+Enter手动换行
|
||||
std::wstring m_text;//文字
|
||||
Size m_fontBox;
|
||||
bool m_down = false;//是否具有焦点中
|
||||
@@ -39,12 +40,17 @@ namespace ezui {
|
||||
std::wstring m_placeholder;//placeholder懂得都懂 (在没有文字的情况下显示的文字)
|
||||
std::wstring m_passwordChar;
|
||||
bool m_readOnly = false;//是否只读
|
||||
// 内边距(四边独立)
|
||||
int m_padLeft = 6;
|
||||
int m_padTop = 4;
|
||||
int m_padRight = 6;
|
||||
int m_padBottom = 4;
|
||||
public:
|
||||
//文字对其方式(针对单行输入框有效)
|
||||
TextAlign TextAlign = TextAlign::MiddleLeft;
|
||||
private:
|
||||
void Init();
|
||||
void InsertUnicode(const std::wstring& str);//插入unicode文字内部使用
|
||||
void InsertUnicode(const std::wstring& str, bool isEnd = false);//插入unicode文字内部使用
|
||||
bool DeleteRange();//删除选中内容
|
||||
bool GetSelectedRange(int* outPos, int* outCount);//获取当前被选中的区域 返回下标和个数
|
||||
bool Copy();//复制到剪切板
|
||||
@@ -69,28 +75,36 @@ namespace ezui {
|
||||
virtual void OnKillFocus(const KillFocusEventArgs& arg) override;
|
||||
virtual void OnLayout();
|
||||
void Offset(int moveY);
|
||||
// 支持 TextBox 自身扩展样式属性(padding 系列)
|
||||
virtual bool ApplyStyleProperty(const UIString& key, const UIString& value) override;
|
||||
public:
|
||||
std::function<void(const UIString&)> TextChanged = NULL;
|
||||
public:
|
||||
TextBox(Object* parentObject = NULL);
|
||||
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 Rect GetCareRect()override;
|
||||
//分析字符串
|
||||
void Analysis();
|
||||
//在当前光标中插入文字
|
||||
void Insert(const UIString& str);
|
||||
void Insert(const UIString& str, bool isEnd = false);
|
||||
//获取输入框文字
|
||||
const UIString GetText();
|
||||
//获取滚动条
|
||||
virtual ScrollBar* GetScrollBar()override;
|
||||
//设置文字
|
||||
void SetText(const UIString& text);
|
||||
//是否多行显示
|
||||
//是否多行显示(兼容旧版:仅调用autoWrap参数)
|
||||
bool IsMultiLine();
|
||||
//设置是否多行显示
|
||||
void SetMultiLine(bool multiLine);
|
||||
// autoWrap: 文字超宽时是否自动换行
|
||||
// allowManualLineBreak: 是否允许用户按Shift+Enter手动换行
|
||||
void SetMultiLine(bool autoWrap, bool allowManualLineBreak = false);
|
||||
//设置为是否只读
|
||||
void SetReadOnly(bool bReadOnly);
|
||||
//是否为只读
|
||||
@@ -101,5 +115,7 @@ namespace ezui {
|
||||
void SetPlaceholderText(const UIString& text);
|
||||
//设置密码框占位符(建议单字符)
|
||||
void SetPasswordChar(const UIString& passwordChar);
|
||||
// 设置焦点并初始化光标到指定位置(-1表示文本末尾)
|
||||
void SetFocusAndCaret(int caretPos = -1);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "ProgressBar.h"
|
||||
#include "Window.h"
|
||||
#include "ComboBox.h"
|
||||
#include "TableView.h"
|
||||
|
||||
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 "Timer.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Window.h"
|
||||
#include "Resource.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "EzUI.h"
|
||||
|
||||
namespace ezui {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Window.h"
|
||||
#include "ShadowBox.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Label.h"
|
||||
|
||||
namespace ezui {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Label.h"
|
||||
|
||||
namespace ezui {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "TextBox.h"
|
||||
#include "Label.h"
|
||||
#include "VListView.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "EzUI.h"
|
||||
|
||||
namespace ezui {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "UIDef.h"
|
||||
#if USED_DIRECT2D
|
||||
#ifndef UI_EXPORT
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*/
|
||||
/*/
|
||||
Author:yang
|
||||
Email:19980103ly@gmail.com/718987717@qq.com
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "EzUI.h"
|
||||
#include "UILoader.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Control.h"
|
||||
|
||||
namespace ezui {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "PagedListView.h"
|
||||
#include "HScrollBar.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Control.h"
|
||||
#include "ScrollBar.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Control.h"
|
||||
|
||||
namespace ezui {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "BorderlessWindow.h"
|
||||
#include "Bitmap.h"
|
||||
#include "Task.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "EzUI.h"
|
||||
|
||||
namespace ezui {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Menu.h"
|
||||
#include <shellapi.h>
|
||||
namespace ezui {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Control.h"
|
||||
|
||||
namespace ezui {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Control.h"
|
||||
#include "Timer.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Window.h"
|
||||
#include "BorderlessWindow.h"
|
||||
#include "LayeredWindow.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "CheckBox.h"
|
||||
|
||||
namespace ezui {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include <Windows.h>
|
||||
|
||||
namespace ezui {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "UIString.h"
|
||||
|
||||
namespace ezui {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Control.h"
|
||||
#include "Animation.h"
|
||||
namespace ezui {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Window.h"
|
||||
#include "Bitmap.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Control.h"
|
||||
|
||||
namespace ezui {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Control.h"
|
||||
#include "Timer.h"
|
||||
#include "Animation.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "EzUI.h"
|
||||
namespace ezui {
|
||||
namespace detail {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Control.h"
|
||||
#include "VScrollBar.h"
|
||||
#include "Timer.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "PagedListView.h"
|
||||
#include "VScrollBar.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "EzUI.h"
|
||||
#include "Task.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "HListView.h"
|
||||
#include "VListView.h"
|
||||
namespace ezui {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Control.h"
|
||||
#include "Spacer.h"
|
||||
#include "HLayout.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "UILoader.h"
|
||||
|
||||
namespace ezui {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "UIDef.h"
|
||||
#include <codecvt>
|
||||
#include <iomanip>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "EzUI.h"
|
||||
namespace ezui {
|
||||
struct Style
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Control.h"
|
||||
|
||||
namespace ezui {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "PagedListView.h"
|
||||
#include "VScrollBar.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Control.h"
|
||||
#include "ScrollBar.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Control.h"
|
||||
#include "ScrollBar.h"
|
||||
#include "Spacer.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
www.sourceforge.net/projects/tinyxml
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
www.sourceforge.net/projects/tinyxml
|
||||
Original code by Lee Thomason (www.grinninglizard.com)
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ file(GLOB src ./ResPackage/*.*)
|
||||
add_executable(ResPackage WIN32 ${src} )
|
||||
target_include_directories(ResPackage PRIVATE ${include})
|
||||
target_link_libraries(ResPackage PRIVATE EzUI)
|
||||
set_property(TARGET ResPackage PROPERTY FOLDER "demo")
|
||||
|
||||
|
||||
#仿QQ登录界面
|
||||
|
||||
@@ -1 +1 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
@@ -1,2 +1,2 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "framework.h"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by DemoUi.rc
|
||||
|
||||
// <EFBFBD>¶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD>ֵ
|
||||
// 新对象的下一组默认值
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#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)
|
||||
{
|
||||
@@ -19,7 +20,10 @@ void LoginForm::OnNotify(Control* sender, EventArgs& args)
|
||||
UIString user = editUser->GetText();
|
||||
UIString pwd = editpwd->GetText();
|
||||
if (user == "718987717" && pwd == "123456") {
|
||||
::MessageBox(Hwnd(), L"登录成功!", L"提示", MB_OK);
|
||||
// 登录成功,跳转到主界面
|
||||
Hide(); // 隐藏登录窗口
|
||||
static MainForm mainForm;
|
||||
mainForm.Show(); // 显示主界面
|
||||
}
|
||||
else {
|
||||
::MessageBox(Hwnd(), L"用户名或密码错误!", L"提示", MB_OK);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "ezui/Application.h" //app类
|
||||
#include "EzUI/Window.h" //基础窗口类
|
||||
#include "EzUI/Button.h" //按钮
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "EzUI/LayeredWindow.h"//分层窗口类-可以异型透明窗口
|
||||
#include "ezui/UIManager.h"//ui管理类(使用xml生成控件)
|
||||
|
||||
#pragma comment(lib,"ezui.lib")
|
||||
using namespace ezui;
|
||||
|
||||
using Form = LayeredWindow; //支持异形透明窗口(带阴影)
|
||||
|
||||
@@ -9,7 +9,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
Application app(hInstance);
|
||||
app.EnableHighDpi();//启用高DPI
|
||||
app.SetResource("my_res");//设定资源名称
|
||||
|
||||
|
||||
//创建登录创建
|
||||
LoginForm loginFrm;
|
||||
loginFrm.Show();
|
||||
|
||||
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 File {
|
||||
bool Exists(const UIString& filename) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "EzUI/EzUI.h"
|
||||
#include "EzUI/UIString.h"
|
||||
namespace ezui {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "mainFrom.h"
|
||||
#include "mainFrom.h"
|
||||
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
_In_opt_ HINSTANCE hPrevInstance,
|
||||
_In_ LPWSTR lpCmdLine,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "mainFrom.h"
|
||||
#include "mainFrom.h"
|
||||
#include "FileSystem.h"
|
||||
|
||||
const wchar_t* xml = LR"xml(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "EzUI/Application.h"
|
||||
#include "EzUI/Application.h"
|
||||
#include "EzUI/VLayout.h"
|
||||
#include "EzUI/TextBox.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>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "desktopLrcFrm.h"
|
||||
#include "desktopLrcFrm.h"
|
||||
|
||||
HWND GetDeskTopWnd() {
|
||||
HWND windowHandle = ::FindWindowW(L"Progman", L"Program Manager");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "global.h"
|
||||
#include "global.h"
|
||||
#include "lrcPanel.h"
|
||||
#include "VlcPlayer.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "mainFrm.h"
|
||||
#include "mainFrm.h"
|
||||
MainFrm::MainFrm() :Form(1020, 690)
|
||||
{
|
||||
InitForm();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "global.h"
|
||||
#include "widgets.h"
|
||||
#include "vlcPlayer.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "vlcPlayer.h"
|
||||
#include "vlcPlayer.h"
|
||||
void* lock_cb(void* opaque, void** planes)
|
||||
{
|
||||
VlcPlayer* vp = (VlcPlayer*)opaque;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "EzUI/Control.h"
|
||||
#include "EzUI/BorderlessWindow.h"
|
||||
#include "EzUI/Label.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
base64.cpp and base64.h
|
||||
base64 encoding and decoding with C++.
|
||||
More information at
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
//
|
||||
// base64 encoding and decoding with C++.
|
||||
// Version: 2.rc.08 (release candidate)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "global.h"
|
||||
#include "global.h"
|
||||
|
||||
namespace global {
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user