使用双窗口
This commit is contained in:
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()
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user