diff --git a/duilib/duilib.vcxproj b/duilib/duilib.vcxproj
index 498d910a..7a3c4fa3 100644
--- a/duilib/duilib.vcxproj
+++ b/duilib/duilib.vcxproj
@@ -34,7 +34,7 @@
StaticLibrary
false
Unicode
- v120_xp
+ v142
StaticLibrary
diff --git a/examples/Debug/resources/themes/default/basic/basic.xml b/examples/Debug/resources/themes/default/basic/basic.xml
deleted file mode 100644
index d3ed2809..00000000
--- a/examples/Debug/resources/themes/default/basic/basic.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/Debug/resources/themes/default/basic/newmonitor.xml b/examples/Debug/resources/themes/default/basic/newmonitor.xml
deleted file mode 100644
index 48e9a4ba..00000000
--- a/examples/Debug/resources/themes/default/basic/newmonitor.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/Debug/resources/themes/default/basic/uart_form.xml b/examples/Debug/resources/themes/default/basic/uart_form.xml
deleted file mode 100644
index f663bc76..00000000
--- a/examples/Debug/resources/themes/default/basic/uart_form.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/examples/cef/cef_form.cpp b/examples/cef/cef_form.cpp
index 72cebd2c..4d09f7bc 100644
--- a/examples/cef/cef_form.cpp
+++ b/examples/cef/cef_form.cpp
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "cef_form.h"
+#include
const std::wstring CefForm::kClassName = L"CEF_Control_Example";
@@ -135,4 +136,8 @@ void CefForm::OnLoadEnd(int httpStatusCode)
nim_comp::Toast::ShowToast(nbase::UTF8ToUTF16(params), 3000, GetHWND());
callback(false, R"({ "message": "Success." })");
}));
+ cef_control_->AttachUrlChange([this](const std::wstring& url) {
+ std::cout << "goto url";
+ return;
+ });
}
diff --git a/examples/proto_debuger/base_form.cpp b/examples/proto_debuger/base_form.cpp
index 34c8af66..64d4135b 100644
--- a/examples/proto_debuger/base_form.cpp
+++ b/examples/proto_debuger/base_form.cpp
@@ -573,6 +573,10 @@ LRESULT BasicForm::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
if (ui::EventType::kEventSelect == ev->Type) {
wprintf(L"%s\r\n", dynamic_cast (ev->pSender)->GetText().c_str());
printf("GetCurSel %d\r\n", mRightSide->GetCurSel());
+
+ /*if (mRightSide->GetCurSel() < 0) {
+ return false;
+ }*/
ModbusMasterForm* p = mModbusMasterForm[dynamic_cast (ev->pSender)->GetText()];
if (p != nullptr) {
p->SetAutoDestroy(true);
@@ -589,7 +593,7 @@ LRESULT BasicForm::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
}
}
}
- return true;
+ return true;
});
}
return WindowImplBase::HandleMessage(uMsg, wParam, lParam);
diff --git a/examples/proto_debuger/modbus_form.cpp b/examples/proto_debuger/modbus_form.cpp
index 072d30eb..3e6edec4 100644
--- a/examples/proto_debuger/modbus_form.cpp
+++ b/examples/proto_debuger/modbus_form.cpp
@@ -1,13 +1,17 @@
#include "modbus_form.h"
#include "lua_bind.h"
#include "msgdef.h"
-
+#include
ModbusMasterForm::ModbusMasterForm(ui::Window* hwnd, std::wstring name,
uint32_t baurate, UINT portnum,
uint8_t data_bits, uint8_t stop_bits,
- uint8_t verify, uint8_t flow_control) {
+ uint8_t verify, uint8_t flow_control)
+ :m_rich_edit_1(nullptr),
+ m_rich_edit_2(nullptr),
+ m_rich_edit_3(nullptr)
+{
m_portnum = portnum;
m_name = name;
@@ -34,30 +38,6 @@ ModbusMasterForm::ModbusMasterForm(ui::Window* hwnd, std::wstring name,
std::cout << "lua script is " << lua_script << std::endl;
- /*
- m_thread_recv = new std::thread([this]() {
- UINT PortNum = 0;
- for (int i = 3; m_name[i] != '\0'; i++)
- {
- PortNum = PortNum * 10 + (m_name[i] - '0');
- }
- char recv[1024] = { 0 };
- while (this->m_runing) {
- if (0 < SerialPort::ReadPort(PortNum, recv, 1024)) {
- printf("recv data: %s", recv);
- this->m_show_recv += string2wstring(recv);
- this->mLua->CallFuntion("OnUartData", std::string(recv));
- if (this->mEditRecv != nullptr) {
- this->mEditRecv->AppendText(string2wstring(recv), false);
- ::PostMessage(this->GetWindow()->GetHWND(), WM_ADD_UART_RECVDATA, 0, 0);
- }
- }
- else {
- Sleep(100);
- }
- }
- });
- */
if (nullptr != hwnd) {
// set window so we get getwindow by GetWindow funtion
this->SetWindow(hwnd, nullptr, false);
@@ -106,19 +86,58 @@ void ModbusMasterForm::Init() {
ptr->tv_usec = 0;
modbus_set_response_timeout(mModbus, ptr);
uint16_t dest[32];
- ret = modbus_read_registers(mModbus, 0x31, 1, dest);
+ if (m_rich_edit_1) {
+
+ }
+ uint16_t addr = 0;
+ if (m_rich_edit_1) {
+ int i = 0;
+ nbase::StringToInt(m_rich_edit_1->GetText(),&i);
+ addr = uint16_t(i);
+ }
+ ret = modbus_read_registers(mModbus, addr, 1, dest);
if (ret < 0) {
printf("read %d timeout %d ", ret);
+ }else {
+ for (int i = 0; i < ret; i++) {
+ ui::ListContainerElement* element = new ui::ListContainerElement;
+ element->SetText(nbase::StringPrintf(L"ַ%d: %d", addr + i,dest[i]));
+ element->SetClass(L"listitem");
+ element->SetFixedHeight(30);
+ element->SetFont(L"system_20");
+ m_list->RemoveAll();
+ m_list->Add(element);
+ }
}
+
+
+ std::string str;
modbus_flush(mModbus);
modbus_close(mModbus);
}
-
return false;
});
}
+
+
+ m_list = dynamic_cast(FindSubControl(L"list"));
+
+
+ /*
+ ui::ListBox* list = dynamic_cast(FindSubControl(L"list"));
+ if (list != nullptr) {
+ for (auto i = 0; i < 30; i++)
+ {
+ std::cout << "123";
+ ui::ListContainerElement* element = new ui::ListContainerElement;
+ element->SetText(nbase::StringPrintf(L"ListElement %d", i));
+ element->SetClass(L"listitem");
+ element->SetFixedHeight(20);
+ list->Add(element);
+ }
+ }
/*
mEditSend = dynamic_cast(FindSubControl(L"uart_send_edit"));
diff --git a/examples/proto_debuger/modbus_form.h b/examples/proto_debuger/modbus_form.h
index 9182530a..695031e3 100644
--- a/examples/proto_debuger/modbus_form.h
+++ b/examples/proto_debuger/modbus_form.h
@@ -56,6 +56,7 @@ public:
ui::Button* m_button_1;
ui::RichEdit* m_rich_edit_2;
ui::RichEdit* m_rich_edit_3;
+ ui::ListBox* m_list;
HWND m_hwnd;
LuaDelegate* mLua;
diff --git a/examples/proto_debuger/new_monitor_form.cpp b/examples/proto_debuger/new_monitor_form.cpp
index a7263b7f..7d0c5c56 100644
--- a/examples/proto_debuger/new_monitor_form.cpp
+++ b/examples/proto_debuger/new_monitor_form.cpp
@@ -274,7 +274,6 @@ void NewMonitorForm::InitWindow()
}
this->Close();
return true;
-
}
if (m_combo_type->GetText() == L"modbus salve") {
UINT PortNum = 0;