使用双窗口
This commit is contained in:
@@ -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.
@@ -1,14 +1,2 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by DemoUi.rc
|
||||
|
||||
// <20>¶<EFBFBD><C2B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>Ĭ<EFBFBD><C4AC>ֵ
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -18,4 +18,4 @@
|
||||
#include "EzUI/TileListView.h"//瓦片列表
|
||||
#include "EzUI/LayeredWindow.h"//分层窗口类-可以异型透明窗口
|
||||
#include "ezui/UIManager.h"//ui管理类(使用xml生成控件)
|
||||
|
||||
#include "EzUI/Animation.h"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#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()) {
|
||||
/*if (!ckbox->GetCheck()) {
|
||||
::MessageBoxW(Hwnd(), L"<22><><EFBFBD>Ķ<EFBFBD>Э<EFBFBD>鲢<EFBFBD><E9B2A2>ѡ!", L"<22><>ʾ", 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(); // <20><><EFBFBD>ص<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>
|
||||
static mainForm mainForm;
|
||||
mainForm.Show(); // <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
//if (user == "ad" && pwd == "123") {
|
||||
// ::MessageBoxW(Hwnd(), L"<22><>¼<EFBFBD>ɹ<EFBFBD>!", L"<22><>ʾ", MB_OK);
|
||||
// Hide(); // <20><><EFBFBD>ص<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>
|
||||
// static mainForm mainForm;
|
||||
// mainForm.Show(); // <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//}
|
||||
//else {
|
||||
// ::MessageBoxW(Hwnd(), L"<22>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!", L"<22><>ʾ", MB_OK);
|
||||
//}
|
||||
}
|
||||
if (sender->Name == "btnExit") {
|
||||
Application::Exit();
|
||||
}
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if (!sender->GetAttribute("url").empty()) {
|
||||
::ShellExecuteA(0, "open", sender->GetAttribute("url").c_str(), "", "", SW_SHOW);
|
||||
}
|
||||
|
||||
60
demo/Adminstor/Adminstor/mainForm.cpp
Normal file
60
demo/Adminstor/Adminstor/mainForm.cpp
Normal file
@@ -0,0 +1,60 @@
|
||||
#include "pch.h"
|
||||
#include "mainForm.h"
|
||||
|
||||
void mainForm::OnNotify(Control* sender, EventArgs& args)
|
||||
{
|
||||
UIString btnName = sender->Name; // <20>ؼ<EFBFBD>id
|
||||
Event eventType = args.EventType; // <20>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
switch (eventType)
|
||||
{
|
||||
case ezui::OnMouseDown: //<2F><><EFBFBD>갴<EFBFBD><EAB0B4>
|
||||
{
|
||||
if (btnName == "btnExitMain") { //<2F>˳<EFBFBD>
|
||||
int result = ::MessageBoxW(Hwnd(), L"Ҫ<EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", L"<EFBFBD><EFBFBD>ʾ", MB_YESNO | MB_ICONQUESTION);
|
||||
if (result == IDYES)
|
||||
exit(0);
|
||||
}
|
||||
else if (btnName == "btnMinMain") { //<2F><>С<EFBFBD><D0A1>
|
||||
this->ShowMinimized();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ezui::OnMouseDoubleClick: //<2F><><EFBFBD><EFBFBD>˫<EFBFBD><CBAB>
|
||||
{
|
||||
//if (btnName == "titleMain") { //<2F><><EFBFBD>Ⲽ<EFBFBD><E2B2BC>
|
||||
// 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); // <20><><EFBFBD>ô<EFBFBD><C3B4>ڴ<EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD>
|
||||
SetMiniSize(Size(600, 450)); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD>ߴ<EFBFBD>
|
||||
umg.LoadXml("res/mainForm.htm");//<2F><><EFBFBD><EFBFBD>xml<6D><6C><EFBFBD><EFBFBD><EFBFBD>Ŀؼ<C4BF><D8BC><EFBFBD><EFBFBD><EFBFBD>ʽ
|
||||
umg.SetupUI(this);
|
||||
}
|
||||
|
||||
mainForm::~mainForm()
|
||||
{
|
||||
}
|
||||
20
demo/Adminstor/Adminstor/mainForm.h
Normal file
20
demo/Adminstor/Adminstor/mainForm.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
#include "pch.h"
|
||||
|
||||
using namespace ezui;
|
||||
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
class mainForm :public LayeredWindow
|
||||
{
|
||||
private:
|
||||
//ui<75><69><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
UIManager umg;
|
||||
protected:
|
||||
virtual void OnNotify(Control* sender, EventArgs& args)override;//<2F><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>֪ͨ
|
||||
virtual void OnClose(bool& close)override;//<2F><><EFBFBD><EFBFBD><EFBFBD>ڹرյ<D8B1>ʱ<EFBFBD><CAB1>
|
||||
public:
|
||||
mainForm();
|
||||
virtual ~mainForm();
|
||||
};
|
||||
|
||||
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; //支持异形透明窗口(带阴影)
|
||||
|
||||
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>
|
||||
Reference in New Issue
Block a user