新增示例

This commit is contained in:
2026-02-25 22:24:40 +08:00
parent cf51900c96
commit 78fa2665b0
30 changed files with 856 additions and 3 deletions

6
.gitignore vendored
View File

@@ -5,10 +5,10 @@
/_temp /_temp
/_bin /_bin
/lib /lib
/temp
/bin
/.vs /.vs
/.vscode
*.db *.db
*.gitignore *.gitignore
*.gitattributes *.gitattributes
*.tlog *.exe
*.pdb

View File

@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.36811.4 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Adminstor", "Adminstor\Adminstor.vcxproj", "{EE06DEDC-52B5-4B5D-8B52-7FEB02D77E6B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EE06DEDC-52B5-4B5D-8B52-7FEB02D77E6B}.Debug|x64.ActiveCfg = Debug|x64
{EE06DEDC-52B5-4B5D-8B52-7FEB02D77E6B}.Debug|x64.Build.0 = Debug|x64
{EE06DEDC-52B5-4B5D-8B52-7FEB02D77E6B}.Debug|x86.ActiveCfg = Debug|Win32
{EE06DEDC-52B5-4B5D-8B52-7FEB02D77E6B}.Debug|x86.Build.0 = Debug|Win32
{EE06DEDC-52B5-4B5D-8B52-7FEB02D77E6B}.Release|x64.ActiveCfg = Release|x64
{EE06DEDC-52B5-4B5D-8B52-7FEB02D77E6B}.Release|x64.Build.0 = Release|x64
{EE06DEDC-52B5-4B5D-8B52-7FEB02D77E6B}.Release|x86.ActiveCfg = Release|Win32
{EE06DEDC-52B5-4B5D-8B52-7FEB02D77E6B}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AC1EAB6C-7DC1-484D-92AE-6736232936CA}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,203 @@
<?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>{ee06dedc-52b5-4b5d-8b52-7feb02d77e6b}</ProjectGuid>
<RootNamespace>Adminstor</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>
</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>EzUI_$(Configuration)_$(Platform).lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>
</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<AdditionalDependencies>EzUI_$(Configuration)_$(Platform).lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>
</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>EzUI_$(Configuration)_$(Platform).lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>
</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<AdditionalDependencies>EzUI_$(Configuration)_$(Platform).lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="framework.h" />
<ClInclude Include="mainForm.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="Resource.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Main.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>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Image Include="DemoUi.ico" />
<Image Include="small.ico" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="DemoUi.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" 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>
<ClInclude Include="framework.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="Resource.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="pch.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="mainForm.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Main.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="pch.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="mainForm.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Image Include="small.ico">
<Filter>资源文件</Filter>
</Image>
<Image Include="DemoUi.ico">
<Filter>资源文件</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="DemoUi.rc">
<Filter>资源文件</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

View 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>

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

View File

@@ -0,0 +1,15 @@
#include "pch.h"
#include "mainForm.h"
int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow)
{
//app类
Application app(hInstance);
app.EnableHighDpi();//启用高DPI
//创建
mainForm nainFrm;
nainFrm.Show();
return app.Exec();//进行消息循环
}

View File

@@ -0,0 +1,18 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ 生成的包含文件。
// 供 DemoUi.rc 使用
//
#define IDI_SMALL 101
#define IDD_INPUT 102
#define IDC_EDIT1 1000
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 104
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -0,0 +1,21 @@
#pragma once
#include "resource.h"
#include <windows.h>
#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/Animation.h"

View File

