text控件:新增光标后插入;新增可控边界
This commit is contained in:
@@ -1,28 +1,64 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "mainForm.h"
|
||||
|
||||
void mainForm::OnNotify(Control* sender, EventArgs& args)
|
||||
{
|
||||
UIString btnName = sender->Name; // <EFBFBD>ؼ<EFBFBD>id
|
||||
Event eventType = args.EventType; // <EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
UIString btnName = sender->Name; // 控件id
|
||||
Event eventType = args.EventType; // 事件类型
|
||||
|
||||
switch (eventType)
|
||||
{
|
||||
case ezui::OnMouseDown: //<EFBFBD><EFBFBD><EFBFBD>갴<EFBFBD><EFBFBD>
|
||||
case ezui::OnMouseDown: //鼠标按下
|
||||
{
|
||||
if (btnName == "btnExitMain") { //<EFBFBD>˳<EFBFBD>
|
||||
int result = ::MessageBoxW(Hwnd(), L"Ҫ<EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", L"<EFBFBD><EFBFBD>ʾ", MB_YESNO | MB_ICONQUESTION);
|
||||
if (btnName == "btnExitMain") { //退出
|
||||
int result = ::MessageBoxW(Hwnd(), L"要退出程序吗?", L"提示", MB_YESNO | MB_ICONQUESTION);
|
||||
if (result == IDYES)
|
||||
exit(0);
|
||||
}
|
||||
else if (btnName == "btnMinMain") { //<EFBFBD><EFBFBD>С<EFBFBD><EFBFBD>
|
||||
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: //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˫<EFBFBD><EFBFBD>
|
||||
case ezui::OnMouseDoubleClick: //鼠标双击
|
||||
{
|
||||
//if (btnName == "titleMain") { //<EFBFBD><EFBFBD><EFBFBD>Ⲽ<EFBFBD><EFBFBD>
|
||||
//if (btnName == "titleMain") { //标题布局
|
||||
// if (this->IsMaximized()) {
|
||||
// this->ShowNormal();
|
||||
// }
|
||||
@@ -49,9 +85,9 @@ void mainForm::OnClose(bool& close)
|
||||
|
||||
mainForm::mainForm() :LayeredWindow(1000, 750)
|
||||
{
|
||||
SetResizable(true); // <EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD><EFBFBD>ڴ<EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
SetMiniSize(Size(600, 450)); // <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD>ߴ<EFBFBD>
|
||||
umg.LoadXml("res/mainForm.htm");//<EFBFBD><EFBFBD><EFBFBD><EFBFBD>xml<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀؼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ
|
||||
SetResizable(true); // 启用窗口大小调整
|
||||
SetMiniSize(Size(600, 450)); // 设置最小尺寸
|
||||
umg.LoadXml("res/mainForm.htm");//加载xml里面的控件与样式
|
||||
umg.SetupUI(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user