2022-03-03 23:22:08 +08:00
|
|
|
#include "websocket_client_form.h"
|
|
|
|
|
2022-03-09 16:25:04 +08:00
|
|
|
WebsocketClientForm::WebsocketClientForm(ui::Window* hwnd, string url, WebsocketClient* p)
|
2022-03-03 23:22:08 +08:00
|
|
|
{
|
2022-03-09 16:25:04 +08:00
|
|
|
if (nullptr != hwnd) {
|
|
|
|
this->SetWindow(hwnd, nullptr, false);
|
|
|
|
}
|
|
|
|
mWebsocketClient = p;
|
|
|
|
|
2022-03-03 23:22:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
WebsocketClientForm::~WebsocketClientForm()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void WebsocketClientForm::Init()
|
|
|
|
{
|
|
|
|
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_uart_send_edit = dynamic_cast<ui::RichEdit*>(FindSubControl(L"uart_send_edit"));
|
|
|
|
m_btn_send_data = dynamic_cast<ui::Button*>(FindSubControl(L"btn_send_data"));
|
|
|
|
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"));
|
|
|
|
m_btn_save_lua = dynamic_cast<ui::Button*>(FindSubControl(L"btn_save_lua"));
|
|
|
|
m_btn_close_form = dynamic_cast<ui::Button*>(FindSubControl(L"btn_close_uart"));
|
2022-03-09 00:28:31 +08:00
|
|
|
|
2022-03-09 16:25:04 +08:00
|
|
|
if (nullptr != m_btn_close_form)
|
|
|
|
m_btn_close_form->AttachClick([this](const ui::EventArgs *ev) {
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
if(nullptr != m_btn_save_lua)
|
|
|
|
m_btn_save_lua->AttachClick(
|
|
|
|
[this](ui::EventArgs* ev)
|
|
|
|
{
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
if (nullptr != m_btn_send_data) {
|
|
|
|
m_btn_send_data->AttachClick([this](const ui::EventArgs* ev) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
});
|
2022-03-09 00:28:31 +08:00
|
|
|
|
2022-03-09 16:25:04 +08:00
|
|
|
}
|
2022-03-03 23:22:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
LuaDelegate* WebsocketClientForm::LuaVM()
|
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
2022-03-09 16:25:04 +08:00
|
|
|
|
|
|
|
void WebsocketClientForm::ShowDataInEdit(const char*src)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|