@@ -0,0 +1,133 @@
#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"); //获取输出框
//textAdmin->Insert(L"\n测试成功", true);
if (textAdmin) {
textAdmin->Insert(L"\n测试成功!",true);
}
}
}
break;
case ezui::OnMouseDoubleClick: //鼠标双击
{
}
break;
default:
break;
}
if (args.EventType == Event::OnMouseDown) {
}
__super::OnNotify(sender, args);
}
void mainForm::OnClose(bool& close)
{
Application::Exit();
}
mainForm::mainForm() :LayeredWindow(1500, 750)
{
// 如果是debug模式则创建控制台窗口用于输出调试信息
#ifdef _DEBUG
AllocConsole();
FILE* fp = nullptr;
freopen_s(&fp, "CONOUT$", "w", stdout);
freopen_s(&fp, "CONOUT$", "w", stderr);
std::cout << "调试模式控制台已启动!" << std::endl;
#endif
SetResizable(true); // 启用窗口大小调整
SetMiniSize(Size(600, 450)); // 设置最小尺寸
umg.LoadXml("res/mainForm.htm");//加载xml里面的控件与样式
umg.SetupUI(this);
// 通过资源ID加载图标 (在 app.rc 中定义 IDI_SMALL=101)
HICON hIco = (HICON)::LoadImageW(GetModuleHandleW(nullptr), MAKEINTRESOURCEW(IDI_SMALL), IMAGE_ICON, 32, 32, 0);
if (hIco) SetIcon(hIco);
// 初始化设置表格各项属性
TableView* tableView = (TableView*)FindControl("tableViewAdmin"); //获取表格控件
if (tableView) {
tableView->SelectedRowBackColor = Color(200, 230, 255); // 设置选中行背景色
//tableView->SetColumnType(5, ezui::CellType::CheckBox);
tableView->SetColumnType(0, ezui::CellType::ReadOnly); //设置第1列为只读类型
tableView->SetColumnType(2, ezui::CellType::ComboBox); //设置第3列为下拉列表类型
tableView->SetColumnComboItems(2, { L"禁止", L"开通" , L"验机" }); //设置第3列下拉列表内容
tableView->SetDefaultTextAlign(Align::MiddleCenter); //设置默认对齐方式
tableView->SetColumnTextAlign(7, Align::MiddleLeft); //设置机器码列对齐
tableView->SetColumnTextAlign(8, Align::MiddleLeft); //设置列对齐
tableView->SetColumnTextAlign(9, Align::MiddleLeft); //设置列对齐
//设置列宽
std::vector<int> withs = { 60, 130, 55, 95, 85, 85, 105, 70, 75, 80, 80, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95 };
for (size_t i = 0; i < withs.size(); i++)
tableView->SetColumnWidth(i, withs[i]);
// 单元格编辑完成(编辑结束时触发,提供旧值与新值)
tableView->CellEditFinished = [](int row, int col, const UIString& oldValue, const UIString& newValue) {
//std::cout << "完成编辑单元格内容: " << newValue.ansi() << ", " << oldValue.ansi() << std::endl;
};
// 单元格内容变化回调(内容变化时立即触发)
tableView->CellValueChanged = [](int row, int col, const UIString& newValue) {
std::cout << "单元格内容变化回调: " << newValue.ansi() << std::endl;
};
}
}
mainForm::~mainForm()
{
}

View File

@@ -0,0 +1,20 @@
#pragma once
#include "pch.h"
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:
mainForm();
virtual ~mainForm();
};

View File

@@ -0,0 +1 @@
#include "pch.h"

View File

@@ -0,0 +1,2 @@
#pragma once
#include "framework.h"

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 784 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@@ -0,0 +1,71 @@
<vlayout id="mainLayout" action="move">
<!-- 标题栏 -->
<hbox height="20" margin-top="5" action="move">
<spacer></spacer>
<!-- 退出按钮 -->
<button id="btnExit" size="20,20" action="close" style="background-image: url(res/close.png)"></button>
<spacer width="10"></spacer>
</hbox>
<!-- 头像 -->
<!--<spacer height="40"></spacer>-->
<label margin-top="30" id="headImg" size="80,80" action="move"></label>
<!-- 账号输入框 -->
<hbox margin-top="25" size="258,42" style="border-radius:5px;background-color:white;">
<input id="user" halign="center" placeholder="输入账号" />
</hbox>
<!-- 密码输入框 -->
<hbox margin-top="10" size="258,42" style="border-radius:5px;background-color:white;">
<input passwordchar="*" id="pwd" halign="center" placeholder="输入密码" />
</hbox>
<!-- 协议勾选 -->
<hbox size="258,42" margin-top="10" style="font-size:12px">
<checkbox size="18,18" id="ckbox"></checkbox>
<label width="auto" text="我已阅读并同意"></label>
<button url="www.baidu.com" width="auto" style="color: #2D77E5;cursor:pointer" text="服务协议"></button>
<label width="auto" text="和"></label>
<button url="www.bing.com" width="auto" style="color: #2D77E5" text="隐私保护指引" title="OOO"></button>
</hbox>
<!-- 登陆按钮 -->
<button margin-top="15" size="258,38" id="btnLogin" text="登录" visible="true"> </button>
<!-- 离线模式按钮 -->
<button margin-top="15" size="258,38" id="btnOffLine" text="离线进入" style="background-color: #0099FF; color: white; border-radius: 8px" visible="true"> </button>
</vlayout>
<style>
#mainLayout {
background-color: #E8F0FF;
border-radius: 5px;
font-size: 14px;
}
#headImg {
background-image: url(res/head.png);
border-radius: 80px;
border: 2px solid white;
}
#ckbox {
background-image: url(res/check.png);
}
#ckbox:checked {
background-image: url(res/check_1.png);
}
#btnLogin {
background-color: #0099FF;
color: white;
border-radius: 8px;
}
/*登录按钮鼠标悬浮时候的外观*/
#btnLogin:hover {
background-color: #008DEB;
}
</style>

