使用双窗口

This commit is contained in:
睿 安
2026-01-26 18:36:55 +08:00
parent 37e7d278bd
commit 1be1ecbbf2
19 changed files with 451 additions and 26 deletions

View 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()
{
}