61 lines
1.1 KiB
C++
61 lines
1.1 KiB
C++
#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();
|
|
}
|
|
}
|
|
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()
|
|
{
|
|
}
|