View File

@@ -0,0 +1,279 @@
<vlayout id="mainLayout" action="move">
<!-- 标题栏 -->
<hbox id="titleMain" height="30" margin-top="1" action="title">
<label margin-left="5" id="userImg" size="35,35" style="background-image: url(res/head.png); border-radius: 20px; border: 2px solid white; "></label>
<spacer></spacer>
<!-- 最小化按钮 -->
<button id="btnMinMain" size="20,20" style="background-color: #F5F5F5; font-size: 25px " text="-"></button>
<spacer width="4"></spacer>
<!-- 最大化按钮 -->
<button id="btnMaxMain" size="20,20" style="background-color: #F5F5F5; font-size: 14px " text="🗖"></button>
<spacer width="4"></spacer>
<!-- 退出按钮 -->
<button id="btnExitMain" size="20,20" style="background-color: #F5F5F5; font-size: 22px " text="×"></button>
<spacer width="5"></spacer>
</hbox>
<!-- 主界面区 -->
<hbox id="uiMain" margin-top="5">
<!-- 侧边栏 -->
<vlayout id="sideBar" width="40" style="background-color: #F5F5F5;">
<button class="sideButton" id="btnAdmin" margin-left="5" size="40,40" style="background-color: transparent; border-radius: 30px; font-size: 12px; " text="管理"></button>
<button class="sideButton" id="btnTools" margin-left="5" size="40,40" style="background-color: transparent; border-radius: 30px; font-size: 12px; " text="工具"></button>
<spacer></spacer>
<button class="sideButton" id="btnAbout" margin-left="5" size="40,40" style="background-color: transparent; border-radius: 30px; font-size: 12px; " text="关于"></button>
</vlayout>
<!-- 内容区使用tablayout 选项卡布局-->
<tablayout id="mainTab" flex="0" style="background-color: #FFFFFF; border-radius: 5px;">
<!-- 第一个选项卡(管理) 垂直布局 -->
<vlayout id="mainTabAdmin" padding="10">
<spacer height="10"></spacer>
<!-- 第二层横向布局IP输入框、搜搜框等 -->
<hlayout id="mainTabAdmin_Hlay" height="30">
<spacer width="10"></spacer>
<!-- 连接按钮 -->
<button id="btnAdminConnect" size="25,25" text="❌" style="color: #FFFFFF; background-color: #FF7774; border-radius: 3px; " />
<!-- IP输入框 -->
<textbox class="adminEdit" margin-left="5" height="30" halign="center" id="servIP" placeholder="服务器地址" width="130" />
<spacer width="10"></spacer>
<!-- 测试按钮 -->
<button class="adminButtons" id="btnAdminTemp" size="60,30" text="测试" />
<spacer></spacer>
<!-- 搜索框 -->
<textbox class="adminEdit" height="30" halign="center" id="editAdminSerch" placeholder="搜索任意内容" width="150" />
<!-- 搜索按钮 -->
<button class="adminButtons" margin-left="3" id="btnAdminSerch" size="25,25" text="🔍" style="border-radius: 5px; " />
<spacer></spacer>
</hlayout>
<!-- 第三层垂直布局 表格区域 -->
<vlayout id="mainTabAdmin_excelArea" margin-left="10px" margin-right="10px" margin-top="10px" style="border: 1px solid #808080; border-radius: 1px;">
<!-- 表格 -->
<tableview id="tableViewAdmin" headers="UidKey,IP,许可,本地期限,用户,备注,QQ,机器码,本地MD5,Ani路径集,购买详情,通用,女圣职,女鬼剑,魔枪,守护,暗夜,全职2觉,弓箭,待定1,待定2,待定3,待定4,待定5,待定6,待定7,待定8,待定9" header-height="35" first-column-type="check" first-column-width="40" cell-border-style="solid" cell-border-color="#cccccc" selected-row-back-color="#add8e6" cellfontsize="16"/>
<!-- 总体为水平布局,分为左右 -->
<hlayout height="150" style="border: 1px solid #808080; border-radius: 1px;">
<!-- 左边部分,再次分为上下 -->
<vlayout padding="5">
<tilelist padding="5">
<!-- UidKey -->
<hlayout size="180,25" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="Key:" width="40"></label>
<edit class="adminUserEdit" readonly="true" id="adminUserUidKey" width="auto"></edit>
</hlayout>
<!-- 许可 -->
<hlayout size="100,25" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="许可:" width="40"></label>
<!-- <edit class="adminUserEdit" readonly="true" text="默认" id="adminUserLisence" width="auto"></edit> -->
<select class="adminUserEdit" item="禁止, 默认, 验机" index="0" width="60"></select>
</hlayout>
<!-- ip -->
<hlayout size="155,25" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="IP:" width="40"></label>
<edit class="adminUserEdit" id="adminUserIP" width="auto"></edit>
</hlayout>
<!-- 用户 -->
<hlayout size="155,25" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="用户:" width="40"></label>
<edit class="adminUserEdit" id="adminUserName" width="auto"></edit>
</hlayout>
<!-- 备注 -->
<hlayout size="155,25" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="备注:" width="40"></label>
<edit class="adminUserEdit" id="adminUserRemark" width="auto"></edit>
</hlayout>
<!-- 机器码 -->
<hlayout size="250,25" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="机器码:" width="40"></label>
<edit class="adminUserEdit" id="adminUserMac" width="auto"></edit>
</hlayout>
<!-- 文件MD5 -->
<hlayout size="230,25" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="MD5:" width="40"></label>
<edit class="adminUserEdit" id="adminUserMD5" width="auto"></edit>
</hlayout>
</tilelist>
<!-- 总体为水平布局,左边还有个上下布局 -->
<hlayout>
<!-- 购买详情 -->
<hlayout height="auto" width="130" padding="5" margin-left="5" margin-right="10" margin-top="5" margin-bottom="10">
<label class="adminUserLable" text="购买:" width="40"></label>
<edit multiline="true" id="adminUserPurchased" width="auto" style="border: 1px solid #808080; border-radius: 2px; font-size: 10px; "></edit>
</hlayout>
<!-- QQ -->
<hlayout height="auto" width="130" padding="5" margin-left="5" margin-right="10" margin-top="5" margin-bottom="10">
<label class="adminUserLable" text="QQ:" width="40"></label>
<edit multiline="true" id="adminUserQQ" width="auto" style="border: 1px solid #808080; border-radius: 2px; font-size: 10px; "></edit>
</hlayout>
<!-- ani路径集 -->
<hlayout height="auto" padding="5" margin-left="5" margin-right="10" margin-top="5" margin-bottom="10">
<label class="adminUserLable" text="ani路径集:" width="80"></label>
<edit multiline="true" class="adminUserEdit" id="adminUserPaths" width="auto"></edit>
</hlayout>
</hlayout>
</vlayout>
<!-- 右边部分,流式布局,子布局需要指定宽高 -->
<tilelist padding="5" style="border: 1px solid #808080; border-radius: 1px;">
<!-- 本地dnfdev.bin使用期限 -->
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="本地期限:" width="70"></label>
<edit class="adminUserEdit" id="adminUserFileTime" width="auto"></edit>
</hlayout>
<!-- 基础功能期限 -->
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="基础期限:" width="70"></label>
<edit class="adminUserEdit" id="adminUserCommonTime" width="auto"></edit>
</hlayout>
<!-- 女圣职期限 -->
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="女圣期限:" width="70"></label>
<edit class="adminUserEdit" id="adminUserATPriestTime" width="auto"></edit>
</hlayout>
<!-- 女鬼剑期限 -->
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="女鬼期限:" width="70"></label>
<edit class="adminUserEdit" id="adminUserATSwordmanTime" width="auto"></edit>
</hlayout>
<!-- 魔枪期限 -->
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="魔枪期限:" width="70"></label>
<edit class="adminUserEdit" id="adminUserDemoniclancerTime" width="auto"></edit>
</hlayout>
<!-- 守护期限 -->
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="守护期限:" width="70"></label>
<edit class="adminUserEdit" id="adminUserKnightTime" width="auto"></edit>
</hlayout>
<!-- 弓箭期限 -->
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="弓箭期限:" width="70"></label>
<edit class="adminUserEdit" id="adminUserArcherTime" width="auto"></edit>
</hlayout>
<!-- 暗夜期限 -->
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="暗夜期限:" width="70"></label>
<edit class="adminUserEdit" id="adminUserThiefTime" width="auto"></edit>
</hlayout>
<!-- 全职2觉期限 -->
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="二觉期限:" width="70"></label>
<edit class="adminUserEdit" id="adminUserSkill2ndTime" width="auto"></edit>
</hlayout>
<!-- 待定1期限 -->
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="待定1期限:" width="70"></label>
<edit class="adminUserEdit" id="adminUserTemp1Time" width="auto"></edit>
</hlayout>
<!-- 待定2期限 -->
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="待定2期限:" width="70"></label>
<edit class="adminUserEdit" id="adminUserTemp2Time" width="auto"></edit>
</hlayout>
<!-- 待定3期限 -->
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="待定3期限:" width="70"></label>
<edit class="adminUserEdit" id="adminUserTemp3Time" width="auto"></edit>
</hlayout>
<!-- 待定4期限 -->
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="待定4期限:" width="70"></label>
<edit class="adminUserEdit" id="adminUserTemp4Time" width="auto"></edit>
</hlayout>
<!-- 待定5期限 -->
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="待定5期限:" width="70"></label>
<edit class="adminUserEdit" id="adminUserTemp5Time" width="auto"></edit>
</hlayout>
<!-- 待定6期限 -->
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="待定6期限:" width="70"></label>
<edit class="adminUserEdit" id="adminUserTemp6Time" width="auto"></edit>
</hlayout>
<!-- 待定7期限 -->
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="待定7期限:" width="70"></label>
<edit class="adminUserEdit" id="adminUserTemp7Time" width="auto"></edit>
</hlayout>
<!-- 待定8期限 -->
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="待定8期限:" width="70"></label>
<edit class="adminUserEdit" id="adminUserTemp8Time" width="auto"></edit>
</hlayout>
<!-- 待定9期限 -->
<hlayout size="160,30" padding="5" margin-left="5" margin-right="5" margin-top="5" margin-bottom="5">
<label class="adminUserLable" text="待定9期限:" width="70"></label>
<edit class="adminUserEdit" id="adminUserTemp9Time" width="auto"></edit>
</hlayout>
</tilelist>
</hlayout>
</vlayout>
<!-- 第四 输出框区域 -->
<textbox id="textAdminOutput" padding="5,5" margin-left="10px" valign="top" halign="left" readonly="true" multiline="true" margin-right="10px" margin-bottom="15px" height="100" style="border: 1px solid #808080; border-radius: 2px; font-size: 12px; background-color: #FAFAFA; " text=""></textbox>
</vlayout>
<!-- 第二个选项卡 垂直布局 -->
<vlayout id="mainTabTools" title="设置" padding="10">
<label text="这是工具页面"></label>
</vlayout>
</tablayout>
</hbox>
</vlayout>
<style>
#mainLayout {
background-color: #F5F5F5;
border-radius: 5px;
font-size: 14px;
}
/*侧边栏按钮:鼠标悬浮时候的外观*/
.sideButton:hover {
background-color: #FFFFFF;
}
/*侧边栏按钮:激活时候的外观*/
.sideButton:active {
background-color: #FFFFFF;
}
/*连接按钮:鼠标悬浮时候的外观*/
#btnAdminConnect:hover {
background-color: #29CE86;
}
/*连接按钮:激活时候的外观*/
#btnAdminConnect:active {
background-color: #31D690;
}
/*业务区域按钮*/
.adminButtons {
color: #FFFFFF;
background-color: #00B96B;
border-radius: 5px;
font-size: 14px;
}
/*业务区域按钮:鼠标悬浮时候的外观*/
.adminButtons:hover {
background-color: #29CE86;
}
/*业务区域按钮:激活时候的外观*/
.adminButtons:active {
background-color: #31D690;
}
/*管理界面中编辑框:*/
.adminEdit {
border: 1px solid #808080;
border-radius: 4px;
}
/*管理界面中用户各属性的label*/
.adminUserLable {
font-family: Arial;
font-size: 12px;
}
/*管理界面中用户各属性的编辑框:*/
.adminUserEdit {
border: 1px solid #808080;
border-radius: 2px;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB