summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-12-16 20:10:30 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-12-16 20:10:30 +0300
commit060f3c97377b45aa12cdd4f01baab1a52748f4a3 (patch)
treee793009494e078ad0375b5b5296a1ba6882565bb /src/core
parentf9334351bbe94ec92d067fe6c20e958a71e3a5db (diff)
fixes #2141 (StdUserInfo doesn't handle OK button properly)
Diffstat (limited to 'src/core')
-rw-r--r--src/core/stduserinfo/src/userinfo.cpp55
1 files changed, 28 insertions, 27 deletions
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp
index e5eec70837..f5f874239a 100644
--- a/src/core/stduserinfo/src/userinfo.cpp
+++ b/src/core/stduserinfo/src/userinfo.cpp
@@ -288,6 +288,34 @@ public:
return true;
}
+ bool OnApply() override
+ {
+ PSHNOTIFY pshn;
+ pshn.hdr.idFrom = 0;
+ pshn.lParam = (LPARAM)m_hContact;
+ if (m_currentPage != -1) {
+ pshn.hdr.code = PSN_KILLACTIVE;
+ pshn.hdr.hwndFrom = m_pages[m_currentPage].hwnd;
+ if (SendMessage(m_pages[m_currentPage].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn))
+ return false;
+ }
+
+ pshn.hdr.code = PSN_APPLY;
+ for (auto &odp : m_pages) {
+ if (odp->hwnd == nullptr || !odp->changed)
+ continue;
+ pshn.hdr.hwndFrom = odp->hwnd;
+ if (SendMessage(odp->hwnd, WM_NOTIFY, 0, (LPARAM)&pshn) == PSNRET_INVALID_NOCHANGEPAGE) {
+ m_tree.Select(odp->hItem, TVGN_CARET);
+ if (m_currentPage != -1) ShowWindow(m_pages[m_currentPage].hwnd, SW_HIDE);
+ m_currentPage = m_pages.indexOf(&odp);
+ ShowWindow(m_pages[m_currentPage].hwnd, SW_SHOW);
+ return false;
+ }
+ }
+ return true;
+ }
+
void OnDestroy() override
{
wchar_t name[128];
@@ -478,33 +506,6 @@ public:
}
}
- void onClick_Ok(CCtrlButton *)
- {
- PSHNOTIFY pshn;
- pshn.hdr.idFrom = 0;
- pshn.lParam = (LPARAM)m_hContact;
- if (m_currentPage != -1) {
- pshn.hdr.code = PSN_KILLACTIVE;
- pshn.hdr.hwndFrom = m_pages[m_currentPage].hwnd;
- if (SendMessage(m_pages[m_currentPage].hwnd, WM_NOTIFY, 0, (LPARAM)&pshn))
- return;
- }
-
- pshn.hdr.code = PSN_APPLY;
- for (auto &odp : m_pages) {
- if (odp->hwnd == nullptr || !odp->changed)
- continue;
- pshn.hdr.hwndFrom = odp->hwnd;
- if (SendMessage(odp->hwnd, WM_NOTIFY, 0, (LPARAM)&pshn) == PSNRET_INVALID_NOCHANGEPAGE) {
- m_tree.Select(odp->hItem, TVGN_CARET);
- if (m_currentPage != -1) ShowWindow(m_pages[m_currentPage].hwnd, SW_HIDE);
- m_currentPage = m_pages.indexOf(&odp);
- ShowWindow(m_pages[m_currentPage].hwnd, SW_SHOW);
- return;
- }
- }
- }
-
void onClick_Update(CCtrlButton *)
{
if (m_infosUpdated != NULL) {