no message
This commit is contained in:
parent
e44f576a79
commit
905410fde2
@ -64,7 +64,32 @@ LRESULT BasicForm::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
SerialPort::ClosePort(PortNum);
|
||||
}
|
||||
if (uMsg == WM_USER_UDP_GROUP_CLOSE) {
|
||||
if (mRightShow == nullptr)
|
||||
return true;
|
||||
wprintf(L"close %s\r\n", ((wstring*)wParam)->c_str());
|
||||
mRightShow->SetVisible(false);
|
||||
mRightShow = nullptr;
|
||||
mRightSide->SetAutoDestroy(true);
|
||||
mRightSide->RemoveAll();
|
||||
mUdpForm.erase(*(wstring*)(wParam));
|
||||
int cnt = mMonitor->GetRootNode()->GetChildNode(4)->GetChildNodeCount();
|
||||
ui::TreeNode* p = nullptr;
|
||||
for (int i = 0; i < cnt; i++) {
|
||||
if (mMonitor->GetRootNode()->GetChildNode(4)->GetChildNode(i)->GetText()
|
||||
== *(wstring*)(wParam)) {
|
||||
p = mMonitor->GetRootNode()->GetChildNode(4)->GetChildNode(i);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
mMonitor->GetRootNode()->GetChildNode(4)->RemoveChildNode(p);
|
||||
delete mRightShow;
|
||||
mRightShow = nullptr;
|
||||
}
|
||||
if (uMsg == WM_USER_UDP_CLOSE) {
|
||||
if (mRightShow == nullptr)
|
||||
return true;
|
||||
wprintf(L"close %s\r\n", ((wstring*)wParam)->c_str());
|
||||
mRightShow->SetVisible(false);
|
||||
mRightShow = nullptr;
|
||||
@ -252,6 +277,7 @@ LRESULT BasicForm::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
mUdpForm[pdata] = form;
|
||||
if (!mRightSide->Add(form))
|
||||
printf("error 1");
|
||||
|
||||
}
|
||||
node->AttachAllEvents(
|
||||
[this](ui::EventArgs* ev) {
|
||||
|
@ -3,7 +3,6 @@
|
||||
#define WM_USER_POS_CHANGED (WM_USER + 2)
|
||||
#define WM_ADD_UART_MONITOR (WM_USER + 3)
|
||||
#define WM_ADD_TCPCLIENT_MONITOR (WM_USER + 4)
|
||||
|
||||
#define WM_ADD_UART_RECVDATA (WM_USER + 5)
|
||||
#define WM_ADD_UART_CLOSE (WM_USER + 6)
|
||||
#define WM_ADD_TCPSERVER_MONITOR (WM_USER + 7)
|
||||
@ -13,3 +12,4 @@
|
||||
#define WM_USER_UDP_CLOSE (WM_USER + 10)
|
||||
#define WM_USER_TCP_CLIENT_CLOSE (WM_USER + 11)
|
||||
#define WM_USER_TCP_SERVER_CLOSE (WM_USER + 12)
|
||||
#define WM_USER_UDP_GROUP_CLOSE (WM_USER + 13)
|
||||
|
@ -236,9 +236,6 @@ void ServerCallbacks::server_run(TcpServerLibevent* p) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @param {*}
|
||||
|
@ -58,8 +58,12 @@ void UdpForm::Init()
|
||||
ui::Button* m_button_3 = dynamic_cast<ui::Button*>(FindSubControl(L"btn_save_lua"));
|
||||
ui::Button* m_button_4 = dynamic_cast<ui::Button*>(FindSubControl(L"btn_do_lua"));
|
||||
|
||||
|
||||
|
||||
|
||||
m_label_1 = dynamic_cast<ui::Label*>(FindSubControl(L"uart_info_label"));
|
||||
m_rich_edit_1 = dynamic_cast<ui::RichEdit*>(FindSubControl(L"uart_recv_eidt"));
|
||||
|
||||
if (nullptr != m_rich_edit_1) {
|
||||
m_rich_edit_1->SetReadOnly(true);
|
||||
m_rich_edit_1->SetRich(false);
|
||||
|
@ -98,7 +98,9 @@ void UdpGroupForm::Init()
|
||||
if (nullptr != m_button_2) {
|
||||
m_button_2->AttachClick(
|
||||
[this](ui::EventArgs*) {
|
||||
|
||||
wstring* name = new wstring(this->GetName());
|
||||
::PostMessage(this->GetWindow()->GetHWND(),
|
||||
WM_USER_UDP_GROUP_CLOSE, (WPARAM)name, 0);
|
||||
return true;
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user