2021-10-11 00:00:10 +08:00
|
|
|
|
#include "tcp_client_form.h"
|
2021-11-21 13:47:19 +08:00
|
|
|
|
#include "utils.h"
|
2021-10-11 00:00:10 +08:00
|
|
|
|
|
2021-10-11 00:54:04 +08:00
|
|
|
|
TcpClientForm::TcpClientForm(ui::Window* hwnd,std::string url, uint32_t port, TcpClientLibevent* p)
|
2021-10-11 00:00:10 +08:00
|
|
|
|
{
|
|
|
|
|
mClient = p;
|
2021-10-11 00:54:04 +08:00
|
|
|
|
if (nullptr != hwnd) {
|
|
|
|
|
this->SetWindow(hwnd, nullptr, false);
|
|
|
|
|
}
|
2021-11-21 13:47:19 +08:00
|
|
|
|
m_url = url;
|
|
|
|
|
m_port = port;
|
|
|
|
|
|
2021-10-11 00:00:10 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TcpClientForm::Init()
|
|
|
|
|
{
|
2021-10-11 00:54:04 +08:00
|
|
|
|
ui::ChildBox::Init();
|
|
|
|
|
|
|
|
|
|
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"));
|
|
|
|
|
m_rich_edit_2 = dynamic_cast<ui::RichEdit*>(FindSubControl(L"lua_script"));
|
|
|
|
|
m_rich_edit_3 = dynamic_cast<ui::RichEdit*>(FindSubControl(L"uart_send_edit"));
|
|
|
|
|
m_button_1 = dynamic_cast<ui::Button*>(FindSubControl(L"btn_send_data"));
|
|
|
|
|
m_check_box_1 = dynamic_cast<ui::CheckBox*>(FindSubControl(L"check_new_line"));
|
|
|
|
|
m_check_box_2 = dynamic_cast<ui::CheckBox*>(FindSubControl(L"check_time_send"));
|
|
|
|
|
m_check_box_3 = dynamic_cast<ui::CheckBox*>(FindSubControl(L"check_hex_send"));
|
|
|
|
|
m_check_box_4 = dynamic_cast<ui::CheckBox*>(FindSubControl(L"check_hex_recv"));
|
2021-10-11 00:00:10 +08:00
|
|
|
|
|
2021-11-21 13:47:19 +08:00
|
|
|
|
|
|
|
|
|
wchar_t p[100] = { 0 };
|
|
|
|
|
wsprintf(p, L"<EFBFBD><EFBFBD>ַ%s,<2C>˿ں<CBBF>%d ", string2wstring(m_url).c_str(),m_port);
|
|
|
|
|
m_label_1->SetText(std::wstring(p));
|
|
|
|
|
|
2021-10-11 00:00:10 +08:00
|
|
|
|
}
|
|
|
|
|
|
2021-10-12 00:51:48 +08:00
|
|
|
|
|
2021-10-11 00:00:10 +08:00
|
|
|
|
void TcpClientForm::HandleMessage(ui::EventArgs& msg)
|
|
|
|
|
{
|
|
|
|
|
}
|