Compare commits
2 Commits
9fe2fe5874
...
abcfc78596
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
abcfc78596 | ||
|
|
bcbf890ebd |
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
|
||||
```
|
||||
|
||||
## 核心架构
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
@@ -18,4 +18,7 @@
|
||||
#include "EzUI/LayeredWindow.h"//分层窗口类-可以异型透明窗口
|
||||
#include "ezui/UIManager.h"//ui管理类(使用xml生成控件)
|
||||
#include "EzUI/Animation.h"
|
||||
#include "EzUI/TableView.h"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "pch.h"
|
||||
#include "mainForm.h"
|
||||
|
||||
|
||||
void mainForm::OnNotify(Control* sender, EventArgs& args)
|
||||
{
|
||||
UIString btnName = sender->Name; // 控件id
|
||||
@@ -49,9 +50,18 @@ void mainForm::OnNotify(Control* sender, EventArgs& args)
|
||||
}
|
||||
else if (btnName == "btnAdminTemp") { //管理页面的测试按钮
|
||||
TextBox* textAdmin = (TextBox*)FindControl("textAdminOutput"); //获取输出框
|
||||
//textAdmin->Insert(L"\n测试成功!", true);
|
||||
if (textAdmin) {
|
||||
textAdmin->Insert(L"\n测试成功!",true);
|
||||
textAdmin->GetScrollBar()->ScrollTo(1.0);
|
||||
}
|
||||
|
||||
TableView* tableView = (TableView*)FindControl("tableViewAdmin"); //获取表格控件
|
||||
if (tableView) {
|
||||
tableView->SetColumnType(4, ezui::CellType::CheckBox);
|
||||
tableView->SetColumnType(5, ezui::CellType::ComboBox);
|
||||
tableView->SetColumnComboItems(5, {L"选择1", L"选择2" , L"选择3" });
|
||||
tableView->InsertRow(1);
|
||||
tableView->SetRowData(tableView->GetRowCount() - 1, {L"uid1", L"192.168.200.131"});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,17 +4,19 @@
|
||||
using namespace ezui;
|
||||
|
||||
|
||||
|
||||
// 主窗口
|
||||
class mainForm :public LayeredWindow
|
||||
{
|
||||
private:
|
||||
//ui管理类
|
||||
UIManager umg;
|
||||
protected:
|
||||
virtual void OnNotify(Control* sender, EventArgs& args)override;//重载事件通知
|
||||
virtual void OnClose(bool& close)override;//当窗口关闭的时候
|
||||
public:
|
||||
//ui管理类
|
||||
UIManager umg;
|
||||
mainForm();
|
||||
virtual ~mainForm();
|
||||
|
||||
};
|
||||
|
||||
|
||||
430
demo/Adminstor/ThirdParty/EzUI/include/EzUI/TableView.h
vendored
Normal file
430
demo/Adminstor/ThirdParty/EzUI/include/EzUI/TableView.h
vendored
Normal file
@@ -0,0 +1,430 @@
|
||||
#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;
|
||||
bool HasBorderColor = false;
|
||||
bool HasBorderStyle = false;
|
||||
bool HasBackColor = false;
|
||||
bool HasForeColor = 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 Reset() {
|
||||
HasBorderColor = false;
|
||||
HasBorderStyle = false;
|
||||
HasBackColor = false;
|
||||
HasForeColor = 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; // 当前排序状态
|
||||
};
|
||||
|
||||
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";
|
||||
|
||||
// 表头样式
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
// 全选
|
||||
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);
|
||||
|
||||
// ============ 鼠标悬停信息 ============
|
||||
|
||||
// 获取鼠标当前悬停的行号(-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;
|
||||
};
|
||||
|
||||
};
|
||||
@@ -112,5 +112,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)
|
||||
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
#include "pch.h"
|
||||
#include "mainForm.h"
|
||||
|
||||
|
||||
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") { //管理页面的连接按钮按下,先获取 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) {
|
||||
tableView->SetColumnType(4, ezui::CellType::CheckBox);
|
||||
tableView->SetColumnType(5, ezui::CellType::ComboBox);
|
||||
tableView->SetColumnComboItems(5, {L"选择1", L"选择2"});
|
||||
tableView->InsertRow(1);
|
||||
tableView->SetRowData(tableView->GetRowCount() - 1, {L"uid1", L"192.168.200.131"});
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
mainForm::~mainForm()
|
||||
{
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "EzUI/EzUI.h"
|
||||
#include "EzUI/TextBox.h"
|
||||
#include "EzUI/BorderlessWindow.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <functional>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include <Windows.h>
|
||||
#include "Text.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include <functional>
|
||||
#include <fstream>
|
||||
#include <Windows.h>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <Windows.h>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include <iostream>
|
||||
|
||||
#include "FileSystem.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <Windows.h>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Text.h"
|
||||
#include "FileSystem.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include <Windows.h>
|
||||
#include <string>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <Windows.h>
|
||||
#include <functional>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include <map>
|
||||
#include <functional>
|
||||
#include <Windows.h>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "Text.h"
|
||||
#include "FileSystem.h"
|
||||
#include <Windows.h>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// base64 encoding and decoding with C++.
|
||||
// Version: 2.rc.09 (release candidate)
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef CURLINC_CURL_H
|
||||
#ifndef CURLINC_CURL_H
|
||||
#define CURLINC_CURL_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef CURLINC_CURLVER_H
|
||||
#ifndef CURLINC_CURLVER_H
|
||||
#define CURLINC_CURLVER_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef CURLINC_EASY_H
|
||||
#ifndef CURLINC_EASY_H
|
||||
#define CURLINC_EASY_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef CURLINC_MPRINTF_H
|
||||
#ifndef CURLINC_MPRINTF_H
|
||||
#define CURLINC_MPRINTF_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef CURLINC_MULTI_H
|
||||
#ifndef CURLINC_MULTI_H
|
||||
#define CURLINC_MULTI_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef CURLINC_OPTIONS_H
|
||||
#ifndef CURLINC_OPTIONS_H
|
||||
#define CURLINC_OPTIONS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef CURLINC_STDCHEADERS_H
|
||||
#ifndef CURLINC_STDCHEADERS_H
|
||||
#define CURLINC_STDCHEADERS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef CURLINC_SYSTEM_H
|
||||
#ifndef CURLINC_SYSTEM_H
|
||||
#define CURLINC_SYSTEM_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef CURLINC_TYPECHECK_GCC_H
|
||||
#ifndef CURLINC_TYPECHECK_GCC_H
|
||||
#define CURLINC_TYPECHECK_GCC_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user